A240474 Distance from prime(n) to the closest larger squarefree number.
1, 2, 1, 3, 2, 1, 2, 2, 3, 1, 2, 1, 1, 3, 4, 2, 2, 1, 2, 2, 1, 3, 2, 2, 4, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 3, 1, 2, 3, 1, 2, 1, 2, 1, 2, 2, 2, 3, 2, 1, 2, 2, 5, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 3, 2, 2, 4, 1, 3, 3, 1, 2, 2, 1, 1, 1, 1, 2, 1, 2, 1, 3, 2
Offset: 1
Keywords
Examples
a(9) = 3 because 3 is the gap between prime(9) = 23 and the closest larger squarefree number 26.
Links
- Chris Boyd, Table of n, a(n) for n = 1..10000
Programs
-
PARI
forprime(p=1,450,for(j=p+1,2*p,if(issquarefree(j),print1(j-p", ");break)))