A213649 Smallest k such that there exists a square between prime(n) and prime(n+k).
2, 1, 2, 1, 2, 1, 3, 2, 1, 2, 1, 4, 3, 2, 1, 3, 2, 1, 4, 3, 2, 1, 3, 2, 1, 5, 4, 3, 2, 1, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 7, 6
Offset: 1
Keywords
Examples
a(7)=3 because prime(7) = 17, prime(7+3) = 29 and 17 < 25 < 29 where 25 is square.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..5000
Programs
-
Maple
with(numtheory):for n from 1 to 100 do:ii:=0:for k from 1 to 100 while(ii=0) do:p1:=ithprime(n):p2:=ithprime(n+k):i:=0:for m from p1+1 to p2-1 do:c:=sqrt(m):if c=floor(c) then i:=i+1:else fi:od: if i<>0 then ii:=1:printf(`%d, `,k):else fi:od:od:
Comments