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-8 of 8 results.

A073104 Duplicate of A060566.

Original entry on oeis.org

1523, 1447, 1373, 1301, 1231, 1163, 1097, 1033, 971, 911, 853, 797, 743, 691, 641
Offset: 1

Views

Author

Keywords

A202018 a(n) = n^2 + n + 41.

Original entry on oeis.org

41, 43, 47, 53, 61, 71, 83, 97, 113, 131, 151, 173, 197, 223, 251, 281, 313, 347, 383, 421, 461, 503, 547, 593, 641, 691, 743, 797, 853, 911, 971, 1033, 1097, 1163, 1231, 1301, 1373, 1447, 1523, 1601, 1681, 1763, 1847, 1933, 2021, 2111, 2203, 2297, 2393
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 08 2011

Keywords

Comments

Euler's famous prime-generating polynomial; a(0) through a(39) are all prime.

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 225.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 138-139, 145.

Crossrefs

Programs

Formula

a(n) = A005846(n) for n < 41, a(41) = A145292(1);
Union of A005846 (primes) and A145292 (composites);
a(n) = A002378(n) + 41.
a(a(n) + n) = a(n)*a(n+1). - Vladimir Shevelev, Jul 16 2012 (This identity holds for all sequences of the form n^2 + n + c, Joerg Arndt, Jul 17 2012).
a(0) = 41 and for n > 0, a(n) = a(n-1) + 2*n. - Jean-Christophe Hervé, Sep 27 2014
From Colin Barker, Sep 28 2014: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: (41*x^2 - 80*x + 41) / (1-x)^3. (End)
a(n) = 2*a(n-1) - a(n-2) + 2. - Vincenzo Librandi, Mar 04 2016
E.g.f.: (x^2 + 2*x + 41)*exp(x). - Robert Israel, Mar 10 2016
Sum_{n>=0} 1/a(n) = tanh(sqrt(163)*Pi/2)*Pi/sqrt(163). - Amiram Eldar, May 12 2025

A002837 Numbers k such that k^2 - k + 41 is prime.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 43, 44, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72
Offset: 1

Views

Author

Keywords

Comments

