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

A140119 Extrapolation for (n + 1)-st prime made by fitting least-degree polynomial to first n primes.

Original entry on oeis.org

2, 4, 8, 8, 22, -6, 72, -92, 266, -426, 838, -1172, 1432, -398, -3614, 15140, -41274, 95126, -195698, 370876, -652384, 1063442, -1570116, 1961852, -1560168, -1401888, 11023226, -36000318, 93408538, -214275608, 450374202, -879254356, 1599245876, -2695464868, 4138070460, -5539280974
Offset: 1

Views

Author

Jonathan Wellons (wellons(AT)gmail.com), May 08 2008

Keywords

Comments

Construct the least-degree polynomial p(x) which fits the first n primes (p has degree n-1 or less). Then predict the next prime by evaluating p(n+1).
Can anything be said about the pattern of positive and negative values?
Row sums of triangle A095195. - Reinhard Zumkeller, Oct 10 2013

Examples

			The lowest-order polynomial having points (1,2), (2,3), (3,5) and (4,7) is f(x) = 1/6 (-x^3 +9x^2 -14x +18). When evaluated at x = 5, f(5) = 8.
		

Crossrefs

Programs

  • Haskell
    a140119 = sum . a095195_row  -- Reinhard Zumkeller, Oct 10 2013
    
  • PARI
    a(n) = sum(i=1, n, prime(i)*(-1)^(n-i)*binomial(n, i-1)); \\ Michel Marcus, Jun 28 2020

Formula

a(n) = Sum_{i=1..n} prime(i) * (-1)^(n-i) * C(n,i-1).

A226805 P_n(n+1) where P_n(x) is the polynomial of degree n-1 which satisfies P_n(i) = i^i for i = 1,...,n.

Original entry on oeis.org

1, 7, 70, 877, 13316, 237799, 4885980, 113566121, 2946476764, 84417530491, 2647176188372, 90183424037293, 3316840864313484, 130985236211745959, 5528094465439087876, 248308899812296990033, 11827417687501017074876, 595470029978391175571923
Offset: 1

Views

Author

Keywords

Examples

			P_3(x) = 18 - 27*x + 10*x^2; a(3) = P_3(3+1) = 70.
		

Crossrefs

Programs

  • Mathematica
    P[n_][x_] = Sum[a[i]*x^i, {i, 0, n - 1}];ecu[n_] := Table[P[n][i] == i^i, {i, 1, n}];PP[n_][x_] := P[n][x] /. Solve[ecu[n]][[1]];Table[PP[i][i + 1], {i, 1, 22}]
    a[n_] := InterpolatingPolynomial[Table[{i, i^i}, {i, n}], n+1]; Array[a, 20] (* Giovanni Resta, Jun 18 2013 *)
  • PARI
    a(n)=subst(polinterpolate(vector(n,i,i^i)),'x,n+1) \\ Charles R Greathouse IV, Nov 19 2013
Showing 1-2 of 2 results.