A173667 Number of real zeros of the polynomial whose coefficients are the decimal expansion of n.
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0
Offset: 1
Examples
a(121) = 2 because 1+2x+x^2 = 0 has 2 real roots. a(1597200)=6 because x^6 + 5x^5 + 9x^4+7x^3+2x^2 = x^2 (x+2)(x+1)^3 has 6 real roots.
Programs
-
Maple
with(numtheory):T:=array(1..10000000): x2:=0: printf(`%d, `, x2):for n from 1 to 300 do: for i from 1 to 8 do: T[i]:=0:od: l:=length(n) : n0:=n:for m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :u: T[m]:=u:od:x:=fsolve(T[1]+ T[2]*z + T[3]*z^2+ T[4]*z^3+ T[5]*z^4 + T[6]*z^5 + T[7]*z^6 + T[8]*z^7, z, real):x1:=[x]: x2:=nops(x1): printf(`%d, `, x2):od:
-
PARI
A173667(n)=sum(k=1,#n=factor(1.*Pol(eval(Vec(Str(n)))))~,(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, Nov 25 2010
Comments