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.

A357936 a(n) is the least multiple of n that is a Niven (or Harshad) number.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 110, 12, 117, 42, 30, 48, 102, 18, 114, 20, 21, 110, 207, 24, 50, 156, 27, 84, 261, 30, 372, 192, 132, 102, 70, 36, 111, 114, 117, 40, 410, 42, 516, 132, 45, 230, 423, 48, 392, 50, 102, 156, 954, 54, 110, 112, 114, 522, 531, 60
Offset: 1

Views

Author

Rémy Sigrist, Oct 21 2022

Keywords

Comments

Niven (or Harshad) numbers are divisible by the sum of their digits, and correspond to sequence A005349.

Examples

			For n = 67, we have:
.
      k  67*k  Niven?
      -  ----  ------
      1    67  No
      2   134  No
      3   201  Yes
so a(67) = 201.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{k=1}, While[!Divisible[k*n, Total[IntegerDigits[k*n]]], k++]; k*n]; Array[a, 60]
  • PARI
    a(n, base=10) = forstep (m=n, oo, n, if (m%sumdigits(m, base)==0, return (m)))

Formula

a(n) = n * A144261(n).