And I want to print out the value of x and y, if y%4==0 and the next value of y%4==0. Thus, the sample output is:
1 1 *because the previous x before 2 is 1
2 4 *because 4%4 == 0
7 9 *because the previous x before 8 is 7
8 4 *because 4%4 == 0
9 1 *because the previous x before 10 is 9
10 0 *because 0%4 == 0
...
1 0.1 #by default it will print out the first two value
2 0.4 #by default it will print out the first two value
3 0.9 # ABS(0.9 - 2 * 0.4 (y of 2)+ 0.1 (y of 1)) = 0.2, 0.2 < 0.25, thus, will not printed out
4 0.6 # ABS(0.6 - 2 * 0.4 (y of 2)+ 0.1 (y of 1)) = 0.1, 0.1 < 0.25, thus, will not printed out
5 0.5 # ABS(0.5 - 2 * 0.4 (y of 2)+ 0.1 (y of 1)) = 0.2, 0.2 < 0.25, thus, will not printed out
6 0.6 # ABS(0.6 - 2 * 0.4 (y of 2)+ 0.1 (y of 1)) = 0.1, 0.1 < 0.25, thus, will not printed out
7 0.9 # ABS(0.9 - 2 * 0.4 (y of 2)+ 0.1 (y of 1)) = 0.2, 0.2 < 0.25, thus, will not printed out But because the x=8 is printed out, x=7 will be printed out as well.
8 0.4 # ABS(0.4 - 2 * 0.4 (y of 2)+ 0.1 (y of 1)) = 0.3, 0.3 >= 0.25, thus, will printed out
9 0.1 # ABS(0.1 - 2 * 0.4 (y of 8)+ 0.9 (y of 7)) = 0.2, 0.2 < 0.25, thus, will not printed out
10 0.0 # ABS(0.0 - 2 * 0.4 (y of 8)+ 0.9 (y of 7)) = 0.1, 0.1 < 0.25, thus, will not printed out