A052243 Initial prime in set of (at least) 4 consecutive primes in arithmetic progression with difference 30.
642427, 1058861, 3431903, 4176587, 4560121, 4721047, 5072269, 5145403, 5669099, 5893141, 6248969, 6285047, 6503179, 6682969, 8545357, 8776121, 8778739, 9490571, 9836227, 9843019, 9843049, 10023787, 11697979, 12057919, 12340313, 12687119, 12794641, 12845849
Offset: 1
Keywords
Examples
642427, 642457, 642487, 642517 are consecutive primes, so 642427 is in the sequence.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000 (terms n = 1..200 from M. F. Hasler)
- OEIS wiki, Consecutive primes in arithmetic progression: CPAP with given gap, updated Jan. 2020.
- Index entries for sequences related to primes in arithmetic progressions
Crossrefs
Programs
-
Magma
f:=func
; a:=[]; for p in PrimesInInterval(2,13000000) do if (f(p)-p eq 30) and (f(f(p))-p eq 60) and (f(f(f(p)))-p eq 90) then Append(~a,p); end if; end for; a; // Marius A. Burtea, Jan 04 2020 -
Maple
p := 2 : q := 3 : r := 5 : s := 7 : for i from 1 do if q-p = 30 and r-q=30 and s-r=30 then printf("%d,\n",p) ; fi ; p := q ; q := r ; r := s ; s := nextprime(r) ; od: # R. J. Mathar, Apr 12 2008
-
Mathematica
p=2; q=3; r=5; s=7; A052243 = Reap[For[i=1, i<1000000, i++, If[ q-p == 30 && r-q == 30 && s-r == 30 , Print[p]; Sow[p]]; p=q; q=r; r=s; s=NextPrime[r]]][[2, 1]] (* Jean-François Alcover, Jun 28 2012, after R. J. Mathar *) Transpose[Select[Partition[Prime[Range[1100000]],4,1],Union[ Differences[#]] =={30}&]][[1]] (* Harvey P. Dale, Jun 17 2014 *)
-
PARI
A052243(n,p=2,print_all=0,g=30,c,o)={forprime(q=p+1,,if(p+g!=p=q, next, q!=o+2*g, c=2, c++>3, print_all&& print1(o-g","); n--||break); o=q-g);o-g} \\ optional 2nd arg specifies starting point, allows to define: next_A052243(p)=A052243(1,p+1) \\ replacing older code from 2008. - M. F. Hasler, Oct 26 2018
Formula
Extensions
More terms from Harvey P. Dale, Nov 19 2000
Edited by N. J. A. Sloane, Apr 28 2008, at the suggestion of R. J. Mathar
Comments