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.

Showing 1-5 of 5 results.

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

Original entry on oeis.org

3, 5, 11, 19, 29, 59, 61, 71, 79, 101, 131, 139, 181, 199, 271, 349, 379, 409, 449, 461, 521, 569, 571, 631, 641, 661, 739, 751, 821, 881, 929, 991, 1031, 1039, 1051, 1069, 1091, 1129, 1151, 1171, 1181, 1361, 1439, 1459, 1489, 1499, 1531, 1709, 1741, 1811, 1831, 1901
Offset: 1

Views

Author

Harvey Dubner (harvey(AT)dubner.com)

Keywords

Comments

Primes which are a leg of an integral right triangle whose hypotenuse is also prime.
It is conjectured that there are an infinite number of such triangles.
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
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]
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
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

Examples

			For p=11, (p^2+1)/2=61; p=61, (p^2+1)/2=1861.
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.
		

References

  • Wacław Sierpiński, Pythagorean triangles, Dover Publications, Inc., Mineola, NY, 2003, p. 6. MR2002669

Crossrefs

Cf. A067755, A067756. Complement in primes of A094516.
Cf. A048270, A048295, A308635, A308636. Primes contained in A002731.

Programs

  • Haskell
    a048161 n = a048161_list !! (n-1)
    a048161_list = [p | p <- a065091_list, a010051 ((p^2 + 1) `div` 2) == 1]
    -- Reinhard Zumkeller, Aug 26 2012
    
  • Magma
    [p: p in PrimesInInterval(3, 2000) | IsPrime((p^2+1) div 2)]; // Vincenzo Librandi, Dec 31 2013
    
  • Maple
    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
  • Mathematica
    Select[Prime[Range[200]], PrimeQ[(#^2 + 1)/2] &] (* Stefan Steinerberger, Apr 07 2006 *)
    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 *)
  • 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 */
    
  • Python
    from sympy import isprime, nextprime; p = 2
    while p < 1901: p = nextprime(p); print(p, end = ', ') if isprime((p*p+1)//2) else None # Ya-Ping Lu, Apr 24 2025

Formula

A000035(a(n))*A010051(a(n))*A010051((a(n)^2+1)/2) = 1. - Reinhard Zumkeller, Aug 26 2012

Extensions

More terms from David W. Wilson

A048270 Sequence of 2 Pythagorean triangles, each with a leg and hypotenuse prime. The leg of the second triangle is the hypotenuse of the first.

Original entry on oeis.org

3, 11, 19, 59, 271, 349, 521, 929, 1031, 1051, 1171, 2381, 2671, 2711, 2719, 3001, 3499, 3691, 4349, 4691, 4801, 4999, 5591, 5669, 6101, 6359, 6361, 7159, 7211, 7489, 8231, 8431, 8761, 9241, 10099, 10139, 11719, 11821, 12239, 12281, 12781
Offset: 1

Views

Author

Harvey Dubner (harvey(AT)dubner.com)

Keywords

Comments

It is conjectured that there are infinitely many such pairs of triangles.
Subsequence of A048161. - Lekraj Beedassy, Sep 16 2005

Examples

			p(1)=3 because 3 is prime, 5 = (3*3 + 1)/2 and 13 = (5*5 + 1)/2, 5, 13 both prime.
		

Crossrefs

Formula

For each p(n), there is a q=(p*p+1)/2 and r=(q*q+1)/2 such that p, q, r are all prime.

Extensions

More terms from Ray Chandler, Jun 12 2019

A048295 Sequence of 3 Pythagorean triangles, each with a leg and hypotenuse prime. The hypotenuse of each triangle is the leg of the next triangle.

Original entry on oeis.org

271, 349, 3001, 10099, 11719, 12281, 25889, 39901, 46399, 63659, 169219, 250361, 264169, 287629, 289049, 312581, 353081, 440681, 473009, 502501, 502961, 541951, 594751, 620491, 627911, 632699, 704581, 757111, 762899, 922261, 959269
Offset: 1

Views

Author

Harvey Dubner (harvey(AT)dubner.com)

Keywords

Examples

			p(5)=271, q=36721, r=674215921, s=227283554064939121.
		

Crossrefs

Formula

For each p(n), q=(p*p+1)/2, r=(q*q+1)/2, s=(r*r+1)/2 and p, q, r, s are all prime.

Extensions

More terms from Ray Chandler, Jun 12 2019

A308636 Sequence of 5 Pythagorean triangles, each with a leg and hypotenuse prime. The hypotenuse of each triangle is the leg of the next triangle.

Original entry on oeis.org

356498179, 432448789, 5380300469, 10667785241, 11238777509, 12129977791, 23439934621, 28055887949, 33990398249, 34250028521, 34418992099, 34773959159, 34821663421, 36624331189, 40410959231, 43538725229, 47426774869
Offset: 1

Views

Author

Ray Chandler, Jun 12 2019

Keywords

Examples

			p(1)=356498179, q=63545475815158021, r=63545475815158021, s=2038208257886801569993754841378314277932542447949256249537232302421, ...
		

Crossrefs

Formula

For each p(n), q=(p*p+1)/2, r=(q*q+1)/2, s=(r*r+1)/2, t=(s*s+1)/2, u=(t*t+1)/2 and p, q, r, s, t, u are all prime.

A105318 Starting prime for the smallest prime Pythagorean sequence for n triangles.

Original entry on oeis.org

5, 3, 271, 169219, 356498179, 2500282512131, 20594058719087111, 2185103796349763249
Offset: 1

Views

Author

Lekraj Beedassy, Apr 26 2005

Keywords

Comments

Smallest prime p(0) such that the n-chain governed by recurrence p(i+1)=(p(i)^2 + 1)/2 are all primes. Equivalently, least prime p(0) that generates a sequence of n 2-prime triangles, where p(k) is the hypotenuse of the k-th triangle and the leg of the (k+1)-th triangle.
For n>2, the last digit of a(n) is 1 or 9. - Ya-Ping Lu, May 17 2025

Examples

			5 is a(1) because (5^2+1)/2 = 13 is prime, but (13^2+1)/2 = 85 is not.
		

References

  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 258.

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime; m = lambda x: (x*x+1)//2; p = 2; D = {}
    while p < 2185103796349763249:
        p = nextprime(p); q = m(p); n = 1
        while isprime(q) and isprime(m(q)): n += 1; q = m(q)
        if n not in D: D.update({n: p})
    [print(k, end =', ') for key, k in sorted(D.items())] # Ya-Ping Lu, May 17 2025

Extensions

a(1) added by T. D. Noe, Jan 29 2011
Showing 1-5 of 5 results.