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 20 results. Next

A116945 Numbers in both A002731(n) and A002731(A002731(n)).

Original entry on oeis.org

3, 11, 19, 59, 69, 221, 271, 349, 371, 391, 441, 451, 521, 529, 649, 779, 869, 921, 929, 951, 1001, 1031, 1051, 1171, 1359, 1391, 1421, 1689, 1701, 2199, 2321, 2349, 2381, 2671, 2711, 2719, 2821, 2901, 3001, 3241, 3341, 3399, 3441, 3499, 3691, 4299
Offset: 1

Views

Author

Jonathan Vos Post, Mar 25 2006

Keywords

Comments

Subset of A002731. A002731(n) = 2*A027861(n-1)+1. A027862 gives primes, A091277 gives prime index.

Examples

			a(1) = 3 because (3^2 + 1)/2 = 5 is prime and (5^2 + 1)/2 = 13 is prime.
a(2) = 11 because (11^2 + 1)/2 = 61 is prime and (61^2 + 1)/2 = 1861 is prime.
a(3) = 19 because (19^2 + 1)/2 = 181 is prime and (181^2 + 1)/2 = 16381 is prime.
a(4) = 59 because (59^2 + 1)/2 = 1741 is prime and (1741^2 + 1)/2 = 1515541 is prime.
a(5) = 69 because (69^2 + 1)/2 = 2381 is prime and (2381^2 + 1)/2 = 2834581 is prime. Further, (2834581^2+1)/2 = 4017424722781 is prime, which suggests another sequences one level of recursion deeper.
a(6) = 221 because (221^2 + 1)/2 = 24421 is prime and (24421^2 + 1)/2 = 298192621 is prime.
		

References

  • L. Euler, De numeris primis valde magnis (E283), reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 3, p. 24.

Crossrefs

Formula

n such that (n^2 + 1)/2 is prime and (((n^2 + 1)/2)^2 + 1)/2 is prime.

Extensions

More terms from Zak Seidov, Apr 03 2011

A187431 Numbers n that generate 5 primes under the first 5 iterations of the map n->A002731(n).

Original entry on oeis.org

30131199, 50817201, 56496039, 74316929, 171407609, 276672151, 293315671, 337876949, 356498179, 359830101, 372590921, 432448789, 501182201, 541961069, 577016839, 616411051, 749536461, 776113741, 903321909, 919203811, 1005047121, 1285328811, 1323139751, 1340738371
Offset: 1

Views

Author

Zak Seidov, Apr 05 2011

Keywords

Comments

Numbers n such that m=(n^2+1)/2, p=(m^2+1)/2, q=(p^2+1)/2, r=(q^2+1)/2 and s=(r^2+1)/2 are all prime.
Subsequence of A188547 which itself is subsequence of A188546 which is subsequence of A116945.
a(1)=30131199=A188547(70).
Two numbers n that generate 6 primes... are a(23)=1323139751 and a(78)=10185588801.

Crossrefs

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

A027862 Primes of the form j^2 + (j+1)^2.

Original entry on oeis.org

5, 13, 41, 61, 113, 181, 313, 421, 613, 761, 1013, 1201, 1301, 1741, 1861, 2113, 2381, 2521, 3121, 3613, 4513, 5101, 7321, 8581, 9661, 9941, 10513, 12641, 13613, 14281, 14621, 15313, 16381, 19013, 19801, 20201, 21013, 21841, 23981, 24421, 26681
Offset: 1

Views

Author

Keywords

Comments

