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-7 of 7 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

A067756 Prime hypotenuses of Pythagorean triangles with a prime leg.

Original entry on oeis.org

5, 13, 61, 181, 421, 1741, 1861, 2521, 3121, 5101, 8581, 9661, 16381, 19801, 36721, 60901, 71821, 83641, 100801, 106261, 135721, 161881, 163021, 199081, 205441, 218461, 273061, 282001, 337021, 388081, 431521, 491041, 531481, 539761, 552301
Offset: 1

Views

Author

Henry Bottomley, Jan 31 2002

Keywords

Comments

Apart from the first two terms, every term is congruent to 1 modulo 60 and is of the form 450k^2 +- 30k + 1 or 450k^2 +- 330k + 61 for some k.
Every term of the sequence after the second is a prime p congruent to 1 (mod 60), i.e., for n > 2, a(n) is a subsequence of A088955. The Pythagorean triple is {sqrt(2p-1), p-1, p}. - Lekraj Beedassy, Mar 12 2002
Primes p such that 2*p-1 is the square of a prime. - Robert Israel, Sep 16 2014
Primes p of the form ((q+1)/2)^2 + ((q-1)/2)^2, where q is a prime; then q belongs to A048161. - Thomas Ordowski, May 22 2015
The other (i.e., long) leg of the Pythagorean triangle is p-1. - Zak Seidov, Oct 30 2015

Examples

			For a(1)=5, the right triangle is 3, 4, 5 with 3 and 5 prime.
For a(10)=5101, the right triangle is 101, 5100, 5101 with 101 and 5101 prime.
		

Crossrefs

Contains every value of A051859.

