A251092 a(n) is the number of primes in the n-th group of consecutive primes among the odd numbers.
3, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
Keywords
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
N:= 1000: # to use the first N+1 odd numbers L:= map(t -> isprime(2*t+1), [$1..N]): Starts:= [1, op(select(i -> L[i] and not L[i-1], [$2..N]))]: Ends:= select(i -> L[i] and not L[i+1], [$1..N-1]): seq(Ends[i]-Starts[i]+1,i=1..nops(Ends)); # Robert Israel, Mar 27 2015
-
Mathematica
Length /@ Split[Select[2 Range@ 1200 - 1, PrimeQ], #2 - #1 == 2 &] (* Michael De Vlieger, Mar 20 2015 *) Length/@DeleteCases[Split[Table[If[PrimeQ[n],1,0],{n,3,1001,2}]],?(FreeQ[ #,1]&)] (* _Harvey P. Dale, Jun 29 2021 *)
Comments