A054690 n consecutive primes differ by 4 or more starting at a(n), or n consecutive primes with no twin primes.
7, 19, 43, 73, 73, 349, 349, 349, 349, 349, 349, 661, 661, 661, 661, 661, 661, 661, 661, 8629, 8629, 8629, 8629, 13399, 13399, 13399, 14629, 14629, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421, 24421
Offset: 2
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 2..204
Programs
-
Maple
P:= select(isprime, [seq(i,i=3..10^7,2)]): A:= 'A': state:= 0: smax := 0: for i from 2 to nops(P) do if P[i] - P[i-1] >= 4 then state:= state + 1; if state > smax then smax:= state; A[state+1]:= P[i-state] fi else state:= 0; fi od: seq(A[i],i=2..smax+1); # Robert Israel, Jun 27 2017
-
Mathematica
Prime[#]&/@With[{pd=If[#>2,1,0]&/@Differences[Prime[Range[3000]]]}, Flatten[ Table[ SequencePosition[pd,PadRight[{},n,1],1][[All,1]],{n,45}]]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 29 2018 *)