Programs

  • Maple
    N:= 10^8: # to get all terms <= N
    Primes:= select(isprime,[$3..floor(sqrt(2*N-1))]):
    f:= proc(p) local q; q:= (p^2+1)/2; if isprime(q) then q else NULL fi end proc:
    map(f, Primes); # Robert Israel, Sep 16 2014
  • Mathematica
    f[n_]:=((p-1)/2)^2+((p+1)/2)^2; lst={};Do[p=Prime[n];If[PrimeQ[f[p]],AppendTo[lst,f[p]]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 27 2009 *)
  • PARI
    forprime(p=3,10^3,if(isprime(q=(p^2+1)/2),print1(q,", "))) \\ Derek Orr, Apr 30 2015

Formula

a(n) = (A048161(n)^2 + 1)/2 = A067755(n) + 1.

A068501 Values m such that the consecutive pair parameters(m,m+1) generate Pythagorean triples whose odd terms are both prime.

Original entry on oeis.org

1, 2, 5, 9, 14, 29, 30, 35, 39, 50, 65, 69, 90, 99, 135, 174, 189, 204, 224, 230, 260, 284, 285, 315, 320, 330, 369, 375, 410, 440, 464, 495, 515, 519, 525, 534, 545, 564, 575, 585, 590, 680, 719, 729, 744, 749, 765, 854, 870, 905, 915, 950, 974, 1080, 1119
Offset: 1

Views

Author

Lekraj Beedassy, Mar 25 2002

Keywords

Comments

Setting u=m; v=m+1, triples (a,b,c) with a=u+v, b=2*u*v, c = u^2+v^2 = (a^2+1)/2 correspond to (A048161, A067755, A067756), a and c being both prime.

Crossrefs

Cf. A051892.

Programs

  • Mathematica
    lst={};Do[If[PrimeQ[(n+1)^2-n^2]&&PrimeQ[(n+1)^2+n^2],AppendTo[lst,n]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jun 01 2010 *)
    Reap[Do[a=Prime[k];If[PrimeQ[(a^2+1)/2],Sow[(a-1)/2]],{k,2,10^5}]][[2,1]](* Zak Seidov, Apr 16 2011 *)

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 19 2002

A263951 Square numbers in A070552.

Original entry on oeis.org

9, 25, 121, 361, 841, 3481, 3721, 5041, 6241, 10201, 17161, 19321, 32761, 39601, 73441, 121801, 143641, 167281, 201601, 212521, 271441, 323761, 326041, 398161, 410881, 436921, 546121, 564001, 674041, 776161, 863041, 982081, 1062961, 1079521, 1104601, 1142761, 1190281, 1274641, 1324801
Offset: 1

Views

Author

Zak Seidov, Oct 30 2015

Keywords

Comments

All terms are == 1 (mod 8). For n > 2, a(n) == 1 (mod 120).
This sequence is a subsequence of A247687 and it contains the squares of all those primes p for which the areas of the 3 regions in the symmetric representation of p^2 (p once and (p^2 + 1)/2 twice), are primes; i.e., p^2 and p^2 + 1 are semiprimes (see A070552). The sequence of those primes p is A048161. Cf. A237593. - Hartmut F. W. Hoft, Aug 06 2020

Crossrefs

Programs

  • Mathematica
    a263951[n_] := Select[Map[Prime[#]^2&, Range[n]], PrimeQ[(#+1)/2]&]
    a263951[190] (* Hartmut F. W. Hoft, Aug 06 2020 *)
  • PARI
    forprime(p=3, 2000, if(isprime((p^2+1)/2), print1(p^2, ", "))) \\ Altug Alkan, Oct 30 2015

Formula

a(n) = A048161(n)^2.
From Hartmut F. W. Hoft, Aug 06 2020: (Start)
a(n) = 2 * A067755(n) + 1, n >= 1.
a(n+2) = 120 * A068485(n) + 1, n >= 1. (End)

A068485 One-sixtieth of the even leg of Pythagorean triangles whose other sides are both primes (other than 3, 5 or 13).

Original entry on oeis.org

1, 3, 7, 29, 31, 42, 52, 85, 143, 161, 273, 330, 612, 1015, 1197, 1394, 1680, 1771, 2262, 2698, 2717, 3318, 3424, 3641, 4551, 4700, 5617, 6468, 7192, 8184, 8858, 8996, 9205, 9523, 9919, 10622, 11040, 11427, 11623, 15436, 17256, 17739, 18476, 18725, 19533
Offset: 1

Views

Author

Lekraj Beedassy, Mar 11 2002

Keywords

Comments

The (primitive) Pythagorean triple is {A048161(n), A067755(n), A067756(n)}.

Crossrefs

Programs

  • Mathematica
    a068485[n_] := (Select[Map[Prime[#]^2&, Range[4, n]], PrimeQ[(#+1)/2]&]-1)/120
    a068485[250] (* data - Hartmut F. W. Hoft, Aug 06 2020 *)

Formula

From Hartmut F. W. Hoft, Aug 06 2020: (Start)
a(n) = A067755(n+2)/60, n>=1.
a(n) = (A263951(n+2) - 1)/120, n>=1. (End)

Extensions

More terms from Sascha Kurz, Mar 26 2002
a(34)-a(45) from Ray Chandler, Apr 12 2010

A140391 Pythagorean triangle side lengths triples with two lengths prime.

Original entry on oeis.org

4, 3, 5, 12, 5, 13, 60, 11, 61, 180, 19, 181, 420, 29, 421, 1740, 59, 1741, 1860, 61, 1861, 2520, 71, 2521, 3120, 79, 3121, 5100, 101, 5101, 8580, 131, 8581, 9660, 139, 9661, 16380, 181, 16381, 19800, 199, 19801, 36720, 271, 36721, 60900, 349, 60901, 71820
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 13 2008

Keywords

Comments

Or: consecutive triples of x=A067755(j), y=A048161(j), z=A067756(j), j>=1.

Examples

			Contains (x,y,z) = (4,3,5) with 4^2+3^2=5^2 and 3 and 5 prime, then (12,5,13) with 12^5+5^2=13^2 and 5 and 13 prime, then (60,11,61) with 60^2+11^2=61^2 etc. x^2+y^2=z^2
		

Extensions

Edited and extended by R. J. Mathar, Jun 17 2008

A342583 Numbers k such that prime(k) is the hypotenuse of a Pythagorean triple where one leg is also prime.

Original entry on oeis.org

3, 6, 18, 42, 82, 271, 284, 369, 445, 682, 1069, 1193, 1900, 2241, 3894, 6137, 7108, 8164, 9658, 10126, 12645, 14842, 14936, 17913, 18420, 19480, 23893, 24605, 28959, 32913, 36279, 40847, 43936, 44559, 45500
Offset: 1

Views

Author

Ivan N. Ianakiev, Mar 16 2021

Keywords

Comments

In such a triangle, the leg that is not prime is always the largest one and is equal to prime(k)-1; these even legs are in A067755. E.g. for a(2) = 6, prime(6) = 13 and the corresponding Pythagorean triple is (5, 12, 13). - Bernard Schott, Apr 03 2021

Examples

			a(1) = 3, since prime(3) = 5 is the hypotenuse of the triple (3,4,5).
		

Crossrefs

Cf. A067756 (the hypotenuses).

Programs

  • Maple
    R:= NULL: count:= 0:
    p:= 2:
    while count < 100 do
      p:= nextprime(p); n:= (p-1)/2; q:= 2*n^2+2*n+1;
      if isprime(q) then
        count:= count+1; r:= numtheory:-pi(q); R:= R, r;
      fi
    od:
    R; # Robert Israel, Mar 22 2021
  • Mathematica
    PrimePi[Take[Cases[Import["https://oeis.org/A067756/b067756.txt","Table"],{,}][[All,2]],100]]
Showing 1-7 of 7 results.