OFFSET
1,3
LINKS
Carole Dubois, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Scatterplot of a(n), n = 1..10^6.
EXAMPLE
a(1) = 0; as 0! = 1 we have a(2) = 1; but as 1! = 1 is already in the sequence, we extend it with a(3) = 2, the smallest integer not yet in the sequence; as 2! = 2 (being already in the sequence) we extend it with a(4) = 3; now as 3! = 6 in new, we immediately form a(5) = 6; as 6! = 720 we have a(6) = 720 and a(7) = 7! + 2! + 0! = 5040 + 2 + 1 = 5043; etc.
This technique allows us to get rid of all the loops of the kind mentioned in A308259.
MATHEMATICA
c[_] = 0; j = c[1] = 1; Array[Set[f[#], #!] &, 10, 0];
{1}~Join~Reap[Do[While[c[u] > 0, u++]; If[c[#] > 0, Set[k, u], Set[k, #]] &@ Total@ Map[f[#] &, IntegerDigits[j]]; Sow[k]; c[k] = i; j = k, {i, 2, 53}]][[-1, -1]] (* Michael De Vlieger, Feb 07 2022 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 07 2022
STATUS
approved