login
Difference between n-th lucky number and n-th prime number.
5

%I #11 Mar 09 2015 09:35:17

%S -1,0,2,2,2,2,4,6,8,4,6,6,8,8,16,14,10,12,8,8,14,14,16,16,14,14,24,22,

%T 24,22,14,20,22,24,20,20,32,30,28,28,26,30,28,30,34,36,26,18,32,32,34,

%U 34,42,34,32,34,34,36,42,40,44,38,32,38,44,44,36,48,44,44,46,50,48,48,48

%N Difference between n-th lucky number and n-th prime number.

%H T. D. Noe, <a href="/A032600/b032600.txt">Table of n, a(n) for n=1..10000</a>

%F A000959(n) - A000040(n).

%t lst = Range[1, 428, 2]; i = 2; While[ i <= (len = Length@lst) && (k = lst[[i]]) <= len, lst = Drop[lst, {k, len, k}]; i++ ]; lst - Prime@ Range@ Length@lst (* _Robert G. Wilson v_ *)

%Y Cf. A000040, A000959.

%K sign

%O 1,3

%A _Patrick De Geest_, May 15 1998

%E Edited by _Robert G. Wilson v_, May 12 2006