login
A364274
Lexicographically earliest sequence of distinct positive terms such that the cumulative sum Q(n) of the first n terms of the sequence has distinct digits.
1
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 10, 13, 14, 15, 16, 17, 19, 18, 20, 21, 22, 23, 25, 24, 26, 27, 28, 29, 30, 31, 32, 33, 35, 34, 40, 36, 37, 38, 39, 41, 42, 43, 77, 44, 136, 45, 46, 48, 47, 49, 51, 50, 53, 55, 56, 57, 60, 52, 54, 58, 59, 61, 63, 134, 64, 65, 66, 67, 68
OFFSET
1,2
COMMENTS
The sequence is finite, as Q(n) cannot be > 9876543210. What is the last term of the sequence?
EXAMPLE
a(9) = 9 and Q(9) = 45;
a(10) = 11 and Q(10) = 56: a(10) cannot = 10 as Q(10) would = 55;
a(11) = 12 and Q(11) = 68: a(11) cannot = 10 as Q(11) would = 66;
a(12) = 10 and Q(12) = 78;
a(13) = 13 and Q(13) = 91; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=(k=1; While[!DuplicateFreeQ@IntegerDigits@ Total[Join[c=Array[a, n-1], {k}]]||MemberQ[c, k], k++]; k); Array[a, 70] (* Giorgos Kalogeropoulos, Jul 19 2023 *)
CROSSREFS
Cf. A364275.
Sequence in context: A256755 A045876 A033865 * A118764 A226134 A057717
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Jul 17 2023
STATUS
approved