cp's OEIS Frontend

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.

A375724 a(n) is the first Smith number with at least n digits.

This page as a plain text file.
%I A375724 #8 Aug 25 2024 13:29:32
%S A375724 4,22,121,1086,10086,100066,1000165,10000426,100000165,1000000165,
%T A375724 10000000165,100000000498,1000000000066,10000000000615,
%U A375724 100000000000786,1000000000000426,10000000000000246,100000000000000642,1000000000000000462,10000000000000000246,100000000000000000282,1000000000000000000966
%N A375724 a(n) is the first Smith number with at least n digits.
%C A375724 a(n) is the least composite k >= 10^(n-1) such that the sum of the decimal digits of k is equal to the sum of the decimal digits of the prime factors of k, counted with multiplicity.
%C A375724 Almost certainly a(n) has exactly n digits, but "at least" is included in the Name since we have no proof of that.
%e A375724 a(5) = 10086 because 10086 has digit-sum 15 and 10086 = 2 * 3 * 41^2 with 2 + 3 + (4 + 1) + (4 + 1) = 15, and no k from 10000 to 10085 works.
%p A375724 f:= proc(n) local t,x;
%p A375724     for x from 10^(n-1) do
%p A375724       if isprime(x) then next fi;
%p A375724       if convert(convert(x,base,10),`+`) = add(t[2]*convert(convert(t[1],base,10),`+`), t = ifactors(x)[2]) then return x fi;
%p A375724     od
%p A375724 end proc:
%p A375724 map(f, [$1..30]);
%o A375724 (Python)
%o A375724 from sympy import factorint
%o A375724 from itertools import count
%o A375724 def sd(n): return sum(map(int, str(n)))
%o A375724 def is_smith(n):
%o A375724     f = factorint(n)
%o A375724     return sum(f[p] for p in f) > 1 and sd(n) == sum(sd(p)*f[p] for p in f)
%o A375724 def a(n): return next(k for k in count(10**(n-1)) if is_smith(k))
%o A375724 print([a(n) for n in range(1, 23)]) # _Michael S. Branicky_, Aug 25 2024
%Y A375724 Cf. A006753.
%K A375724 nonn,base
%O A375724 1,1
%A A375724 _Robert Israel_, Aug 25 2024