OFFSET
1,2
COMMENTS
Niven (or Harshad) numbers are divisible by the sum of their digits, and correspond to sequence A005349.
LINKS
FORMULA
a(n) = n * A144261(n).
EXAMPLE
For n = 67, we have:
.
k 67*k Niven?
- ---- ------
1 67 No
2 134 No
3 201 Yes
so a(67) = 201.
MATHEMATICA
a[n_]:=Module[{k=1}, While[!Divisible[k*n, Total[IntegerDigits[k*n]]], k++]; k*n]; Array[a, 60]
PROG
(PARI) a(n, base=10) = forstep (m=n, oo, n, if (m%sumdigits(m, base)==0, return (m)))
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Oct 21 2022
STATUS
approved