/*I was able to output this: 0, 1, 1, X2, 3, 5, 8, X13, 21, 34, 55, X89, 144, 233, 377, X610, 987, 1597, 2584, X4181, 6765, however, I can seem to make it skip the numbers and replaces them with Q. I am stuck on this one. :(
import java.util.ArrayList;
import java.util.List;
public class FibonacciSequence {
public static void main(String[] args) {
long f = 0;
List<Integer> testList = new ArrayList<Integer>();
boolean executed;
for(int i = 1; i<=21; i++) {
f = fib(i);
String space = ", ";
if(i%4==0) {
String x = "X";
System.out.print(x);
}
System.out.print(fib(i) + ", ");
}
}
private static long fib(int i) {
if (i == 1) {
return 0;
}
if (i <= 2) {
return 1;
}
else {
return fib(i-1)+fib(i-2);
}
}
}