cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A097490 Primes which are two greater than A097489 terms.

This page as a plain text file.
%I A097490 #20 Jul 05 2024 08:13:49
%S A097490 5,17,167,302946354048717875530381041444257,
%T A097490 17164738545781348456175905084853738838912866540727619406614703260339837793050935010265073947
%N A097490 Primes which are two greater than A097489 terms.
%H A097490 Amiram Eldar, <a href="/A097490/b097490.txt">Table of n, a(n) for n = 1..6</a>
%e A097490 a(3) = 167 = (Product_{k=1..3} A001359(k)) + 2 = 3 * 5 * 11 + 2 = A097489(3) + 2. - _Hartmut F. W. Hoft_, Apr 27 2021
%t A097490 step[{list_, q_}] := Module[{p=NextPrime[q]}, {Join[list, If[PrimeQ[p+2], {{p,p+2}}, {}]], p}]
%t A097490 smallerTwin[n_] := First[Transpose[First[NestWhile[step, {{{3, 5}}, 3}, Length[First[step[#]]]<=n&]]]]
%t A097490 a097489[n_] := Rest[FoldList[Times, 1, smallerTwin[n]]]
%t A097490 a097490[n_] := Select[Map[#+2&, a097489[n]], PrimeQ]
%t A097490 a097490[39] (* _Hartmut F. W. Hoft_, Apr 27 2021 *)
%o A097490 (PARI) fp(n) = p=1;for(x=1,n,p*=twinl(x);if(isprime(p+2),print1(p+2", ")))
%o A097490 twinl(n) = { local(c,x); c=0; x=1; while(c<n, if(isprime(prime(x)+2),c++); x++; ); return(prime(x-1)) }
%Y A097490 Cf. A097489, A097491.
%Y A097490 Cf. A001359, A077800.
%K A097490 nonn
%O A097490 1,1
%A A097490 _Cino Hilliard_, Aug 24 2004
%E A097490 Edited by _Don Reble_, Apr 16 2007