This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A116127 #26 Aug 18 2024 23:05:24 %S A116127 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, %T A116127 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, %U A116127 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 %N A116127 Number of numbers that are congruent to {2, 4} mod 6 between prime(n) and prime(n+1) inclusive. %C A116127 For n > 2, %C A116127 A001223(n) = 2 iff a(n) = 0, %C A116127 A001223(n) = 4 or 6 or 8 iff a(n) = 2, %C A116127 A001223(n) = 10 or 12 or 14 iff a(n) = 4, %C A116127 A001223(n) = 16 or 18 or 20 iff a(n) = 6, %C A116127 and so on. This can be generalized to %C A116127 A001223(n) = 3*k-2 or 3*k or 3*k+2 iff a(n) = k for k >= 2. %H A116127 Robert Israel, <a href="/A116127/b116127.txt">Table of n, a(n) for n = 1..10000</a> %p A116127 P:= select(isprime, [seq(i,i=5..1000,2)]): %p A116127 Delta:= P[2..-1]-P[1..-2]: %p A116127 f:= t -> (t + 2*(t+1 mod 3) - 2)/3: %p A116127 1,1,op(map(f, Delta)); # _Robert Israel_, Jun 19 2019 %t A116127 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 *) %o A116127 (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 */ %Y A116127 Cf. A000040 (primes), A001223 (differences between consecutive primes), A047235 (numbers congruent to {2, 4} mod 6), A002654. %K A116127 nonn,easy %O A116127 1,4 %A A116127 _Giovanni Teofilatto_, Apr 08 2007 %E A116127 Edited, corrected and extended by _Klaus Brockhaus_, Apr 15 2007