login
Primes p such that q = (p^2 + 1)/2 is also a prime.
48

%I #67 Feb 21 2022 01:20:38

%S 3,5,11,19,29,59,61,71,79,101,131,139,181,199,271,349,379,409,449,461,

%T 521,569,571,631,641,661,739,751,821,881,929,991,1031,1039,1051,1069,

%U 1091,1129,1151,1171,1181,1361,1439,1459,1489,1499,1531,1709,1741,1811,1831,1901

%N Primes p such that q = (p^2 + 1)/2 is also a prime.

%C Primes which are a leg of an integral right triangle whose hypotenuse is also prime.

%C It is conjectured that there are an infinite number of such triangles.

%C The Pythagorean triple {p, (p^2 - 1)/2, (p^2 + 1)/2} corresponds to {a(n), A067755(n), A067756(n)}. - _Lekraj Beedassy_, Oct 27 2003

%C There is no Pythagorean triangle all of whose sides are prime numbers. Still there are Pythagorean triangles of which the hypotenuse and one side are prime numbers, for example, the triangles (3,4,5), (11,60,61), (19,180,181), (61,1860,1861), (71,2520,2521), (79,3120,3121). [Sierpiński]

%C We can always write p=(Y+1)^2-Y^2, with Y=(p-1)/2, therefore q=(Y+1)^2+Y^2. - _Vincenzo Librandi_, Nov 19 2010

%C p^2 and p^2+1 are semiprimes; p^2 are squares in A070552 Numbers n such that n and n+1 are products of two primes. - _Zak Seidov_, Mar 21 2011

%D W. Sierpiński, Pythagorean triangles, Dover Publications, Inc., Mineola, NY, 2003, p. 6 MR2002669

%H T. D. Noe, <a href="/A048161/b048161.txt">Table of n, a(n) for n = 1..10000</a>

%H H. Dubner and T. Forbes, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL4/DUBNER/pyth.html">Prime Pythagorean triangles</a>, Journal of Integer Sequences, Vol. 4(2001), #01.2.3.

%F A000035(a(n))*A010051(a(n))*A010051((a(n)^2+1)/2) = 1. - _Reinhard Zumkeller_, Aug 26 2012

%e For p=11, (p^2+1)/2=61; p=61, (p^2+1)/2=1861.

%e For p(1)=3, the right triangle 3, 4, 5 is the smallest where 5=(3*3+1)/2. For p(10)=101, the right triangle is 101, 5100, 5101 where 5101=(101*101+1)/2.

%p a := proc (n) if isprime(n) = true and type((1/2)*n^2+1/2, integer) = true and isprime((1/2)*n^2+1/2) = true then n else end if end proc: seq(a(n), n = 1 .. 2000) # _Emeric Deutsch_, Jan 18 2009

%t Select[Prime[Range[200]], PrimeQ[(#^2 + 1)/2] &] (* _Stefan Steinerberger_, Apr 07 2006 *)

%t a[ n_] := Module[{p}, If[ n < 1, 0, p = a[n - 1]; While[ (p = NextPrime[p]) > 0, If[ PrimeQ[(p*p + 1)/2], Break[]]]; p]]; (* _Michael Somos_, Nov 24 2018 *)

%o (PARI) {a(n) = my(p); if( n<1, 0, p = a(n-1) + (n==1); while(p = nextprime(p+2), if( isprime((p*p+1)/2), break)); p)}; /* _Michael Somos_, Mar 03 2004 */

%o (Haskell)

%o a048161 n = a048161_list !! (n-1)

%o a048161_list = [p | p <- a065091_list, a010051 ((p^2 + 1) `div` 2) == 1]

%o -- _Reinhard Zumkeller_, Aug 26 2012

%o (Magma) [p: p in PrimesInInterval(3, 2000) | IsPrime((p^2+1) div 2)]; // _Vincenzo Librandi_, Dec 31 2013

%Y Cf. A067755, A067756. Complement in primes of A094516.

%Y Cf. A017281, A154428, A010051, A065091, A005383.

%Y Cf. A048270, A048295, A308635, A308636. Primes contained in A002731.

%K nonn,easy,nice

%O 1,1

%A Harvey Dubner (harvey(AT)dubner.com)

%E More terms from _David W. Wilson_