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-10 of 18 results. Next

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

A067755 Even legs of Pythagorean triangles whose other leg and hypotenuse are both prime.

Original entry on oeis.org

4, 12, 60, 180, 420, 1740, 1860, 2520, 3120, 5100, 8580, 9660, 16380, 19800, 36720, 60900, 71820, 83640, 100800, 106260, 135720, 161880, 163020, 199080, 205440, 218460, 273060, 282000, 337020, 388080, 431520, 491040, 531480, 539760, 552300
Offset: 1

Views

Author

Henry Bottomley, Jan 31 2002

Keywords

Comments

Apart from the first two terms, every term is divisible by 60 and is of the form 450*k^2 +/- 30*k or 450*k^2 +/- 330*k + 60 for some k.
In such a triangle, this even leg is always the longer leg, and the hypotenuse = a(n) + 1. The Pythagorean triples are (A048161(n), a(n), A067756(n)), so, for a(2) = 12, the corresponding Pythagorean triple is (5, 12, 13). - Bernard Schott, Apr 12 2023

Examples

			4 is a term: in the right triangle (3, 4, 5), 3 and 5 are prime.
5100 is a term: in the right triangle (101, 5100, 5101), 101 and 5101 are prime.
		

Crossrefs

Cf. A048161, A067756. Contains every value of A051858.

Programs

  • Mathematica
    lst={}; Do[q=(Prime[n]^2+1)/2; If[PrimeQ[q], AppendTo[lst, (Prime[n]^2-1)/2]], {n, 200}]; lst (* Frank M Jackson, Nov 02 2013 *)

Formula

a(n) = (A048161(n)^2 - 1)/2 = A067756(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

A051859 Values of C (the hypotenuse) of a Pythagorean triangle with A (the short leg) and C both prime and part of a twin prime.

Original entry on oeis.org

5, 13, 61, 181, 421, 5101, 60901, 135721, 161881, 163021, 218461, 595141, 1108561, 2574181, 2740141, 3248701, 3535141, 3723721, 3729181, 8197201, 13933921, 20218441, 23605321, 28569241, 33874681, 47248921, 68667481, 69372421
Offset: 1

Views

Author

Stuart M. Ellerstein (ellerstein(AT)aol.com), Dec 14 1999

Keywords

Comments

All terms of the sequence must be part of a Pythagorean triple of the form (2u-1), 2u*(u-1), (2u^2 - 2u + 1). - Joshua Zucker, May 12 2006

Crossrefs

See A051642 for the A's and A051858 for the B's.
Subset of A067756.

Programs

  • Mathematica
    tppQ[{a_,b_,c_}]:=AllTrue[{a,c},PrimeQ]&&AnyTrue[a+{2,-2},PrimeQ] && AnyTrue[ c+{2,-2},PrimeQ]; Select[Table[{2n-1,2n(n-1),2n^2-2n+1},{n,2,10000}],tppQ][[All,3]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 27 2021 *)

Formula

A051858 + 1, or 2*A051891^2 - 2*A051891 + 1, or 2*A051892^2 + 2*A051892 + 1. - Joshua Zucker, May 12 2006

Extensions

More terms from Joshua Zucker, May 12 2006

A292989 Triangular numbers having exactly 6 divisors.

Original entry on oeis.org

28, 45, 153, 171, 325, 4753, 7381, 29161, 56953, 65341, 166753, 354061, 5649841, 6060421, 6835753, 6924781, 12708361, 19478161, 24231241, 52035301, 56791153, 147258541, 186660181, 282304441, 326081953, 520273153, 536657941, 704531953, 784139401, 1215121753
Offset: 1

Views

Author

Jon E. Schoenfield, Dec 08 2017

Keywords

Comments

Intersection of A000217 (triangular numbers) and A030515 (numbers with exactly 6 divisors).
This sequence is also the union of
(1) numbers of the form p*(2p-1) where p is prime and 2p-1 is the square of a prime (this sequence begins 45, 325, 7381, 65341, 354061, ...),
(2) numbers of the form p^2*(2p^2 - 1) where both p and 2p^2 - 1 are prime (this sequence begins 28, 153, 4753, 29161, ...), and
(3) numbers of the form p^2*(2p^2 + 1) where both p and 2p^2 + 1 are prime (the only such number is 171).

Examples

			28 = 2^2 * 7, so it has 6 divisors: {1, 2, 4, 7, 14, 28};
45 = 3^2 * 5, so it has 6 divisors: {1, 3, 5, 9, 15, 45};
171 = 3^2 * 19, so it has 6 divisors: {1, 3, 9, 19, 57, 171}.
		

Crossrefs

Cf. A000217 (triangular numbers), A030515 (numbers with exactly 6 divisors).
Cf. A067756 (primes p such that 2p-1 is the square of a prime), A106483 (primes p such that 2p^2 - 1 is prime).
Cf. A263951.

Programs

  • Mathematica
    Select[Array[PolygonalNumber, 10^5], DivisorSigma[0, #] == 6 &] (* Michael De Vlieger, Dec 09 2017 *)

A286257 Compound filter: a(n) = P(A046523(n), A046523(2n-1)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 5, 5, 14, 12, 27, 5, 86, 14, 27, 23, 90, 12, 84, 27, 152, 23, 148, 5, 148, 27, 27, 80, 324, 25, 61, 44, 148, 23, 495, 5, 935, 61, 27, 61, 702, 5, 142, 61, 324, 138, 495, 23, 148, 90, 61, 23, 1426, 14, 265, 27, 90, 467, 324, 27, 430, 27, 61, 80, 2140, 12, 61, 183, 2144, 61, 495, 23, 607, 27, 495, 23, 2998, 23, 142, 90, 90, 142, 625, 5, 1426, 226, 27, 467
Offset: 1

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Cf. A005382 (gives the positions of 5's), A067756 (of 12's), A234098 (of 23's).

Programs

  • PARI
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A286257(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1));
    for(n=1, 10000, write("b286257.txt", n, " ", A286257(n)));
    
  • Python
    from sympy import factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a(n): return T(a046523(n), a046523(2*n - 1)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286257 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ -1 n n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ -1 n n)))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1)).
