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.

A105411 Primes p = prime(k) such that both p+2 and prime(k+4)-2 are prime numbers.

This page as a plain text file.
%I A105411 #34 Oct 04 2024 06:56:19
%S A105411 3,17,29,59,227,269,617,1031,1277,1289,1301,1607,1667,1697,2087,2129,
%T A105411 2309,2711,2789,3257,3527,3539,3557,3917,4019,4241,4517,4637,4787,
%U A105411 5477,5501,5639,6551,7307,8819,8837,8999,9011,10037,10067,10271,10499,12041
%N A105411 Primes p = prime(k) such that both p+2 and prime(k+4)-2 are prime numbers.
%C A105411 Essentially the same as A089629. - _R. J. Mathar_, Aug 28 2008
%H A105411 Amiram Eldar, <a href="/A105411/b105411.txt">Table of n, a(n) for n = 1..10000</a>
%F A105411 a(n) = prime(A105410(n)-1). - _Amiram Eldar_, Oct 04 2024
%e A105411 prime(7) = 17, and both prime(7)+2 = 19 and prime(7+4)-2 = 29 are primes, so 17 is in the sequence.
%t A105411 For[n = 1, n < 500, n++, If[PrimeQ[Prime[n] + 2],If[PrimeQ[Prime[n + 4] - 2], Print[Prime[n]]]]] (* _Stefan Steinerberger_, Feb 07 2006 *)
%t A105411 Select[Partition[Prime[Range[1500]],5,1],AllTrue[{#[[1]]+2,#[[5]]-2},PrimeQ]&][[All,1]] (* _Harvey P. Dale_, Oct 28 2022 *)
%o A105411 (PARI) pnpk(n, m=4, k=2) = { local(x, v1, v2); for(x=1, n, v1 = prime(x)+ k; v2 = prime(x+m)-k; if(isprime(v1)&isprime(v2), print1(prime(x), ", ") ) ) ;} \\ corrected by _Michel Marcus_, Sep 14 2015
%o A105411 (PARI) lista(pmax) = {my(k = 1, p = primes(5)); forprime(p1 = p[#p], pmax, k++; p[#p] = p1; if(p[2]- p[1] == 2 && p[5] - p[4] == 2, print1(p[1], ", ")); for(i = 1, #p-1, p[i] = p[i+1]));} \\ _Amiram Eldar_, Oct 04 2024
%o A105411 (Magma) [NthPrime(n): n in [1..1500] | IsPrime(NthPrime(n)+2) and IsPrime(NthPrime(n+4)-2)]; // _Vincenzo Librandi_, Sep 14 2015
%Y A105411 Cf. A089629, A105409, A105410, A105412, A105413, A105414.
%K A105411 nonn
%O A105411 1,1
%A A105411 _Cino Hilliard_, May 02 2005