A116127 Number of numbers that are congruent to {2, 4} mod 6 between prime(n) and prime(n+1) inclusive.
1, 1, 0, 2, 0, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 0, 2, 4, 2, 2, 0, 4, 0, 2, 2, 2, 2, 2, 0, 4, 0, 2, 0, 4, 4, 2, 0, 2, 2, 0, 4, 2, 2, 2, 0, 2, 2, 0, 4, 4, 2, 0, 2, 4, 2, 4, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 0, 4, 0, 2, 2, 2, 2, 2, 0, 2, 4, 2, 2, 2, 2, 2, 4, 0, 6, 2, 4, 2, 2, 0, 2
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Magma
[ #[ k: k in [NthPrime(n)..NthPrime(n+1)] | r eq 2 or r eq 4 where r is k mod 6 ]: n in [1..105] ]; /* Klaus Brockhaus, Apr 15 2007 */
-
Maple
P:= select(isprime, [seq(i,i=5..1000,2)]): Delta:= P[2..-1]-P[1..-2]: f:= t -> (t + 2*(t+1 mod 3) - 2)/3: 1,1,op(map(f, Delta)); # Robert Israel, Jun 19 2019
-
Mathematica
s={};Do[c=0;Do[If[MemberQ[{2,4},Mod[i,6]],c=c+1],{i,Prime[n],Prime[n+1]}];AppendTo[s,c],{n,105}];s (* James C. McMahon, Aug 18 2024 *)
Extensions
Edited, corrected and extended by Klaus Brockhaus, Apr 15 2007
Comments