login
A357866
a(n) is the greatest remainder of n divided by its sum of digits in any base > 1.
0
0, 0, 1, 0, 2, 0, 3, 2, 4, 2, 5, 2, 6, 4, 7, 4, 8, 4, 9, 6, 10, 6, 11, 6, 12, 8, 13, 8, 14, 8, 15, 10, 16, 10, 17, 10, 18, 12, 19, 12, 20, 12, 21, 14, 22, 14, 23, 14, 24, 16, 25, 16, 26, 16, 27, 18, 28, 18, 29, 18, 30, 20, 31, 20, 32, 20, 33, 22, 34, 22, 35
OFFSET
1,5
EXAMPLE
For n = 11, we have:
b sum of digits remainder
---- ------------- ---------
2 3 2
3 3 2
4 5 1
5 3 2
6 6 5
7 5 1
8 4 3
9 3 2
10 2 1
11 1 0
>=12 11 0
so a(11) = 5.
PROG
(PARI) a(n) = { my (mx=0); for (b=2, n, mx=max(mx, n%sumdigits(n, b))); return (mx); }
(Python)
from sympy.ntheory import digits
def a(n): return max((n%sum(digits(n, b)[1:]) for b in range(2, n+1)), default=0)
print([a(n) for n in range(1, 72)]) # Michael S. Branicky, Oct 17 2022
CROSSREFS
Sequence in context: A092915 A063749 A231333 * A331622 A212175 A370595
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 17 2022
STATUS
approved