OFFSET
0,5
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10000
EXAMPLE
Largest squarefree number dividing 27 is 3, and 27 - 3 = 24.
Largest squarefree number dividing 24 is 6, and 24 - 6 = 18.
Largest squarefree number dividing 18 is 6, and 18 - 6 = 12.
Largest squarefree number dividing 12 is 6, and 12 - 6 = 6.
Largest squarefree number dividing 6 is 6, and 6 - 6 = 0.
Thus a(6) = 1, a(12) = 2, a(18) = 3, a(24) = 4 and a(27) = 5.
MATHEMATICA
a[n_] := -1 + Length@ NestWhileList[# - Times @@ FactorInteger[#][[;; , 1]] &, n, # > 0 &]; Array[a, 100, 0] (* Amiram Eldar, Mar 04 2024 *)
PROG
(Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 23 2015
STATUS
approved