login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A290635 Greatest of 4 consecutive primes with consecutive gaps 6, 4, 2. 1
43, 73, 283, 619, 1303, 1669, 1789, 1873, 1999, 2143, 2383, 2689, 2803, 4519, 5419, 5443, 5653, 7879, 9013, 11833, 13693, 14563, 17389, 18133, 18313, 20359, 21493, 22159, 24109, 27283, 32719, 35533, 36793, 37573, 41233, 41959, 42409, 42463, 44269, 47149, 50593, 55219, 55819, 55933 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
All terms = {13, 19} mod 30.
LINKS
FORMULA
a(n) = A078855(n) + 12.
EXAMPLE
43 is a member of the sequence because 43 is the greatest of the 4 consecutive primes 31, 37, 41, 43 with consecutive gaps 6, 4, 2; that is, 37 - 31 = 6, 41 - 37 = 4, 43 - 41 = 2.
MAPLE
for i from 1 to 10^5 do if ithprime(i+1)=ithprime(i)+6 and ithprime(i+2)=ithprime(i)+4 and ithprime(i+3)=ithprime(i)+2 then print(ithprime(i+3)); fi; od; # Corrected by Robert Israel, Jun 28 2018
# More efficient:
primes:= select(isprime, [seq(seq(30*i+j, j=[13, 19]), i=1..10^4)]):
select(t -> isprime(t-2) and isprime(t-6) and isprime(t-12) and not isprime(t-8), primes); # Robert Israel, Jun 28 2018
MATHEMATICA
With[{s = Differences@ Prime@ Range[10^4]}, Prime[1 + SequencePosition[s, {6, 4, 2}][[All, -1]] ] ] (* Michael De Vlieger, Aug 16 2017 *)
Select[Partition[Prime[Range[6000]], 4, 1], Differences[#]=={6, 4, 2}&][[All, 4]] (* Harvey P. Dale, Feb 13 2022 *)
PROG
(GAP)
K:=2*10^5+1;; # to get all terms <= K.
P:=Filtered([1, 3..K], IsPrime);; I:=Reversed([2, 4, 6]);;
P1:=List([1..Length(P)-1], i->P[i+1]-P[i]);;
P2:=List([1..Length(P)-Length(I)], i->[P1[i], P1[i+1], P1[i+2]]);;
P3:=List(Positions(P2, I), i->P[i+Length(I)]);
# More efficient
(GAP) Filtered(Set(Flat(List([13, 19], j->List([1..2000], i->30*i+j)))), j->IsPrime(j) and IsPrime(j-12) and not IsPrime(j-10) and not IsPrime(j-8) and IsPrime(j-6) and not IsPrime(j-4) and IsPrime(j-2)); # Muniru A Asiru, Jul 03 2018
(PARI) is(n) = if(!ispseudoprime(n), return(0), my(v=[n-2, n-6, n-12]); if(v[1]==precprime(n-1) && v[2]==precprime(v[1]-1) && v[3]==precprime(v[2]-1), return(1))); 0 \\ Felix Fröhlich, Aug 10 2017
CROSSREFS
Subsequence of A006512 and A098413.
Sequence in context: A054807 A285017 A139932 * A176925 A080177 A238248
KEYWORD
nonn
AUTHOR
Muniru A Asiru, Aug 08 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)