A094481 Duplicate of A045637.
13, 29, 53, 173, 293, 1373, 2213, 4493, 5333, 9413, 10613, 18773, 26573, 27893
Offset: 1
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.
a(1) = 3 because 3^2 + 4 = 13 is prime, a(4) = 13 because 13^2 + 4 = 173 is prime. - _Zak Seidov_, Nov 04 2013
Select[Prime/@Range[300], PrimeQ[ #^2+4]&]
{ n=0; forprime (p=2, 5*10^5, if (isprime(p^2 + 4), write("b062324.txt", n++, " ", p); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 04 2009
17 is prime, 17^2 + 4 = 293 is prime and 293^2 + 4 = 85853 is prime.
Select[Prime[Range[2*7! ]],PrimeQ[ #^2+4]&&PrimeQ[(#^2+4)^2+4]&] (* Vladimir Joseph Stephan Orlovsky, Feb 26 2010 *) fQ[n_]:=AllTrue[Rest[NestList[#^2+4&,n,2]],PrimeQ]; Select[Prime[ Range[ 3000]],fQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 21 2014 *)
is(n)=my(q);isprime(p) && isprime(q=p^2+4) && isprime(q^2+4) \\ Charles R Greathouse IV, Nov 06 2013
Select[Table[p^2 + 10, {p, Prime[Range[200]]}], PrimeQ] (* T. D. Noe, May 01 2012 *)
9^2 + 2^2 = 85 = 5*17, 11^2 + 2^2 = 125 = 5^3, and 23^2 + 2^2 = 533 = 13*41 are composite, so 9, 11, and 23 are members. 1^2 + 2^2 = 5 and 2^2 + 3^3 = 13 are prime, so 1, 2, and 3 are not members.
Prime q=13=p^2+4 (p=3) and r=q^2+4=13^2+4=173 (prime). Prime q=293=p^2+4 (p=17) and r=q^2+4=293^2+4=85853 (prime).
Reap[For[p = 2, p < 10^4, p = NextPrime[p], If[PrimeQ[q = p^2+4] && PrimeQ[q^2+4], Print[q]; Sow[q]]]][[2, 1]] (* Jean-François Alcover, Nov 07 2013 *) Select[Prime[Range[2000]]^2+4,AllTrue[{#,#^2+4},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 13 2018 *)
A185086(2) = 13 = 2^2 + 3^2 and A185086(6) = 61 = 5^2 + 6^2, so a(2) = 3 and a(6) = 5.
p = 2; lst = {}; While[p < 100, k = 1; While[k < 101, If[PrimeQ[k^2 + p^2], AppendTo[lst, {k^2 + p^2, If[PrimeQ@ k, Max[k, p], p]}]]; k++]; p = NextPrime@ p]; Transpose[Union@ lst][[2]]
do(lim)=my(v=List(),p2,t); forprime(p=2, sqrtint(lim\=1), p2=p^2; for(k=1, sqrtint(lim-p2), if(isprime(t=p2+k^2), listput(v, [t, if(isprime(k),max(k,p),p)])))); v=vecsort(Set(v),1); apply(u->u[2], v) \\ Charles R Greathouse IV, Aug 21 2017
With[{upto=700},Select[Times@@#+4&/@Tuples[Prime[Range[PrimePi[upto/2]]], 2], PrimeQ[#]&<+upto&]]//Union (* Harvey P. Dale, Jul 23 2016 *)
list(lim)=my(v=List(),t); forprime(p=3,(lim-4)\3, forprime(q=3,min((lim-4)\p, p), t=p*q+4; if(isprime(t), listput(v,t)))); Set(v) \\ Charles R Greathouse IV, Aug 05 2016
j=0: p=1+1=2; j=1: p=2+59=61; j=2: p=4+18769=18773; j=8: p=256+37^8=124097929967680577; the j exponents are powers of 2.
13 is in the sequence since it is prime and 13 = 2^2 + 3^2 (2 and 3 are distinct primes).
nn=10;s={0};Do[p=Prime[n];s=Union[s,s+p^2],{n,nn}];Select[s,(0<#<=Prime[nn]^2)&&PrimeQ[#]&] (* Michel Lagneau, Jul 03 2014 *)
Comments