OFFSET
1,2
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..17517
EXAMPLE
MATHEMATICA
nn = 10^4; m = 1; While[m! < Floor[6 nn/5], m++]; m; f[n_] := IntegerDigits[n, MixedRadix[Reverse@ Range[2, m]]]; Position[#, 1] &[Function[w, Count[Subtract @@ Map[PadLeft[#, Max@ Map[Length, w]] &, w], k_ /; k != 0]]@ Map[f@ # &, {#1, #2}] & @@@ Partition[#, 2, 1] &@ TakeWhile[Reverse@ NestWhileList[# - Total@ f@ # &, Floor[6 nn/5], # > 0 &], # <= nn &]] // Flatten (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 10 2013
STATUS
approved