OFFSET
1,1
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
LINKS
Jonathan Wellons, Table of n, a(n) for n = 1..1500
FORMULA
a(n) = Sum_{i=1..n} prime(i) * (-1)^(n-i) * C(n,i-1).
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
sign
AUTHOR
Jonathan Wellons (wellons(AT)gmail.com), May 08, 2008
STATUS
approved