login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A097490
Primes which are two greater than A097489 terms.
5
5, 17, 167, 302946354048717875530381041444257, 17164738545781348456175905084853738838912866540727619406614703260339837793050935010265073947
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 167 = (Product_{k=1..3} A001359(k)) + 2 = 3 * 5 * 11 + 2 = A097489(3) + 2. - Hartmut F. W. Hoft, Apr 27 2021
MATHEMATICA
step[{list_, q_}] := Module[{p=NextPrime[q]}, {Join[list, If[PrimeQ[p+2], {{p, p+2}}, {}]], p}]
smallerTwin[n_] := First[Transpose[First[NestWhile[step, {{{3, 5}}, 3}, Length[First[step[#]]]<=n&]]]]
a097489[n_] := Rest[FoldList[Times, 1, smallerTwin[n]]]
a097490[n_] := Select[Map[#+2&, a097489[n]], PrimeQ]
a097490[39] (* Hartmut F. W. Hoft, Apr 27 2021 *)
PROG
(PARI) fp(n) = p=1; for(x=1, n, p*=twinl(x); if(isprime(p+2), print1(p+2", ")))
twinl(n) = { local(c, x); c=0; x=1; while(c<n, if(isprime(prime(x)+2), c++); x++; ); return(prime(x-1)) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Cino Hilliard, Aug 24 2004
EXTENSIONS
Edited by Don Reble, Apr 16 2007
STATUS
approved