The recursive function.
void recSeq(int counter){
if (counter <= 0 ) return; // first the exit condition
int value = counter -1;
recSeq(value ); // go down to the bottom, in order to print values from lovest values to higher
System.out.print(" "+(int)Math.pow(2, value )); // print the value
}
on Exit:
recSeq(6); // 1 2 4 8 16 32
solved Recursive method for 2,4,8,..in java [closed]