A336207 Lexicographically earliest sequence of nonnegative terms such that whenever a(k_1) = ... = a(k_m) with k_1 < ... < k_m, the sum k_1 + ... + k_m can be computed without carries in factorial base.
0, 0, 1, 2, 3, 0, 2, 0, 4, 5, 6, 1, 5, 4, 7, 8, 9, 3, 10, 11, 12, 13, 14, 0, 8, 1, 11, 10, 15, 0, 16, 7, 17, 16, 18, 2, 19, 17, 20, 21, 22, 15, 23, 24, 25, 26, 27, 0, 13, 12, 24, 19, 28, 1, 21, 20, 29, 30, 31, 6, 30, 29, 32, 33, 34, 28, 35, 36, 37, 38, 39, 2
Offset: 1
Examples
In factorial base: - 1 = "1", 2 = "10", 3 = "11", 4 = "20", - we can add without carry 1 and 2, so a(1) = a(2) = 0, - 1 + 2 + 3 implies a carry, so a(3) = 1, - 1 + 2 + 4 and 3 + 4 imply a carry, so a(4) = 2.
Links
Programs
-
C
See Links section.
Formula
a(n) = 0 iff n belongs to A279732.