cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A357866 a(n) is the greatest remainder of n divided by its sum of digits in any base > 1.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 17 2022

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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