Also, primes of the form 4*k+1 which are the hypotenuse of one and only one right triangle with integral legs. - Cino Hilliard, Mar 16 2003
Centered square primes (i.e., prime terms of centered squares A001844). - Lekraj Beedassy, Jan 21 2005
Primes of the form 2*k*(k-1)+1. - Juri-Stepan Gerasimov, Apr 27 2010
Equivalently, primes of the form (m^2+1)/2 (take m=2*j+1). These primes a(n) have nontrivial solutions of x^2 == 1 (Modd a(n)) given by x=x(n)=A002731(n). For Modd n see a comment on A203571. See also A206549 for such solutions for primes of the form 4*k+1, given in A002144.
E.g., a(3)=41, A002731(3)=9, 9^2=81, floor(81/41)=1 (odd),
-81 = -2*41 + 1 == 1 (mod 2*41), hence 9^2 == 1 (Modd 41). - Wolfdieter Lang, Feb 24 2012
Also primes of the form 4*k+1 that are the smallest side length of one and only one integer Soddyian triangle (see A230812). - Frank M Jackson, Mar 13 2014
Also, primes of the form (m^2+1)/2. - Zak Seidov, May 01 2014
Note that ((2n+1)^2 + 1)/2 = n^2 + (n+1)^2. - Thomas Ordowski, May 25 2015
Primes p such that 2p-1 is a square. - Thomas Ordowski, Aug 27 2016
Primes in the main diagonal of A000027 when represented as an array read by antidiagonals. - Clark Kimberling, Mar 12 2023
The diophantine equation x^2 + ... + (x + r)^2 = p may be rewritten to A*x^2 + B*x + C = p, where A = (r + 1), B = r*(r + 1), C = r*(r + 1)*(2*r + 1)/6. If gcd(A, B, C) > 1 no solution for a prime p exists. The gcd(A, B, C) = 1 holds only for r = 1, 2, 5 (gcd is the greatest common divisor). For r = 1 we have x^2 + (x + 1)^2 = p, thus for x from A027861 we calculate primes p from A027862. For r = 2 we have x^2 + (x + 1)^2 + (x + 2)^2 = p, thus for x from A027863 we calculate primes p from A027864. For r = 5 we have x^2 + ... + (x + 5)^2 = p, thus for x from A027866 we calculate primes p from A027867. - Ctibor O. Zizka, Oct 04 2023

Examples

			13 is in the sequence because it is prime and 13 = 2^2 + 3^2. - _Michael B. Porter_, Aug 27 2016
		

References

  • D. M. Burton, Elementary Number Theory, Allyn and Bacon Inc. Boston, MA, 1976, p. 271.
  • Morris Kline, Mathematical Thought from Ancient to Modern Times, 1972. pp. 275.

Crossrefs

Primes p such that A079887(p) = 1.
Cf. A002731 (m values), A027861 (j values), A091277 (prime indices).
Subsequence of A002144 (p=4k+1).
Cf. A001844 (centered squares), A027863, A027864, A027866, A027867, A203571, A206549, A230812.

Programs

  • Magma
    [ a: n in [0..150] | IsPrime(a) where a is n^2+(n+1)^2 ]; // Vincenzo Librandi, Dec 18 2010
  • Mathematica
    Select[Table[n^2+(n+1)^2,{n,200}],PrimeQ] (* Harvey P. Dale, Aug 22 2012 *)
    Select[Total/@Partition[Range[200]^2,2,1],PrimeQ] (* Harvey P. Dale, Apr 20 2016 *)
  • PARI
    je=[]; for(n=1,500, if(isprime(n^2+(n+1)^2),je=concat(je,n^2+(n+1)^2))); je
    
  • PARI
    fermat(n) = { for(x=1,n, y=2*x*(x+1)+1; if(isprime(y),print1(y" ")) ) }
    

Formula

a(n) = ((A002731(n)^2 - 1)/2) + 1. - Torlach Rush, Mar 14 2014
a(n) = (A002731(n)^2 + 1)/2. - Zak Seidov, May 01 2014

Extensions

More terms from Cino Hilliard, Mar 16 2003

A027861 Numbers k such that k^2 + (k+1)^2 is prime.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 12, 14, 17, 19, 22, 24, 25, 29, 30, 32, 34, 35, 39, 42, 47, 50, 60, 65, 69, 70, 72, 79, 82, 84, 85, 87, 90, 97, 99, 100, 102, 104, 109, 110, 115, 122, 130, 135, 137, 139, 144, 149, 154, 157, 160, 162, 164, 167, 172, 174, 185, 187, 189, 195, 199, 202
Offset: 1

