OFFSET
0,6
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = 1 iff n belongs to A007091.
a(10*n) = a(n).
EXAMPLE
For n = 8:
- 1*8 = 8; computing 8 + 8 requires a carry,
- 2*8 = 16; computing 8 + 16 requires a carry,
- 3*8 = 24; computing 8 + 24 requires a carry,
- 4*8 = 32; computing 8 + 32 requires a carry,
- 5*8 = 40; computing 8 + 40 does not require a carry,
- so a(8) = 5.
PROG
(PARI) a(n, base = 10) = { for (k = 1, oo, if (sumdigits((k+1)*n, base) == sumdigits(n, base) + sumdigits(k*n, base), return (k); ); ); }
(Python)
from itertools import count
def A374735(n):
s = list(map(int, str(n)[::-1]))
return next(k for k in count(1) if all(a+b<=9 for a, b in zip(s, map(int, str(k*n)[::-1])))) # Chai Wah Wu, Jul 19 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Jul 18 2024
STATUS
approved