OFFSET
1,1
COMMENTS
The polynomial is to pass through the points (k, prime(k)), k=1..n.
The constant term is always an integer because it is the same as f(0), which can be computed from the difference table of the sequence of primes. See Conway and Guy. In fact, the interpolating polynomial is integral for all integer arguments.
A plot of the first 1000 terms shows that the sequence grows exponentially and changes signs occasionally. The Mathematica lines show two ways of computing the sequence. The second, which uses the difference table, is much faster.
The dual sequence (in the sense of Sun, q.v.) of the primes. - Charles R Greathouse IV, Oct 03 2013
REFERENCES
J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 80
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
Author?, Sicurvqf
T. D. Noe, Plot of A082594
Zhi-Wei Sun, Combinatorial identities in dual sequences, European J. Combin. 24:6 (2003), pp. 709-718.
FORMULA
a(n) = sum{k=1, .., n} (-1)^(k+1) A007442(k)
EXAMPLE
For n=4, we fit a cubic through the 4 points (1,2),(2,3),(3,5),(4,7) to obtain a(4) = 3.
MATHEMATICA
Table[Coefficient[Expand[InterpolatingPolynomial[Prime[Range[n]], x]], x, 0], {n, 50}]
Diff[lst_List] := Table[lst[[i+1]]-lst[[i]], {i, Length[lst]-1}]; n=50; dt=Table[{}, {n}]; dt[[1]]=Prime[Range[n]]; Do[dt[[i]]=Diff[dt[[i-1]]], {i, 2, n}]; Table[s=dt[[i, 1]]; Do[s=dt[[i-j, 1]]-s, {j, i-1}]; s, {i, n}]
PROG
(PARI) dual(v:vec)=vector(#v, i, -sum(j=0, i-1, binomial(i-1, j)*(-1)^j*v[j+1]))
dual(concat(0, primes(100)))[2..101] \\ Charles R Greathouse IV, Oct 03 2013
(PARI) {a(n) = sum(k=0, n-1, sum(i=0, k, binomial(k, i) * (-1)^i * prime(i+1)))}; /* Michael Somos, Dec 02 2020 */
CROSSREFS
KEYWORD
sign
AUTHOR
Cino Hilliard, May 08 2003
EXTENSIONS
Edited by T. D. Noe, May 08 2003
STATUS
approved