%I #32 May 11 2024 10:11:59
%S 0,1,2,0,1,2,3,0,0,1,2,3,4,5,6,0,1,2,3,4,5,6,7,8,0,1,0,1,2,3,4,0,1,2,
%T 3,4,5,6,7,8,9,10,11,12,13,14,15,16,0,1,2,3,4,5,6,7,8,9,10,11,12,13,
%U 14,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,0
%N a(n) = n - largest prime power <= n.
%C This sequence considers "prime powers" to be A025475 rather than A000961.
%C a(8)=a(9)=0. With Mihăilescu's proof of Catalan's conjecture (see A001597) there can be no further occurrence of consecutive zeros. - _Robert Munafo_, May 10 2024
%H Michael De Vlieger, <a href="/A069585/b069585.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = n - A167185(n). - _Michel Marcus_, May 10 2024
%t nn = 10^4; s = {1}~Join~Select[Union@ Flatten@ Table[a^2*b^3, {b, Surd[nn, 3]}, {a, Sqrt[nn/b^3]}], PrimePowerQ]; Table[n - TakeWhile[s, # <= n &][[-1]], {n, nn}] (* _Michael De Vlieger_, May 11 2024 *)
%Y Cf. A031218, A069584.
%K easy,nonn
%O 1,3
%A _Amarnath Murthy_, Mar 24 2002
%E Revised by _Robert Munafo_ and _Sean A. Irvine_, May 10 2024