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.
%I A141769 #35 Feb 16 2025 08:33:08 %S A141769 1,2,3,4,5,6,7,510,1014,2022,3030,10307,12102,12255,13110,60398,61215, %T A141769 93040,100302,101310,110175,122415,127533,131052,131053,196447,201102, %U A141769 202110,220335,223167,245725,255045,280824,306015,311232,318800,325600,372112,455422 %N A141769 Beginning of a run of 4 consecutive Niven (or Harshad) numbers. %C A141769 Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite. - _Amiram Eldar_, Jan 03 2020 %D A141769 Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110. %H A141769 Amiram Eldar, <a href="/A141769/b141769.txt">Table of n, a(n) for n = 1..10000</a> %H A141769 Curtis Cooper and Robert E. Kennedy, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/31-2/cooper.pdf">On consecutive Niven numbers</a>, Fibonacci Quarterly, Vol. 21, No. 2 (1993), pp. 146-151. %H A141769 Helen G. Grundman, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/32-2/grundman.pdf">Sequences of consecutive Niven numbers</a>, Fibonacci Quarterly, Vol. 32, No. 2 (1994), pp. 174-175. %H A141769 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HarshadNumber.html">Harshad Number</a>. %H A141769 Wikipedia, <a href="https://en.wikipedia.org/wiki/Harshad_number">Harshad number</a>. %H A141769 Brad Wilson <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/35-2/wilson.pdf">Construction of 2n consecutive n-Niven numbers</a>, Fibonacci Quarterly, Vol. 35, No. 2 (1997), pp. 122-128. %F A141769 This A141769 = { A005349(k) | A005349(k+3) = A005349(k)+3 }. - _M. F. Hasler_, Jan 03 2022 %e A141769 510 is in the sequence because 510, 511, 512 and 513 are all Niven numbers. %t A141769 nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; niv = nivenQ /@ Range[4]; seq = {}; Do[niv = Join[Rest[niv], {nivenQ[k]}]; If[And @@ niv, AppendTo[seq, k - 3]], {k, 4, 5*10^5}]; seq (* _Amiram Eldar_, Jan 03 2020 *) %o A141769 (Magma) f:=func<n|n mod &+Intseq(n) eq 0>; a:=[]; for k in [1..500000] do if forall{m:m in [0..3]|f(k+m)} then Append(~a,k); end if; end for; a; // _Marius A. Burtea_, Jan 03 2020 %o A141769 (PARI) {A141769_first( N=50, L=4, a=List())= for(n=1,oo, n+=L; for(m=1,L, n--%sumdigits(n) && next(2)); listput(a,n); N--|| break);a} \\ _M. F. Hasler_, Jan 03 2022 %o A141769 (Python) %o A141769 from itertools import count, islice %o A141769 def agen(): # generator of terms %o A141769 h1, h2, h3, h4 = 1, 2, 3, 4 %o A141769 while True: %o A141769 if h4 - h1 == 3: yield h1 %o A141769 h1, h2, h3, h4, = h2, h3, h4, next(k for k in count(h4+1) if k%sum(map(int, str(k))) == 0) %o A141769 print(list(islice(agen(), 40))) # _Michael S. Branicky_, Mar 17 2024 %Y A141769 Cf. A005349, A330927, A154701, A330928, A330929, A330930, A060159 (start of run of 1, 2, ..., 7, exactly n consecutive Harshad numbers). %Y A141769 Cf. A330933, A328211, A328215 (analog for base 2, Zeckendorf- resp. Fibonacci-Niven variants). %K A141769 base,nonn %O A141769 1,2 %A A141769 _Sergio Pimentel_, Sep 15 2008 %E A141769 More terms from _Amiram Eldar_, Jan 03 2020