OFFSET
1,1
COMMENTS
LINKS
FORMULA
EXAMPLE
For n=1, prime(1)=2 and prime(2)=3, and 3^1 is not larger than 2*2^1, but 3^2 > 2*2^2, therefore a(1) = 2.
For n=3, prime(3)=5 and prime(4)=7, with 7 < 2*5, 7^2 = 49 < 2*25, and 7^3 = 343 > 2*125, therefore a(3) = 3.
PROG
(PARI) A378744(n) = { my(p=prime(n), q=prime(1+n)); for(k=-1+floor(log(2)/log(q/p)), oo, if(q^k > 2*(p^k), return(k))); };
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Antti Karttunen, Dec 08 2024
STATUS
approved