login
A376314
Nonnegative numbers k with digital sum d such that any positive integer <= d is the sum of contiguous digits of k.
2
0, 1, 10, 11, 12, 21, 100, 101, 102, 110, 111, 112, 113, 120, 121, 122, 132, 201, 210, 211, 221, 231, 311, 1000, 1001, 1002, 1010, 1011, 1012, 1013, 1020, 1021, 1022, 1032, 1100, 1101, 1102, 1103, 1110, 1111, 1112, 1113, 1114, 1120, 1121, 1122, 1123, 1130
OFFSET
1,3
COMMENTS
If m is a term, then 10*m and 10*m + 1 are also terms.
LINKS
EXAMPLE
The number 2331 has digital sum 9 and belongs to the sequence as 1 = 1, 2 = 2, 3 = 3, 4 = 3+1, 5 = 2+3, 6 = 3+3, 7 = 3+3+1, 8 = 2+3+3, 9 = 2+3+3+1.
PROG
(PARI) is(n) = { my (r = concat(0, digits(n))); #setbinop((i, j) -> vecsum(r[i..j]), [1..#r])==vecsum(r)+1; }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 20 2024
STATUS
approved