OFFSET
1,2
COMMENTS
Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite.
REFERENCES
Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Curtis Cooper and Robert E. Kennedy, On consecutive Niven numbers, Fibonacci Quarterly, Vol. 21, No. 2 (1993), pp. 146-151.
Helen G. Grundman, Sequences of consecutive Niven numbers, Fibonacci Quarterly, Vol. 32, No. 2 (1994), pp. 174-175.
Wikipedia, Harshad number.
Brad Wilson, Construction of 2n consecutive n-Niven numbers, Fibonacci Quarterly, Vol. 35, No. 2 (1997), pp. 122-128.
FORMULA
EXAMPLE
131052 is a term since 131052 is divisible by 1 + 3 + 1 + 0 + 5 + 2 = 12, 131053 is divisible by 13, 131054 is divisible by 14, 131055 is divisible by 15, and 131056 is divisible by 16.
MATHEMATICA
nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; niv = nivenQ /@ Range[5]; seq = {}; Do[niv = Join[Rest[niv], {nivenQ[k]}]; If[And @@ niv, AppendTo[seq, k - 4]], {k, 5, 10^7}]; seq
SequencePosition[Table[If[Divisible[n, Total[IntegerDigits[n]]], 1, 0], {n, 10^7+200}], {1, 1, 1, 1, 1}][[;; , 1]] (* Harvey P. Dale, Dec 24 2023 *)
PROG
(Magma) f:=func<n|n mod &+Intseq(n) eq 0>; a:=[]; for k in [1..11000000] do if forall{m:m in [0..4]|f(k+m)} then Append(~a, k); end if; end for; a; // Marius A. Burtea, Jan 03 2020
(PARI) {first( N=50, LEN=5, L=List())= for(n=1, oo, n+=LEN; for(m=1, LEN, n--%sumdigits(n) && next(2)); listput(L, n); N--|| break); L} \\ M. F. Hasler, Jan 03 2022
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
Amiram Eldar, Jan 03 2020
STATUS
approved