login
A395817
Strictly increasing minimal sequence where consecutive terms can be added digit-by-digit without carrying in base 10.
1
1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 25, 30, 31, 32, 33, 34, 35, 40, 41, 42, 43, 44, 45, 50, 100, 101, 102, 103, 104, 105, 110, 111, 112, 113, 114, 115, 120, 121, 122, 123, 124, 125, 130, 131, 132, 133, 134, 135, 140, 141, 142, 143, 144
OFFSET
1,2
COMMENTS
Many integers (e.g., 6, 7, 8, 9, 15, 16...) are never present because the greedy behavior and the strictly increasing condition bypass them to avoid carries.
A subset of nonnegative integers with no decimal digits > 5 (A007092).
LINKS
FORMULA
a(1)=1; a(n) = min { x > a(n-1) | d_i(x) + d_i(a(n-1)) <= 9 }.
EXAMPLE
a(5) = 5 because a(4) = 4 and 4 is the smallest k such that 4 + k doesn't carry: 4 + 5 = 9 (no carry).
a(15) = 24 because a(14) = 23 and 24 is the smallest k such that 23 + k doesn't carry: 23 + 24 = 47 (no carry).
a(56) = 150 because a(55) = 144 and 150 is the smallest k such that 144 + k doesn't carry: 144 + 150 = 294 (no carry).
MATHEMATICA
s={1}; k=2; Do[While[Max[IntegerDigits[k]]>5||Max[IntegerDigits[s[[-1]]]+Take[IntegerDigits[k], -IntegerLength[s[[-1]]]]]> 9, k++]; AppendTo[s, k]; k++, {i, 58}]; s
PROG
(Python)
def has_carry(a, b):
while a or b:
if (a % 10) + (b % 10) > 9:
return True
a //= 10; b //= 10
return False
def sequence(n):
terms = [1]
while len(terms) < n:
k = terms[-1] + 1
while has_carry(terms[-1], k):
k += 1
terms.append(k)
return terms
CROSSREFS
Sequence in context: A391164 A037473 A007092 * A241213 A362931 A375514
KEYWORD
nonn,base
AUTHOR
STATUS
approved