OFFSET
1,2
COMMENTS
Since the only prime Niven numbers are the single-digit primes 2, 3, 5 and 7, all the terms are 7-smooth numbers (A002473).
If k is a term, all the divisors of k are also terms. Since all the terms are 7-smooth, every term is of the form p * k, where p is in {2, 3, 5, 7} and k is a smaller term. Thus it is easy to verify that there are only 31 terms in this sequence, and 1944 being the last term.
EXAMPLE
6 is a term since all the divisors of 6, i.e., 1, 2, 3 and 6, are Niven numbers.
MATHEMATICA
nivenQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; allQ[n_] := AllTrue[Divisors[n], nivenQ]; p = {1, 2, 3, 5, 7}; s = {1}; n = 0; While[Length[s] != n, n = Length[s]; s = Select[Union @ Flatten @ Outer[Times, s, p], allQ]]; s
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Amiram Eldar, Sep 17 2020
STATUS
approved