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

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

A213810 a(n) = 4*n^2 - 482*n + 14561.

Original entry on oeis.org

14561, 14083, 13613, 13151, 12697, 12251, 11813, 11383, 10961, 10547, 10141, 9743, 9353, 8971, 8597, 8231, 7873, 7523, 7181, 6847, 6521, 6203, 5893, 5591, 5297, 5011, 4733, 4463, 4201, 3947, 3701, 3463, 3233, 3011, 2797, 2591, 2393, 2203, 2021, 1847, 1681, 1523
Offset: 0

Views

Author

Marius Coman, Jun 20 2012

Keywords

Comments

A "prime-generating" polynomial: This polynomial generates 88 distinct primes for 0 <= n <= 99, just two primes fewer than the record held by the polynomial discovered by N. Boston and M. L. Greenwood, that is 41*n^2 - 4641*n + 88007 (this polynomial is sometimes cited as 41*n^2 + 33*n - 43321, which is the same for the input values [-57,42], see the references below).
The nonprime terms in the first 100 are: 10961 = 97*113; 10547 = 53*199; 9353 = 47*199; 7181 = 43*167; 6847 = 41*167; 5893 = 71*83; 3233 = 53*61; 2021 = 43*47; 1681 = 41^2; 1763 = 41*43; 2491 = 47*53; 4331 = 61*71.
For n = m + 41 we obtain the polynomial 4*m^2 - 154*m + 1523, which generates 40 primes in a row starting from m = 0 (polynomial already reported, see the link below).

References

  • W. Narkiewicz, The Development of Prime Number Theory: from Euclid to Hardy and Littlewood, Springer Monographs in Mathematics, 2000, page 43.

Crossrefs

Programs

  • Mathematica
    Table[4n^2-482n+14561,{n,0,41}] (* Harvey P. Dale, Sep 09 2014 *)
    LinearRecurrence[{3,-3,1},{14561, 14083, 13613}, 50] (* or *) CoefficientList[Series[ (-15047*x^2+29600*x-14561)/(x-1)^3, {x,0,50}], x] (* G. C. Greubel, Feb 26 2017 *)
  • PARI
    x='x+O('x^50); Vec((-15047*x^2+29600*x-14561)/(x-1)^3) \\ G. C. Greubel, Feb 26 2017

Formula

a(n) = 4*n^2 - 482*n + 14561.
G.f.: (-15047*x^2 + 29600*x - 14561)/(x-1)^3. - Alexander R. Povolotsky, Jun 21 2012
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - G. C. Greubel, Feb 26 2017
E.g.f.: exp(x)*(14561 - 478*x + 4*x^2). - Elmo R. Oliveira, Feb 09 2025

Extensions

Edited by N. J. A. Sloane, Nov 12 2016

A256302 Least prime p such that p+3*k*(k+1) is prime for all k=0,...,n.

Original entry on oeis.org

2, 5, 5, 5, 11, 11, 11, 11, 11, 11, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23
Offset: 0

Views

Author

M. F. Hasler, Apr 05 2015

Keywords

Comments

Inspired by the so-called prime-generating polynomials.
Since p | 3n(n+1) for n=p-1, one has a(n) > p(n). Otherwise stated, a(p-1) = p (as, e.g., for p=23) is optimal.

Crossrefs

Programs

  • PARI
    a(n)=forprime(p=1,,for(i=1,n,ispseudoprime(p+3*(i+1)*i)||next(2));return(p))
Showing 1-3 of 3 results.