OFFSET
1,1
COMMENTS
Primes p such that p, p+30, p+60, p+90 are consecutive primes.
The analogous sequence for a CPAP-5 (at least five consecutive primes in arithmetic progression) with gap 30 does not have its own entry in the OEIS, but for over 500 terms it is identical to A059044. The CPAP-6 analog is A058362. - M. F. Hasler, Jan 02 2020
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.
FORMULA
EXAMPLE
642427, 642457, 642487, 642517 are consecutive primes, so 642427 is in the sequence.
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 *)
PROG
(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:
(Magma) f:=func<n|NextPrime(n)>; 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
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jan 31 2000
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
STATUS
approved