A105470 a(n)=1 if there is number of the form 6k+3 with prime(n) <= 6k+3 <= prime(n+1), otherwise 0.
1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1
Offset: 1
Examples
a(3)=0 because between prime(3) and prime(4) there are no numbers of the form 6k+3; a(4)=1 because between prime(4) and prime(5) there is one number of the form 6k+3: 9.
Programs
-
Mathematica
f[n_] := Count[Table[Mod[k, 6], {k, Prime[n], Prime[n + 1]}], 3];Table[If[f[n] == 0, 0, 1], {n, 120}] (* Ray Chandler, Oct 17 2006 *) Join[{1,1},If[Last[#]-First[#]==2,0,1]&/@Partition[Prime[Range[ 3,200]],2,1]] (* Harvey P. Dale, Nov 27 2013 *)
Extensions
Edited by Ray Chandler, Oct 17 2006
Comments