A027833 Distances between successive 2's in sequence A001223 of differences between consecutive primes.
1, 2, 2, 3, 3, 4, 3, 6, 2, 5, 2, 6, 2, 2, 4, 3, 5, 3, 4, 5, 12, 2, 6, 9, 6, 5, 4, 3, 4, 20, 2, 2, 4, 4, 19, 2, 3, 2, 4, 8, 11, 5, 3, 3, 3, 10, 5, 4, 2, 17, 3, 6, 3, 3, 9, 9, 2, 6, 2, 6, 5, 6, 2, 3, 2, 3, 9, 4, 7, 3, 7, 20, 4, 7, 6, 5, 3, 7, 3, 20, 2, 14, 4, 10, 2, 3, 6, 4, 2, 2, 7, 2, 6, 3
Offset: 1
Keywords
Links
Crossrefs
Programs
-
Maple
A027833 := proc(n) local plow,phigh ; phigh := A001359(n+1) ; plow := A001359(n) ; numtheory[pi](phigh)-numtheory[pi](plow) ; end proc: seq(A027833(n),n=1..100) ; # R. J. Mathar, Jan 20 2025
-
Mathematica
Differences[Flatten[Position[Differences[Prime[Range[500]]],2]]] (* Harvey P. Dale, Nov 17 2018 *) Length/@Split[Select[Range[4,10000],PrimeQ[#]&],#1+2!=#2&]//Most (* Gus Wiseman, Jun 11 2024 *)
-
PARI
n=1; p=5; forprime(q=7,1e3, if(q-p==2, print1(n", "); n=1, n++); p=q) \\ Charles R Greathouse IV, Aug 01 2016
-
Sage
def A027833(n) : a = [ ] st = 2 for i in (3..n) : if (nth_prime(i+1)-nth_prime(i) == 2) : a.append(i-st) st = i return(a) A027833(496) # Jani Melik, May 15 2014
Comments