OFFSET
1,2
COMMENTS
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..73
Eric Angelini, An ugly self-describing sequence.
E. Angelini, An ugly self-describing sequence [Cached copy, with permission]
E. Angelini et al., "Ugly digit sum", SeqFan mailing list, Jan 08 2009
EXAMPLE
Starting with a(1)=1, the next term a(2) > a(1) cannot be 2,...,9 (else the sum of these digits would be larger): the least possibility not leading to a contradiction is a(2)=10.
Then we can go on with a(3)=11, a(4)=12, but a(5) cannot be 13, the least possibility is a(5)=20.
PROG
(PARI) /* Note: This code checks only whether there is a contradiction for the given digits (1st arg), it does not ensure minimality. If the 2nd arg is nonzero, it dumps a list of all digits and partial sums. */
check_A154328(S=[1, 10, 11, 12, 20], dump=0)={
local(d=eval(Vec(concat(concat([""], S)))), t=0, ds=vector(#d, i, t+=d[i]));
dump && print(vector(#d, i, Str(i":"d[i]":"ds[i])));
for(i=1, #S, S[i]>#d && break; ds[S[i]]==S[i] || error("wrong at i=", i, ": [S[i], ds[S[i]]]=", [S[i], ds[S[i]]]));
print("no contradiction for terms <= "#d) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Jan 13 2009
STATUS
approved