OFFSET
0,4
EXAMPLE
a(0) = 0;
a(1) = 0 because prime(3)/prime(2) > prime(2)/prime(1) -> 5/3 > 3/2 => a(1) = 2*0 + 0= 0;
a(2) = 1 because prime(4)/prime(3) < prime(3)/prime(2) -> 7/5 < 5/3 => a(2) = 2*0 + 1 = 1;
a(3) = 2 because prime(5)/prime(4) > prime(4)/prime(3) -> 11/7 > 7/5 => a(3) = 2*1 + 0 = 2.
MAPLE
z0:=0: printf("%a, ", z0):for n from 1 to 40 do:p1:=ithprime(n):p2:=ithprime(n+1):p3:=ithprime(n+2):x:=evalf(p2/p1):y:=evalf(p3/p2):if y>x then k:=0:else k:=1:fi:z0:=2*z0 +k:printf("%a, ", z0):od:
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Aug 09 2012
STATUS
approved