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 A330927 #24 Jan 05 2025 19:51:41 %S A330927 1,2,3,4,5,6,7,8,9,20,80,110,111,132,152,200,209,224,399,407,440,480, %T A330927 510,511,512,629,644,735,800,803,935,999,1010,1011,1014,1015,1016, %U A330927 1100,1140,1160,1232,1274,1304,1386,1416,1455,1520,1547,1651,1679,1728,1853 %N A330927 Numbers k such that both k and k + 1 are Niven numbers. %C A330927 Cooper and Kennedy proved that there are infinitely many runs of 20 consecutive Niven numbers. Therefore this sequence is infinite. %D A330927 Jean-Marie De Koninck, Those Fascinating Numbers, American Mathematical Society, 2009, p. 36, entry 110. %H A330927 Amiram Eldar, <a href="/A330927/b330927.txt">Table of n, a(n) for n = 1..10000</a> %H A330927 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 A330927 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 A330927 Wikipedia, <a href="https://en.wikipedia.org/wiki/Harshad_number">Harshad number</a>. %H A330927 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. %e A330927 1 is a term since 1 and 1 + 1 = 2 are both Niven numbers. %t A330927 nivenQ[n_] := Divisible[n, Total @ IntegerDigits[n]]; nq1 = nivenQ[1]; seq = {}; Do[nq2 = nivenQ[k]; If[nq1 && nq2, AppendTo[seq, k - 1]]; nq1 = nq2, {k, 2, 2000}]; seq %t A330927 SequencePosition[Table[If[Divisible[n,Total[IntegerDigits[n]]],1,0],{n,2000}],{1,1}][[;;,1]] (* _Harvey P. Dale_, Dec 24 2023 *) %o A330927 (Magma) f:=func<n|n mod &+Intseq(n) eq 0>; a:=[]; for k in [1..2000] do if forall{m:m in [0..1]|f(k+m)} then Append(~a,k); end if; end for; a; // _Marius A. Burtea_, Jan 03 2020 %o A330927 (Python) %o A330927 from itertools import count, islice %o A330927 def agen(): # generator of terms %o A330927 h1, h2 = 1, 2 %o A330927 while True: %o A330927 if h2 - h1 == 1: yield h1 %o A330927 h1, h2 = h2, next(k for k in count(h2+1) if k%sum(map(int, str(k))) == 0) %o A330927 print(list(islice(agen(), 52))) # _Michael S. Branicky_, Mar 17 2024 %Y A330927 Cf. A005349, A060159, A141769, A154701, A328205, A328209, A328213, A330713, A330928, A330929, A330930, A330931. %K A330927 nonn,base %O A330927 1,2 %A A330927 _Amiram Eldar_, Jan 03 2020