OFFSET
0,3
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..3149
FORMULA
EXAMPLE
a(8) = 1, because A219666(8)=23, whose factorial base representation (A007623(23)) is '321', and A219666(7)=17, whose factorial base representation (A007623(17)) is '221', and they differ just in one digit position.
a(9) = 3, because A219666(9)=25, '...01001' in factorial base, which differs from '...0321' in three digit positions.
Note that A226061(4)=8 (A226061(n) tells the position of (n!)-1 in A219666), and 1+2+3 = 6 happens to be both a triangular number (A000217) and a factorial number (A000142).
The next time 1 occurs in this sequence because of this coincidence is at x=A226061(16) (whose value is currently not known), as at that point A219666(x) = 16!-1 = 20922789887999, whose factorial base representation is (15,14,13,12,11,10,9,8,7,6,5,4,3,2,1), and A000217(15) = 120 = A000142(5), which means that A219666(x-1) = A219651(20922789887999) = 20922789887879, whose factorial base representation is (15,14,13,12,11,10,9,8,7,6,4,4,3,2,1), which differs only in one position from the previous.
Of course 1's occur in this sequence for other reasons as well.
MATHEMATICA
nn = 1200; m = 1; While[m! < nn, m++]; m; f[n_] := IntegerDigits[n, MixedRadix[Reverse@ Range[2, m]]]; Join[{0}, 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@ # &, nn, # > 0 &], # <= 500 &]] (* Michael De Vlieger, Jun 27 2016, Version 10 *)
PROG
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Nov 10 2013
STATUS
approved