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 A334527 #18 Mar 14 2025 10:46:56 %S A334527 4,27,378,576,588,645,648,666,690,825,915,1872,1908,1962,2265,2286, %T A334527 2484,2556,2688,2934,2970,3168,3258,3294,3345,3366,3390,3564,3615, %U A334527 3690,3852,3864,3930,4428,4464,4557,4880,5526,6084,6315,7695,8154,8736,8883,9015,9036 %N A334527 Numbers that are both Niven numbers and Smith numbers. %C A334527 McDaniel (1990) proved that there exist infinitely many numbers which are both base-b Niven numbers and base-b Smith numbers, for all bases b >= 8. %H A334527 Amiram Eldar, <a href="/A334527/b334527.txt">Table of n, a(n) for n = 1..10000</a> %H A334527 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_4">Smith Numbers</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 4, 127-157. %H A334527 Wayne L. McDaniel, <a href="https://doi.org/10.35834/1990/0203132">On the Intersection of the Sets of Base b Smith Numbers and Niven Numbers</a>, Missouri Journal of Mathematical Sciences, Vol. 2, No. 3 (1990), pp. 132-136. %e A334527 27 is a term since it is a Niven number (2 + 7 = 9 is a divisor of 27) and a Smith number (27 = 3 * 3 * 3 and 2 + 7 = 3 + 3 + 3). %t A334527 digSum[n_] := Plus @@ IntegerDigits[n]; nivenSmithQ[n_] := Divisible[n, (ds = digSum[n])] && CompositeQ[n] && Plus @@ (Last@# * digSum[First@#] & /@ FactorInteger[n]) == ds; Select[Range[10^4], nivenSmithQ] %o A334527 (Python) %o A334527 from sympy import factorint %o A334527 def sd(n): return sum(map(int, str(n))) %o A334527 def ok(n): %o A334527 sdn = sd(n) %o A334527 if sdn == 0 or n%sdn != 0: return False # not Niven %o A334527 f = factorint(n) %o A334527 return sum(f[p] for p in f) > 1 and sdn == sum(sd(p)*f[p] for p in f) %o A334527 print(list(filter(ok, range(9999)))) # _Michael S. Branicky_, Apr 27 2021 %Y A334527 Intersection of A005349 and A006753. %K A334527 nonn,base %O A334527 1,1 %A A334527 _Amiram Eldar_, May 05 2020