Leonhard Euler published this prime-generating formula in 1772. - Harvey P. Dale, Sep 23 2020

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 6.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [n: n in [0..100] |IsPrime(n^2-n+41)]; // Vincenzo Librandi, Nov 21 2010
  • Maple
    A002837:=n->`if`(isprime(n^2-n+41),n,NULL): seq(A002837(n), n=0..100); # Wesley Ivan Hurt, Oct 21 2014
  • Mathematica
    Select[Range[0,100],PrimeQ[#^2-#+41]&] (* Harvey P. Dale, May 27 2012 *)
  • PARI
    v=[ ]; for(n=0,100, if(isprime(n^2-n+41),v=concat(v,n),)); v
    

Formula

a(n) = A056561(n-1) + 1, n > 1. - Robert Price, Nov 08 2019

A211773 Prime-generating polynomial: a(n) = 2*n^2 - 108*n + 1259.

Original entry on oeis.org

1259, 1153, 1051, 953, 859, 769, 683, 601, 523, 449, 379, 313, 251, 193, 139, 89, 43, 1, -37, -71, -101, -127, -149, -167, -181, -191, -197, -199, -197, -191, -181, -167, -149, -127, -101, -71, -37, 1, 43, 89, 139, 193, 251, 313, 379, 449, 523, 601, 683, 769, 859, 953
Offset: 0

Views

Author

Marius Coman, May 18 2012

Keywords

Comments

This polynomial generates 92 primes (66 distinct ones) for 0 <= n <= 99 (in fact the next two terms are still primes but we keep the range 0-99, customary for comparisons), just three primes less than the record held by Euler's polynomial for n = m - 35, which is m^2 - 69*m + 1231 (see the link below), but having six distinct primes more than this one.
The nonprime terms in the first 100 are: 1 (taken twice), 1369 = 37^2, 1849 = 43^2, 4033 = 37*109, 5633 = 43*131, 7739 = 71*109 and 8251 = 37*223.
For n = 2*m - 34 we obtain the polynomial 8*m^2 - 488*m + 7243, which generates 31 primes in a row starting from m = 0 (polynomial already reported, see the link below).
For n = 4*m - 34 we obtain the polynomial 32*m^2 - 976*m + 7243, which generates 31 primes in row starting from m = 0.
The polynomial 2*n^2 + 40*n + 1, which generates the positive terms of this sequence in ascending order (i.e., a(37), ...), yields 10774009 distinct primes for 0 <= n < 49999999 while Euler's polynomial (n^2 - n + 41) gives 9967520 primes in same range. - Mikk Heidemaa, Feb 23 2016

References

  • Joe L. Mott and Kermite Rose, Prime-Producing Cubic Polynomials in Lecture Notes in Pure and Applied Mathematics (Vol. 220), Marcel Dekker Inc., 2001, pages 281-317.

Crossrefs

Programs

Formula

G.f.: (1259 - 2624*x + 1369*x^2)/(1-x)^3. - Bruno Berselli, May 18 2012
a(n-37) = 2*n^2 + 40*n + 1. - Mikk Heidemaa, Feb 18 2016
From Elmo R. Oliveira, Feb 09 2025: (Start)
E.g.f.: exp(x)*(1259 - 106*x + 2*x^2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

A212325 Prime-generating polynomial: a(n) = n^2 + 3*n - 167.

Original entry on oeis.org

-167, -163, -157, -149, -139, -127, -113, -97, -79, -59, -37, -13, 13, 41, 71, 103, 137, 173, 211, 251, 293, 337, 383, 431, 481, 533, 587, 643, 701, 761, 823, 887, 953, 1021, 1091, 1163, 1237, 1313, 1391, 1471, 1553, 1637, 1723, 1811, 1901, 1993, 2087, 2183, 2281, 2381
Offset: 0

Views

Author

Marius Coman, May 14 2012

Keywords

Comments

The polynomial generates 24 primes in absolute value (23 distinct ones) in row starting from n=0 (and 42 primes in absolute value for n from 0 to 46).
The polynomial n^2 - 49*n + 431 generates the same primes in reverse order.
Note: we found in the same family of prime-generating polynomials (with the discriminant equal to 677) the polynomial 13*n^2 - 311*n + 1847 (13*n^2 - 469*n + 4217) generating 23 primes and two noncomposite numbers (in absolute value) in row starting from n=0 (1847, 1549, 1277, 1031, 811, 617, 449, 307, 191, 101, 37, -1, -13, 1, 41, 107, 199, 317, 461, 631, 827, 1049, 1297, 1571, 1871).
Note: another interesting algorithm to produce prime-generating polynomials could be N = m*n^2 + (6*m+1)*n + 8*m + 3, where m, 6*m+1 and 8*m+3 are primes. For m=7 then n=t-20 we get N = 7*t^2 - 237*t + 1999, which generates the following primes: 239, 163, 101, 53, 19, -1, -7, 1, 23, 59, 109, 173, 251 (we can see the same pattern: …, -1, -m, 1, …).

Crossrefs

Cf. A060566 (an 80 primes generating pol.), A202018 (Euler's p.g.p.), A050268, A181963, A181973, A182409, A211773, A318791, A320772, A330363 (other p.g.p.).

Programs

  • Magma
    [n^2+3*n-167: n in [0..47]]; // Bruno Berselli, May 18 2012
    
  • Mathematica
    Table[n^2+3n-167,{n,0,50}] (* or *) LinearRecurrence[{3,-3,1},{-167,-163,-157},50] (* Harvey P. Dale, Feb 08 2020 *)
  • PARI
    Vec((-167+338*x-169*x^2)/(1-x)^3+O(x^99)) \\ Charles R Greathouse IV, Oct 01 2012
    
  • PARI
    apply( {A212325(n)=(n+3)*n-167}, [0..55]) \\ M. F. Hasler, Feb 11 2025
    
  • Python
    def A212325(n=None, upto=None): return(A212325(i)for i in range(n or 0, upto or 2**63)) if upto or n is None else(n+3)*n-167 # M. F. Hasler, Feb 11 2025

Formula

G.f.: (-167 + 338*x - 169x^2)/(1-x)^3. - Bruno Berselli, May 18 2012
From Elmo R. Oliveira, Feb 10 2025: (Start)
E.g.f.: exp(x)*(-167 + 4*x + x^2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

Extensions

Edited by Bruno Berselli, May 18 2012

A155884 a(n) = n^2 - n + 41 if this is a prime, a(n) = a(n-40) otherwise.

Original entry on oeis.org

41, 41, 43, 47, 53, 61, 71, 83, 97, 113, 131, 151, 173, 197, 223, 251, 281, 313, 347, 383, 421, 461, 503, 547, 593, 641, 691, 743, 797, 853, 911, 971, 1033, 1097, 1163, 1231, 1301, 1373, 1447, 1523, 1601, 41, 43, 1847, 1933, 61, 2111, 2203, 2297, 2393, 131
Offset: 0

Views

Author

Roger L. Bagula and M. F. Hasler, Jan 29 2009

Keywords

Comments

It is well known that for 0 <= n <= 40, the polynomial f(n) = n^2 - n + 41 does yield a prime number, so the sequence is well defined.
A variant of A005846, A060566, A142719. All these aim at extending the series of prime values of Euler's famous prime-producing polynomial P(n) = n^2 + n + 41, see references in A005846. [The present sequence considers f(n) = P(n-1) which is completely equivalent.]
The present sequence is a simplification of an extended variant of A142719. By construction, all terms of the present sequence are prime, but in contrast to A005846, prime values of the polynomial remain at the "correct" position, a(n) = f(n). The "substituted" values are easily recognized as they follow local maxima. Of course one could equally well insert a(n) = 2 whenever f(n) is composite.
The present sequence contains only primes. A different sequence, defined by "a(n) = f(n) if this is prime, a(n) = f(n-40) otherwise", does not always produce primes.

Crossrefs

Programs

  • PARI
    a(n) = { while( !isprime( n^2-n+41 ), n-=40 ); n^2-n+41 }

A226097 a(n) = ((-1)^n + 2*n - 38)*(2*n - 38) + 41.

Original entry on oeis.org

1447, 1373, 1163, 1097, 911, 853, 691, 641, 503, 461, 347, 313, 223, 197, 131, 113, 71, 61, 43, 41, 47, 53, 83, 97, 151, 173, 251, 281, 383, 421, 547, 593, 743, 797, 971, 1033, 1231, 1301, 1523, 1601, 1847, 1933, 2203, 2297, 2591, 2693, 3011, 3121, 3463, 3581, 3947
Offset: 0

Views

Author

Arkadiusz Wesolowski, May 26 2013

Keywords

Comments

a(n) are distinct primes for n = 0 to 59.
All terms are in A202018.

Crossrefs

Programs

  • Magma
    [((-1)^n+a)*a+41 where a is 2*n-38 : n in [0..50]];
    
  • Mathematica
    g[n_] := 2*n - 38; f[n_] := ((-1)^n + g[n])*g[n] + 41; Table[f[n], {n, 0, 50}]
    EulerP[n_] := n^2 - n + 41; f[n_] := 2*n - (3 + (-1)^n)/2; LinearRecurrence[{1, 2, -2, -1, 1}, Table[EulerP@f[n], {n, 19, 15, -1}], {0, 50}]
  • PARI
    Vec((1447 - 74*x - 3104*x^2 + 82*x^3 + 1681*x^4) / ((1 - x)^3*(1 + x)^2) + O(x^100)) \\ Colin Barker, Aug 14 2017

Formula

G.f.: (1447-2*x*(37+1552*x-41*x^2)+(41*x^2)^2)/((1+x)^2*(1-x)^3).
From Colin Barker, Aug 14 2017: (Start)
G.f.: (1447 - 74*x - 3104*x^2 + 82*x^3 + 1681*x^4) / ((1 - x)^3*(1 + x)^2).
a(n) = 4*n^2 - 150*n + 1447 for n even.
a(n) = 4*n^2 - 154*n + 1523 for n odd.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
(End)

A289762 Triangular array T(m,k) = (m+1-k)^2 + k - 1 with m (row) >= 1 and k (column) >= 1, read by rows.

Original entry on oeis.org

1, 1, 4, 2, 2, 4, 9, 5, 3, 3, 5, 9, 16, 10, 6, 4, 4, 6, 10, 16, 25, 17, 11, 7, 5, 5, 7, 11, 17, 25, 36, 26, 18, 12, 8, 6, 6, 8, 12, 18, 26, 36, 49, 37, 27, 19, 13, 9, 7, 7, 9, 13, 19, 27, 37, 49, 64, 50, 38, 28, 20, 14, 10, 8, 8, 10, 14, 20, 28, 38, 50, 64, 81, 65, 51, 39, 29, 21, 15, 11, 9
Offset: 1

Views

Author

Miquel Cerda, Jul 12 2017

Keywords

Comments

The n-th row is of length = max(2n, 1) and the row sum is (2n^3 + 6n^2 - 2n) / 3.
Rows m = 2, 3, 5, 11, and 41 (Euler's lucky numbers) give the prime numbers generated by the famous polynomials, but twice each one between m^2.

Examples

			The m-th row start and end: T(m,1) = m^2, ..., T(m,2m) = m^2.
In general T(m,k) = T(m,2m+1-k).
m\k    1     2     3     4     5     6     7     8     9     10
1      1,    1,
2      4,    2,    2,    4
3      9,    5,    3,    3,    5,    9
4      16,   10,   6,    4,    4,    6,    10,   16
5      25,   17,   11,   7,    5,    5,    7,    11,   17,   25
6      36,   26,   18,   12,   8,    6,    6,    8,    12,   18, ...
7      49,   37,   27,   19,   13,   9,    7,    7,    9,    13, ...
8      64,   50,   38,   28,   20,   14,   10,   8,    8,    10, ...
9      81,   65,   51,   39,   29,   21,   15,   11,   9,    9, ...
10     100,  82,   66,   52,   40,   30    22,   16,   12,   10, ...
The T(m,k) sequence as an isosceles triangle:
                                     1  1
                                 4   2  2  4
                             9   5   3  3  5  9
                         16  10  6   4  4  6  10  16
                     25  17  11  7   5  5  7  11  17  25
                 36  26  18  12  8   6  6  8  12  18  26  36
             49  37  27  19  13  9   7  7  9  13  19  27  37  49
         64  50  38  28  20  14  10  8  8  1  14  20  28  38  50  64
     81  65  51  39  29  21  15  11  9  9  11 15  21  29  39  51  65  81
100  82  66  52  40  30  22  16  12  10 10 12 16  22  30  40  52  66  82  100
		

Crossrefs

m(41, k+1) = A060566(n), left and right border gives A000290(n).

Programs

Formula

The formula that gives the integers in the m-th rows can be expressed using quadratic polynomials:
for row m = 1, a(k) = k^2 - 3*k + 3
for row m = 2, a(k) = k^2 - 5*k + 8
for row m = 3, a(k) = k^2 - 7*k + 15
for row m = 4, a(k) = k^2 - 9*k + 24
for row m = 5, a(k) = k^2 - 11*k + 35
for row m = 6, a(k) = k^2 - 13*k + 48
etc.
Showing 1-8 of 8 results.