Views

Author

Keywords

Comments

k > 1 never ends in 1, 3, 6 or 8 (that is, k*(k+1) does not end in 2). - Lekraj Beedassy, Jul 09 2004
k > 1 can never be congruent to (1 or 3) mod 5, because if it were, then k^2 + (k+1)^2 would be divisible by 5. In other words, for k > 1, this sequence cannot contain any values in A047219. This means that we can immediately discard 40% of all possible k. - Dmitry Kamenetsky, Sep 02 2008

Crossrefs

Complement of A012132.
Cf. A002731 (2k+1 values), A027862 (resulting primes), A091277 (indices of resulting primes).
Cf. A047219 (k mod 5 = 1 or 3), A001844 (centered squares), A010051.

Programs

  • Haskell
    a027861 n = a027861_list !! (n-1)
    a027861_list = filter ((== 1) . a010051 . a001844) [0..]
    -- Reinhard Zumkeller, Jul 13 2014
    
  • Magma
    [n: n in [0..1000] |IsPrime(n^2 + (n+1)^2)]; // Vincenzo Librandi, Nov 19 2010
    
  • Mathematica
    Select[Range[250],PrimeQ[#^2+(#+1)^2]&] (* Harvey P. Dale, Dec 31 2017 *)
  • PARI
    is(n)=isprime(n^2 + (n+1)^2) \\ Charles R Greathouse IV, Apr 28 2015

Formula

a(n) = (A002731(n)-1)/2.
a(n) = (sqrt(2*A027862(n)-1)-1)/2. - Zak Seidov, Jul 22 2013
A010051(A001844(a(n))) = 1. - Reinhard Zumkeller, Jul 13 2014
a(n) = floor(sqrt(A027862(n)/2)). - Rémi Guillaume, Apr 02 2025

A065876 a(n) is the smallest m > n such that n^2 + 1 divides m^2 + 1.

Original entry on oeis.org

1, 3, 3, 7, 13, 21, 31, 43, 18, 73, 91, 111, 17, 47, 183, 211, 241, 133, 57, 343, 381, 47, 172, 83, 553, 601, 651, 173, 342, 813, 242, 265, 132, 403, 411, 1191, 1261, 237, 327, 1483, 1561, 1641, 748, 857, 850, 1981, 684, 463, 413, 2353, 255, 2551, 593, 1177, 2863, 123, 3081, 307, 1288, 3423
Offset: 0

Views

Author

Benoit Cloitre, Dec 07 2001

Keywords

Comments

a(n) exists because n^2 + 1 divides (n^2 - n + 1)^2 + 1. The set of n such a(n) = n^2 - n + 1 is S = (2, 3, 4, 5, 6, 7, 9, 11, 14, 15, ...).
a(n) = n^2 - n + 1 whenever n^2 + 1 is prime or twice a prime. Up to n=1000, the only other n for which a(n) = n^2 - n + 1 are 7, 41 and 239. Is it a coincidence that these are NSW primes (A088165)? - Franklin T. Adams-Watters, Oct 17 2006
It appears that the density of even numbers in this sequence approaches a limit near 1/4. It appears that the density of even values for indices where a(n) != n^2 - n + 1 is approaching a number near 1/4 and based on the previous comment the density of n for which a(n) = n^2 - n + 1 is almost certainly 0. - Franklin T. Adams-Watters, Oct 17 2006

Crossrefs

Programs

  • Mathematica
    Do[k = 1; While[m = (k^2 + 1)/(n^2 + 1); m < 2 || !IntegerQ[m], k++ ]; Print[k], {n, 1, 40 } ]
  • PARI
    a(n) = { my(m=n+1); while ((m^2 + 1)%(n^2 + 1) != 0, m++); m } \\ Harry J. Smith, Nov 03 2009

Extensions

More terms from Robert G. Wilson v, Dec 11 2001
Further terms from Franklin T. Adams-Watters, Oct 17 2006

A207337 Primes of the form (m^2+1)/10.

Original entry on oeis.org

5, 17, 29, 53, 73, 109, 137, 281, 397, 449, 593, 757, 941, 1061, 1277, 1613, 1877, 2161, 2341, 2657, 2789, 3881, 4973, 5153, 6101, 6917, 7129, 7673, 8009, 8237, 8821, 9181, 10433, 12041, 13177, 13469, 13913, 14669, 15761, 17389, 18233, 18749
Offset: 1

Views

Author

Wolfdieter Lang, Feb 27 2012

Keywords

Comments

Equivalently, primes of the form (K^2 + (K+1)^2)/5. The connection to the primes of the form (m^2+1)/10 is given by m=2*K+1 (m is necessarily odd). The corresponsding m=m(n) values are given in A002733(n).
Equivalently, primes of the form (4*T(K)+1)/5, with the corresponding triangular numbers T(K):=A000217(K), for K(n)=(m(n)-1)/2, given in A207339(n).
For n>=2 the smallest positive representative of the class of nontrivial solutions of the congruence x^2==1 (Modd a(n)) is x=m(n). The trivial solution is the class with representative x=1, which also includes -1. For the prime a(1)=5 the smallest positive nontrivial solution is 3 (see A027862(1) with A002731(1)). Such a nontrivial smallest positive representative exists for each unique class of solutions of this congruence Modd p for any prime p of the form 4*k+1, given in A002144. Here the subset with k=k(n)=(a(n)-1)/4 appears, namely 1, 4, 7, 13, 18, 27, 34, 70,... For Modd n see a comment on A203571.

Examples

			a(3)=29, m(3)=A002733(3)=17. T(K(3))=A000217((17-1)/2)= A000217(8)=A207339(3)=36. (8^2+9^2)/5 = 29 = (4*36+1)/5.
		

Crossrefs

Programs

  • Haskell
    a207337 n = a207337_list !! (n-1)
    a207337_list = f a002522_list where
       f (x:xs) | m == 0 && a010051 y == 1 = y : f xs
                | otherwise                = f xs
                where (y,m) = divMod x 10
    -- Reinhard Zumkeller, Apr 06 2012

Formula

a(n) is the n-th member of the increasingly ordered list of primes of the form (m^2+1)/10, where m=m(n) is necessarily an odd integer, namely A002733(n).

A188546 Numbers n such that m=(n^2+1)/2, p=(m^2+1)/2 and q=(p^2+1)/2 are all prime.

Original entry on oeis.org

69, 271, 349, 3001, 3399, 4949, 6051, 9101, 9751, 10099, 10149, 11719, 12281, 15911, 22569, 24269, 25201, 25889, 28841, 31979, 37271, 39901, 42109, 44929, 46399, 48321, 50811, 60009, 63659, 63999, 71051, 71851, 75089, 76711, 87029, 96791, 103701, 110551, 111411, 112461, 113949, 125721, 126089, 127959, 129261, 131859, 132939, 137481, 144651
Offset: 1

Views

Author

Zak Seidov, Apr 03 2011

Keywords

Comments

a(1) = 69 = A116945(5).
Numbers n that generate three primes under the first three iterations of the map n-> A002731(n).
Subsequence of A116945.

Crossrefs

Programs

  • Magma
    r:=func< k | (k^2+1) div 2 >; [ n: n in [1..145000 by 2] | IsPrime(r(n)) and IsPrime(r(r(n))) and IsPrime(r(r(r(n)))) ];  // Bruno Berselli, Apr 05 2011
    
  • Mathematica
    s={}; Do[If[PrimeQ[m=(n^2+1)/2] && PrimeQ[p=(m^2+1)/2] && PrimeQ[q=(p^2+1)/2], Print[n]; AppendTo[s,n]], {n,1,300000,2}]; s
    mpqQ[n_]:=Module[{m=(n^2+1)/2,p},p=(m^2+1)/2;AllTrue[{m,p,(p^2+1)/2},PrimeQ]]; Select[Range[144700],mpqQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 18 2021 *)
  • PARI
    v=vector(10^4);i=0;forstep(n=1,9e9,2,if(isprime(m=(n^2+1)/2)&isprime(p=(m^2+1)/2)&isprime(q=(p^2+1)/2),v[i++]=n;if(i==#v,return(v)))) \\ Charles R Greathouse IV, Apr 05 2011

A188547 Numbers n such that m=(n^2+1)/2, p=(m^2+1)/2, q=(p^2+1)/2, and r=(q^2+1)/2 are all prime.

Original entry on oeis.org

4949, 6051, 169219, 183241, 560769, 1113621, 1306689, 1370269, 1421869, 1485561, 1640711, 1730709, 1876351, 1967769, 2147661, 2217351, 2293939, 2428461, 2440871, 3346661, 3625139, 3625889, 3763969, 3991209, 4020711, 4728141, 5219691, 5547221, 5554939, 5965699, 7345719, 8495879
Offset: 1

Views

Author

Zak Seidov, Apr 03 2011

Keywords

Comments

a(1) = 4949 = A188546(6) = A116945(53).
Subsequence of A188546.
Numbers n which generate 4 primes under the first four iterations of the map n-> A002731(n).
Among first 10000 terms, there are 1072 primes, the first a(3) = 169219 and the last a(10000) = 16541600731. - Zak Seidov, Jan 16 2019

Crossrefs

Programs

  • Magma
    r:=func< k | (k^2+1) div 2 >; [ n: n in [1..1000000 by 2] | IsPrime(r(n)) and IsPrime(r(r(n))) and IsPrime(r(r(r(n))))and IsPrime(r(r(r(r(n)))))]; // Vincenzo Librandi, Jan 16 2019
  • Mathematica
    s={}; Do[If[PrimeQ[m=(n^2+1)/2] && PrimeQ[p=(m^2+1)/2] && PrimeQ[q=(p^2+1)/2] && PrimeQ[r=(q^2+1)/2], AppendTo[s,n]], {n,1,10000000,2}]; s
  • PARI
    v=vector(10^4); i=0; forstep(n=1, 9e99, 2, if(isprime(m=(n^2+1)/2) && isprime(p=(m^2+1)/2) && isprime(q=(p^2+1)/2) && isprime(r=(q^2+1)/2), v[i++]=n; if(i==#v, return))) \\ Charles R Greathouse IV, Apr 12 2011
    

A207339 Triangular numbers T from A000217 such that (4*T+1)/5 is prime.

Original entry on oeis.org

6, 21, 36, 66, 91, 136, 171, 351, 496, 561, 741, 946, 1176, 1326, 1596, 2016, 2346, 2701, 2926, 3321, 3486, 4851, 6216, 6441, 7626, 8646, 8911, 9591, 10011, 10296, 11026, 11476, 13041, 15051, 16471, 16836, 17391, 18336, 19701, 21736
Offset: 1

Views

Author

Wolfdieter Lang, Feb 27 2012

Keywords

Comments

The corresponding primes are gven in A207337, where also equivalent formulations are found.
The indices of these triangular numbers are given by (A002733(n)-1)/2.

Examples

			a(3) = 36 = T((17-1)/2) = T(8)=A000217(8). (4*36+1)/5 = 29 = A207337(3).
		

Crossrefs

Programs

  • Mathematica
    Select[Accumulate[Range[300]],PrimeQ[(4#+1)/5]&] (* Harvey P. Dale, Sep 18 2019 *)

Formula

a(n) = T(K(n)):= A000217(K(n)) with K(n)=(m(n)-1)/2, and m(n) given in A002733(n).
Showing 1-10 of 20 results. Next