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 A086706 #22 Jun 25 2022 01:41:33 %S A086706 1,2,3,4,5,6,7,8,9,10,10,11,11,11,11,11,11,12,12,13,14,14,14,15,15,15, %T A086706 16,16,16,17,17,17,17,17,17,18,18,18,18,19,19,20,20,20,21,21,21,22,22, %U A086706 23,23,23,23,24,24,24,24,24,24,25,25,25,26,26,26,26,26,26,26,27,27,28 %N A086706 Number of Niven numbers less than or equal to n. %C A086706 Niven numbers are also known as harshad numbers. - _Harvey P. Dale_, May 20 2021 %H A086706 Harvey P. Dale, <a href="/A086706/b086706.txt">Table of n, a(n) for n = 1..1000</a> %H A086706 Jean-Marie De Koninck and Nicolas Doyon, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL6/Doyon/doyon.html">Large and Small Gaps Between Consecutive Niven Numbers</a>, J. Integer Seqs., Vol. 6, 2003, Article 03.2.5. %F A086706 a(n) = (c+o(1))*n/log(n) where c = 14/27*log(10) = 1.1939330111820977620834029765030036632.... %t A086706 Accumulate[Table[If[Divisible[n,Total[IntegerDigits[n]]],1,0],{n,80}]] (* _Harvey P. Dale_, May 20 2021 *) %o A086706 (PARI) %o A086706 s(k)=if(k<1,0,if(k%10,s(k-1)+1,s(k/10))); %o A086706 a(n)=sum(k=1,n,if(k%s(k),0,1)); %Y A086706 Cf. A005349. %Y A086706 Partial sums of A188641. %K A086706 nonn,base %O A086706 1,2 %A A086706 _Benoit Cloitre_, Jul 28 2003