%I #37 Jul 27 2021 04:02:15
%S 0,0,5,12,21,33,47,63,81,102,125,151,179,209,242,277,314,354,396,440,
%T 487,536,587,641,697,755,816,879,944,1012,1082,1155,1230,1307,1387,
%U 1468,1553,1639,1728,1819,1913,2009,2107,2208,2311,2416,2524,2634,2747,2861,2978
%N The least k such that the number of real roots of Sum_{i=0..j} (i+1)^k*x^i is j for j = 0,1,...,n or -1 if no solution for this n exists.
%C Conjecture: The sequence is defined for all n.
%C A Maple calculation shows that for n = 125 and k = 20000 the number of real roots of Sum_{i=0..j} (i+1)^k*x^i is j for j = 0,1,...,n. This shows that a(n) is defined at least up to n = 125.
%H W. Edwin Clark and Mark Shattuck, <a href="https://arxiv.org/abs/2107.05572">The Integer Sequence Transform a --> b where b_n is the Number of Real Roots of the Polynomial a_0 + a_1 x + a_2 x^2 + ... + a_n x^n</a>, arXiv:2107.05572 [math.CO], 2021.
%p Section:=proc(p,j)
%p local i,x;
%p x:=op(indets(p));
%p add(coeff(p,x,i)*x^i,i=0..j);
%p end:
%p IsGood:=proc(p)
%p local i,n,x;
%p n:=degree(p);
%p for i from 0 to n do
%p if NumRealRoots(Section(p,i)) <> i then return false; fi;
%p od:
%p return true;
%p end:
%p NumRealRoots:=proc(p)
%p local q,k,u;
%p if p = 0 then error "zero polynomial not allowed"; fi;
%p q:=sqrfree(p);
%p k:=0;
%p for u in q[2] do
%p k:=k+nops(realroot(u[1]))*u[2];
%p od;
%p k;
%p end:
%p K0:=0:
%p for n from 0 to 50 do
%p if n = 0 then printf("%d,",0); next; fi;
%p flag:=false;
%p for k from K0 to 10^10 do
%p p:=add(((i+1)^k)*x^i,i=0..n);
%p if IsGood(p) then K0:=k; printf("%d,",k); flag:=true; break; fi;
%p od:
%p if flag=false then printf("%d,",-1); fi;
%p od:
%o (PARI) f(n, k) = (n+1)^k;
%o nb(n, k) = {my(v = vector(n+1, i, f(i-1, k))); #polrootsreal(Pol(v));}
%o a(n) = {my(k=0); while (vector(n+1, i, nb(i-1, k)) != [0..n], k++); k;} \\ _Michel Marcus_, Jul 14 2021
%K nonn,hard
%O 0,3
%A _W. Edwin Clark_, Jul 14 2021
%E a(29)-a(43) from _Hugo Pfoertner_, Jul 17 2021
%E a(44)-a(50) from _Hugo Pfoertner_, Jul 19 2021