login
Distance from prime(n) to the closest smaller squarefree number.
15

%I #10 Apr 28 2014 02:45:24

%S 1,1,2,1,1,2,2,2,1,3,1,2,2,1,1,2,1,2,1,1,2,1,1,2,2,4,1,1,2,2,4,1,3,1,

%T 3,2,2,2,1,3,1,2,1,2,2,2,1,1,1,2,2,1,2,2,2,1,2,2,3,3,1,2,2,1,2,3,1,2,

%U 1,2,4,1,1,2,2,1,3,2,2,2,1,2,1,2,1,1

%N Distance from prime(n) to the closest smaller squarefree number.

%H Chris Boyd, <a href="/A240473/b240473.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A000040(n) - A112925(n). - _Michel Marcus_, Apr 10 2014

%e a(10) = 3 because 3 is the gap between prime(10) = 29 and the closest smaller squarefree number 26.

%o (PARI) forprime(p=1,450,forstep(j=p-1,1,-1,if(issquarefree(j),print1(p-j", ");break)))

%Y Cf. A000040, A112925, A166003, A176141, A240474, A240475, A240476.

%K nonn

%O 1,3

%A _Chris Boyd_, Apr 06 2014