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 10 results.

A248373 Partial sums of primes of form n^2 + (n+1)^2 + (n+2)^2 (A027864).

Original entry on oeis.org

5, 34, 183, 692, 1369, 3246, 6923, 15352, 25101, 37010, 50479, 68268, 90977, 118054, 146283, 191672, 238549, 291618, 361847, 433924, 515601, 616070, 718747, 832824, 961373, 1102642, 1257231, 1437308, 1629337, 1824414, 2031923, 2255512, 2485701, 2746778, 3059767
Offset: 1

Views

Author

Michael Savoric, Oct 05 2014

Keywords

Crossrefs

Cf. A027864.

Programs

  • Mathematica
    f[x_]:=x^2+(x+1)^2+(x+2)^2;
    n=50;result={};counter=0;number=0;
    While[counterHarvey P. Dale, Nov 24 2017 *)
  • PARI
    lista(nn) = {s = 0; for (n=0, nn, if (isprime(p=n^2 + (n+1)^2 + (n+2)^2), s +=p; print1(s, ", ")););} \\ Michel Marcus, Oct 06 2014

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

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

Original entry on oeis.org

0, 2, 6, 12, 14, 24, 34, 52, 56, 62, 66, 76, 86, 94, 96, 122, 124, 132, 152, 154, 164, 182, 184, 194, 206, 216, 226, 244, 252, 254, 262, 272, 276, 294, 322, 336, 342, 362, 364, 376, 384, 404, 406, 416, 436, 446, 464, 472, 486, 502, 546, 556, 584, 604, 612, 616
Offset: 1

Views

Author

Keywords

Comments

No positive terms == {0,8} (mod 10). Numbers k such that both k and k+2 are terms: 12, 94, 122, 152, 182, 252, 362, 204, ... Numbers k such that k, k+2 and k+4 are terms: 1942, 7222, 7402, 15692, 23502, 30182, ... - Zak Seidov, Aug 22 2014

Crossrefs

Cf. A027864 (associated primes).

