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 A144261 #23 Feb 16 2025 08:33:09 %S A144261 1,1,1,1,1,1,1,1,1,1,10,1,9,3,2,3,6,1,6,1,1,5,9,1,2,6,1,3,9,1,12,6,4, %T A144261 3,2,1,3,3,3,1,10,1,12,3,1,5,9,1,8,1,2,3,18,1,2,2,2,9,9,1,12,6,1,3,3, %U A144261 2,3,3,3,1,18,1,7,3,2,2,4,2,9,1,1,5,18,1,6,6,3,3,9,1,4,5,4,9,2,2,12,4,2,1 %N A144261 a(n) = smallest k such that k*n is a Niven (or Harshad) number. %C A144261 Niven (or Harshad) numbers are numbers that are divisible by the sum of their digits. %C A144261 Does a(n) exist for all n? - _Klaus Brockhaus_, Sep 19 2008 %H A144261 David Radcliffe, <a href="/A144261/b144261.txt">Table of n, a(n) for n = 1..10000</a> %H A144261 David Radcliffe, <a href="/A144261/a144261.pdf">Every positive integer divides a Harshad number</a> %H A144261 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HarshadNumber.html">Harshad Number</a> %e A144261 a(14) = 3 since neither 1*14 or 2*14 are Niven numbers, but 3*14 = 42 is a Niven number: 42 = 7*(4+2). %t A144261 niv[n_]:=Module[{k=1},While[!Divisible[k*n,Total[IntegerDigits[ k*n]]], k++]; k]; Array[niv,100] (* _Harvey P. Dale_, Jul 23 2016 *) %o A144261 (PARI) digitsum(n) = {local(s=0); while(n, s+=n%10; n\=10); s} %o A144261 {for(n=1, 100, k=1; while((p=k*n)%digitsum(p)>0, k++); print1(k, ","))} /* _Klaus Brockhaus_, Sep 19 2008 */ %o A144261 (Python) %o A144261 from itertools import count %o A144261 def A144261(n): return next(filter(lambda k:not (m:=k*n) % sum(int(d) for d in str(m)), count(1))) # _Chai Wah Wu_, Nov 04 2022 %Y A144261 Cf. A005349 (Niven numbers), A144262 (smallest k such that k*n is not a Niven number), A144363 (records in A144261), A144364 (where records occur in A144261). %K A144261 base,nonn %O A144261 1,11 %A A144261 _Sergio Pimentel_, Sep 16 2008 %E A144261 Edited and extended by _Klaus Brockhaus_, Sep 19 2008