login
Constant term when a polynomial of degree n-1 is fitted to the first n primes.
6

%I #23 Dec 02 2020 16:43:27

%S 2,1,2,3,6,15,38,91,206,443,900,1701,2914,4303,4748,1081,-14000,

%T -55335,-150394,-346163,-716966,-1369429,-2432788,-4002993,-5964748,

%U -7525017,-6123026,4900093,40900520,134308945,348584680,798958751,1678213244,3277458981,5972923998,10110994307

%N Constant term when a polynomial of degree n-1 is fitted to the first n primes.

%C The polynomial is to pass through the points (k, prime(k)), k=1..n.

%C 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.

%C 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.

%C The dual sequence (in the sense of Sun, q.v.) of the primes. - _Charles R Greathouse IV_, Oct 03 2013

%D J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 80

%H T. D. Noe, <a href="/A082594/b082594.txt">Table of n, a(n) for n = 1..1000</a>

%H Author?, <a href="http://groups.msn.com/BC2LCC/page.msnw?fc_p=%2FSicurv%20%2D%20Simul%20Equ%20and%20Curve%20Fitting&amp;fc_a=0">Sicurvqf</a>

%H T. D. Noe, <a href="http://www.sspectra.com/math/A082594.gif">Plot of A082594</a>

%H Zhi-Wei Sun, <a href="http://maths.nju.edu.cn/~zwsun/60e.pdf">Combinatorial identities in dual sequences</a>, European J. Combin. 24:6 (2003), pp. 709-718.

%F a(n) = sum{k=1, .., n} (-1)^(k+1) A007442(k)

%e For n=4, we fit a cubic through the 4 points (1,2),(2,3),(3,5),(4,7) to obtain a(4) = 3.

%t Table[Coefficient[Expand[InterpolatingPolynomial[Prime[Range[n]], x]], x, 0], {n, 50}]

%t 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}]

%o (PARI) dual(v:vec)=vector(#v,i,-sum(j=0,i-1,binomial(i-1,j)*(-1)^j*v[j+1]))

%o dual(concat(0,primes(100)))[2..101] \\ _Charles R Greathouse IV_, Oct 03 2013

%o (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 */

%Y Cf. A007442, A140119.

%K sign

%O 1,1

%A _Cino Hilliard_, May 08 2003

%E Edited by _T. D. Noe_, May 08 2003