Programs

  • Magma
    [n: n in [0..1000] |IsPrime(n^2+(n+1)^2+(n+2)^2)]; // Vincenzo Librandi, Nov 18 2010
    
  • Maple
    select(t -> isprime(t^2+(t+1)^2+(t+2)^2), [$0..1000]); # Robert Israel, Aug 22 2014
  • Mathematica
    Select[Range[0,700],PrimeQ[Total[(#+{0,1,2})^2]]&] (* Harvey P. Dale, Apr 28 2012 *)
  • PARI
    for(n=1,10^3,s=sum(i=0,2,(n+i)^2);if(isprime(s),print1(n,", "))) \\ Derek Orr, Aug 22 2014

A218209 Number of n-digit primes that are of the form (k-2)^2 + (k-1)^2 + k^2.

Original entry on oeis.org

2, 1, 3, 4, 12, 31, 86, 230, 681, 1934, 5634, 15772
Offset: 1

Views

Author

Martin Renner, Oct 23 2012

Keywords

Crossrefs

Programs

Formula

a(n) = A218210(n) - A218210(n-1)

A218210 Number of primes up to 10^n that are of the form (k-2)^2 + (k-1)^2 + k^2.

Original entry on oeis.org

2, 3, 6, 10, 22, 53, 139, 369, 1050, 2984, 8618, 24390
Offset: 1

Views

Author

Martin Renner, Oct 23 2012

Keywords

Comments

There are two primes < 10: 2 and 5.

Crossrefs

Programs

  • Mathematica
    n = -1; cnt = 0; Do[While[n++; p = 3*n^2 + 2; p < 10^e, If[PrimeQ[p], cnt++]]; n--; cnt, {e, 10}] (* T. D. Noe, Oct 23 2012 *)

Formula

a(n) = sum(A218209(k), k=1..n)

A218213 Number of n-digit primes representable as sums of consecutive squares.

Original entry on oeis.org

1, 4, 13, 30, 69, 187, 519, 1401, 3889, 10861, 31640, 90735
Offset: 1

Views

Author

Martin Renner, Oct 23 2012

Keywords

Comments

There are no common representations of two, three or six squares for n < 13, so
a(n) = A218207(n) + A218209(n) + A218211(n); n < 13.

Crossrefs

Programs

  • Mathematica
    nn = 8; nMax = 10^nn; t = Table[0, {nn}]; Do[k = n; s = 0; While[s = s + k^2; s <= nMax, If[PrimeQ[s], t[[Ceiling[Log[10, s]]]]++];  k++], {n, Sqrt[nMax]}]; t (* T. D. Noe, Oct 23 2012 *)

Formula

a(n) = A218214(n) - A218213(n-1).

A218214 Number of primes up to 10^n representable as sums of consecutive squares.

Original entry on oeis.org

1, 5, 18, 48, 117, 304, 823, 2224, 6113, 16974, 48614, 139349
Offset: 1

Views

Author

Martin Renner, Oct 23 2012

Keywords

Comments

There are no common representations of two, three or six squares for n < 13, so
a(n) = A218208(n) + A218210(n) + A218212(n); n < 13.

Examples

			a(1) = 1 because only one prime less than 10 can be represented as a sum of consecutive squares, namely 5 = 1^2 + 2^2.
a(2) = 5 because there are five primes less than 100 representable as a sum of consecutive squares: the aforementioned 5, as well as 13 = 2^2 + 3^2, 29 = 2^2 + 3^2 + 4^2, 41 = 4^2 + 5^2 and 61 = 5^2 + 6^2.
		

Crossrefs

Programs

  • Mathematica
    nn = 8; nMax = 10^nn; t = Table[0, {nn}]; Do[k = n; s = 0; While[s = s + k^2; s <= nMax, If[PrimeQ[s], t[[Ceiling[Log[10, s]]]]++]; k++], {n, Sqrt[nMax]}]; Accumulate[t] (* T. D. Noe, Oct 23 2012 *)

Formula

a(n) = sum(A218213(k),k=1..n)

A232768 Numbers n with the property that n^2+(n+1)^2 and n^2+(n+1)^2+(n+2)^2 are both prime.

Original entry on oeis.org

2, 12, 14, 24, 34, 122, 154, 164, 272, 342, 464, 612, 674, 734, 784, 794, 854, 1174, 1262, 1274, 1364, 1392, 1524, 1554, 1664, 1682, 1844, 1854, 1862, 1892, 1924, 1942, 1994, 2232, 2294, 2354, 2442, 2592, 2802, 2884, 3124, 3164, 3292, 3394, 3544, 3594, 3632, 3724, 3892, 3904, 3922
Offset: 1

Views

Author

Chris Fry, Nov 29 2013

Keywords

Comments

See A027862 for primes of the form x^2+(x+1)^2 = 2x^2+2x+1.
See A027864 for primes of the form x^2+(x+1)^2+(x+2)^2 = 3x^2+6x+5.
It is an open question whether either of these polynomials produces an infinite number of primes. This sequence lists the values of x that produce a prime in both polynomials. x must be congruent to 0 or 2 (mod 4) and all the generated primes are of the form 4k+1.

Examples

			When x=14, 2x^2+2x+1=421 and 3x^2+6x+5=677. 14 is the third value of x for which both these polynomials produce a prime number, so a(3)=14.
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 2005, page 266.

Crossrefs

Cf. A027862, A027864. Equals n common to A027861 and A027863.

Programs

  • Mathematica
    lst = {}; Do[If[And[PrimeQ[n^2 + (n + 1)^2], PrimeQ[n^2 + (n + 1)^2 + (n + 2)^2]], Print[n]; AppendTo[lst, n]], {n, 10000}]
    Select[Range[2,4000,2],AllTrue[{(#^2+(#+1)^2),(#^2+(#+1)^2+(#+2)^2)},PrimeQ]&] (* Harvey P. Dale, Jul 30 2023 *)

A256370 Positive integers n such that n^4 + (n+1)^4 + (n+2)^4 + (n+3)^4 + (n+4)^4 is prime.

Original entry on oeis.org

7, 25, 97, 115, 145, 169, 223, 247, 343, 379, 385, 421, 541, 577, 601, 607, 673, 691, 751, 847, 895, 961, 997, 1111, 1129, 1237, 1267, 1303, 1327, 1459, 1489, 1555, 1615, 1639, 1657, 1663, 1741, 1765, 1771, 1807, 1819, 1831, 1873, 1903, 1927, 1945, 1951, 1963
Offset: 1

Views

Author

Bui Quang Tuan, Mar 26 2015

Keywords

Comments

NK(n,k) conjecture:
If k + 1 is prime then there are infinitely many primes of form:
NK(n,k) = n^k + (n+1)^k + (n+2)^k + ... + (n+k-1)^k + (n+k)^k
If k + 1 is not prime then gcd(NK(n,k), k + 1) > 1 with any positive integer n.
Some examples in the OEIS:
k = 1, primes of form NK(n,1) are all odd primes A065091.
k = 2, primes of form NK(n,2) is A027864.
k = 4, this sequence generates all primes of form NK(n,4).
All terms == 1 (mod 6). Bunyakovsky's conjecture implies that the sequence is infinite. - Robert Israel, Mar 29 2015

Examples

			7 is in the sequence because 7^4 + 8^4 + 9^4 + 10^4 + 11^4 = 37699 which is prime.
		

Crossrefs

Cf. A027864.

Programs

  • Magma
    [n: n in [0..2*10^3] | IsPrime( n^4 + (n+1)^4 + (n+2)^4 + (n+3)^4 + (n+4)^4)]; // Vincenzo Librandi, Mar 27 2015
    
  • Maple
    F:= unapply(expand(add((n+i)^4,i=0..4)), n):
    select(isprime, [seq(6*i+1,i=1..1000)]); # Robert Israel, Mar 29 2015
  • Mathematica
    Select[Range@ 2000, PrimeQ[#^4 + (# + 1)^4 + (# + 2)^4 + (# + 3)^4 + (# + 4)^4] &] (* Michael De Vlieger, Mar 26 2015 *)
    Position[Partition[Range[2000]^4,5,1],?(PrimeQ[Total[#]]&)]//Flatten (* _Harvey P. Dale, Apr 28 2022 *)
  • Python
    from gmpy2 import is_prime
    A256370_list = [n for n in range(1,10**6) if is_prime(5*n*(n*(n*(n + 8) + 36) + 80) + 354)] # Chai Wah Wu, Mar 29 2015

A257163 Primes of the form 3n^2 + 2.

Original entry on oeis.org

2, 5, 29, 149, 509, 677, 1877, 3677, 8429, 9749, 11909, 13469, 17789, 22709, 27077, 28229, 45389, 46877, 53069, 70229, 72077, 81677, 100469, 102677, 114077, 128549, 141269, 154589, 180077, 192029, 195077, 207509, 223589, 230189, 261077, 312989, 340709, 352949, 395309, 399677, 426389
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 16 2015

Keywords

Comments

Two together with A027864(n).
Generated by n = 0, 1, 3, 7, 13, 15, 25, 35, 53, 57, ...

Examples

			2 is in this sequence because 3*0^2 + 2 = 2 and 2 is prime.
		

Crossrefs

Cf. A103564, A027864. Primes of the form k*n^2 + k - 1: A090698, this sequence, A121825, A201483, A201600, A201607, A201704.

Programs

  • Magma
    [a: n in [0..400] | IsPrime(a) where a is (3*n^2+2)];
    
  • Mathematica
    Select[Table[3 n^2 + 2, {n, 0, 400}], PrimeQ] (* Vincenzo Librandi, Apr 17 2015 *)
  • PARI
    select(isprime, vector(100, n, 3*n^2-6*n+5)) \\ Charles R Greathouse IV, Apr 17 2015
Showing 1-10 of 10 results.