login
Number of real zeros of the polynomial whose coefficients are the decimal expansion of Pi truncated to n places (A011545).
2

%I #26 Aug 03 2024 15:03:01

%S 0,1,0,1,0,1,2,1,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,

%T 0,1,0,1,0,1,2,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,0,0,1,

%U 2,1,2,2,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,0,0

%N Number of real zeros of the polynomial whose coefficients are the decimal expansion of Pi truncated to n places (A011545).

%C a(n) = number of real zeros of the polynomial P(n,x) = sum_{k=0..n-1} d(k) x^k, where d(k) are the digits of the decimal expansion of floor(Pi*10^n), n=0,1,2,...

%C From _Robert Israel_, Dec 19 2018: (Start)

%C If d(n) = 0 then P(n,x)=P(n-1,x) so a(n)=a(n-1).

%C If d(n) <> 0 and P(n,x) has nonzero discriminant, then a(n) == n (mod 2).

%C Conjecture: P(n,x) has nonzero discriminant for all n >= 1.

%C Record values: a(0)=0, a(1)=1, a(6)=2, a(135)=3, a(374)=4. (End)

%H Robert Israel, <a href="/A175799/b175799.txt">Table of n, a(n) for n = 0..545</a>

%e a(0) = 0 because 3 => P(0,x)=3 is a constant and has 0 real root;

%e a(1) = 1 because 31 => P(1,x) = 1+3x has 1 real root;

%e a(6) = 2 because 3141592 => P(6,x) = 2 + 9x + 5x^2 + x^3 + 4x^4 + x^5 + 3x^6 has 2 real roots.

%p L:= convert(floor(10^100*Pi),base,10):

%p f:= proc(n) local P, x,i;

%p P:=add(L[-i]*x^(i-1),i=1..n+1);

%p sturm(sturmseq(P,x),x,-infinity,infinity)

%p end proc:

%p map(f, [$0..100]); # _Robert Israel_, Dec 19 2018

%o (PARI) A175799(n)={ default(realprecision)>n || default(realprecision,n+1); sum(k=1, #n=factor(1.*Pol(eval(Vec(Str(Pi*10^n\1)))))~, (poldegree(n[1, k])==1)*n[2, k] )} /* factorization over the reals => linear factor for each root. poldegree()==1 could be replaced by poldisc()>=0 */ \\ _M. F. Hasler_, Dec 04 2010

%Y Cf. A011545, A173667.

%K nonn,base

%O 0,7

%A _Michel Lagneau_, Dec 04 2010

%E Corrected and extended by _Robert Israel_, Dec 19 2018