a(n) = (1/2)*(2 + ((A046523(n)+A278223(n))^2) - A046523(n) - 3*A278223(n)).

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

A382872 For n >= 1, a(n) is the number of divisors of the Pillai's arithmetical function: Sum_{k=1..n} gcd(k, n) (A018804).

Original entry on oeis.org

1, 2, 2, 4, 3, 4, 2, 6, 4, 4, 4, 8, 3, 4, 6, 10, 4, 6, 2, 12, 4, 6, 6, 9, 4, 6, 5, 8, 4, 8, 2, 10, 8, 6, 6, 16, 2, 4, 4, 18, 5, 8, 4, 16, 8, 8, 4, 20, 4, 8, 8, 12, 8, 6, 8, 12, 4, 6, 6, 24, 3, 4, 8, 9, 9, 12, 4, 16, 9, 8, 4, 24, 4, 4, 6, 8, 8, 8, 2, 20
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 07 2025

Keywords

Comments

a(n) is from A005408 for n from {1, 5, 13, 24, 27, 41, 61, 64, 65, 69, 99, 113, ...}.
a(n) is from A065091 for n from {5, 13, 27, 41, 61, 135, 181, 205, 313, 421, ...}.

Examples

			For n = 5, a(5) = A000005(A018804(5)) = A000005(9) = 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local i; numtheory:-tau(add(igcd(i,n),i=1..n)) end proc:
    map(f, [$1..100]); # Robert Israel, May 07 2025
  • Mathematica
    f[p_, e_] := (e*(p - 1)/p + 1)*p^e; a[n_] := DivisorSigma[0, Times @@ f @@@ FactorInteger[n]]; Array[a, 100] (* Amiram Eldar, Apr 07 2025 *)
  • PARI
    a(n) = numdiv(sumdiv(n, d, n*eulerphi(d)/d)); \\ Michel Marcus, Apr 07 2025

Formula

a(n) = A000005(A018804(n)).
a(A005382(n)) = 2.
a(A067756(n)) = 3.
a(A277201(n)) = 5.

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

A230444 Primes of the form (p^k + k - 1)/k for prime p and some k > 1.

Original entry on oeis.org

5, 13, 61, 157, 181, 421, 601, 733, 821, 1741, 1861, 2287, 2521, 3121, 5101, 8581, 9661, 9931, 16381, 19609, 19801, 36721, 60901, 71821, 83641, 100801, 106261, 135721, 161881, 163021, 199081, 205441, 218461, 273061, 282001, 337021, 388081, 431521, 491041
Offset: 1

Views

Author

Irina Gerasimova, Oct 18 2013

Keywords

Examples

			601 is a term because (7^4 + 4 - 1)/4 = 601 where 7, 601 are both prime,
733 is a term because (13^3 + 3 -1)/3 = 733 where 13, 733 are both prime,
821 is a term because (3^8 + 8 - 1)/8 = 821 where 3, 821 are both prime.
		

Crossrefs

Programs

  • Maple
    N:= 10^6: # for terms <= N
    S:= {}: p:= 1:
    do
      p:= nextprime(p);
      if p^2/2 > N then break fi;
      for k from 2 do
        v:= (p^k + k - 1)/k;
        if v > N then break fi;
        if v::integer and isprime(v) then  S:= S union {v} fi;
    od od:
    sort(convert(S,list)); # Robert Israel, Jun 22 2023
  • PARI
    isA230444(n) = {isprime(n) || return(0); my(k = 2, v, p); while (1, v = k*n+1-k; if (ispower(v, k, &p) && isprime(p), return(1)); if (v < 2^k, return(0)); k++;);} \\ Michel Marcus, Oct 19 2013

Extensions

More terms from Michel Marcus, Oct 19 2013
Showing 1-10 of 18 results. Next