Loops help (Java)


#1

Hello I’m new to Java and need to make two for and while loops that one outputs 1 3 7 15 31 63 127 255 and the other outputs 1 1 2 3 5 8 13 21 34 55 89.


#2

The first series are power of 2 minus one.
The second one is called Fibbonachi series. First two are 1 and for the rest holds n = (n-1) + (n-2);