cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A381604 Least number k such that A381596(k) = n.

This page as a plain text file.
%I A381604 #9 Mar 12 2025 08:39:26
%S A381604 1,2,5,10,17,116,501,512
%N A381604 Least number k such that A381596(k) = n.
%C A381604 Least number k such that the number of real zeros of the polynomial P(k,z) = Sum_{i=1..k} A001223(i)*z^(i-1) is equal to n, where A001223(i) = differences between consecutive primes.
%e A381604 a(1) = 2 because P(2,z) = Sum_{i=1..2} A001223(i)*z^(i-1) = 1 + 2*z = 0 for z = -1/2.
%e A381604 a(2) = 5 because P(5,z) = Sum_{i=1..5} A001223(i)*z^(i-1) = 1 + 2*z + 2*z^2 + 4*z^3 + 2*z^4 = 0 for z = -1.6499348..., -0.5606729...
%p A381604 with(numtheory):
%p A381604 for n from 0 to 20 do:
%p A381604 ii:=0:
%p A381604   for k from 1 to 10^3 while(ii=0) do :
%p A381604     P:=add((ithprime(i+1)-ithprime(i))*x^(i-1),i=1..k):
%p A381604     y:=fsolve(P,x,real):z:=evalf({%}):y:=nops(z):
%p A381604      if y=n
%p A381604      then
%p A381604       ii:=1:printf (`%d %d \n`,n,k):
%p A381604        else
%p A381604      fi:
%p A381604   od:
%p A381604 od:
%Y A381604 Cf. A001223, A381596.
%K A381604 nonn,hard,more
%O A381604 0,2
%A A381604 _Michel Lagneau_, Mar 01 2025