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 A351842 #30 Feb 26 2022 09:23:21 %S A351842 21,32,50,70,111,162,168,201,212,232,250,308,322,380,384,405,416,430, %T A351842 456,546,610,650,690,740,744,812,832,870,980,1004,1011,1015,1053,1101, %U A351842 1105,1222,1316,1352,1365,1460,1464,1482,1510,1518,1550,1554,1590,1608,1752 %N A351842 Numbers whose sum of digits and number of proper divisors are equal. %e A351842 21 is a term since its digits sum to 2 + 1 = 3 and it has three proper divisors (1, 3, and 7). %p A351842 S := n -> add(convert(n, base, 10)): %p A351842 PD := n -> nops(NumberTheory[Divisors](n)) - 1: %p A351842 a := n -> select(x -> S(x) = PD(x), [seq(1..n)]) %t A351842 Select[Range[1, 1700], Total[IntegerDigits[#]] == Length[Divisors[#]] - 1 &] %o A351842 (Python) %o A351842 from sympy import divisor_count %o A351842 def ok(n): return sum(map(int, str(n))) == divisor_count(n) - 1 %o A351842 print([k for k in range(1753) if ok(k)]) # _Michael S. Branicky_, Feb 21 2022 %o A351842 (PARI) isok(m) = sumdigits(m) == numdiv(m) - 1; \\ _Michel Marcus_, Feb 21 2022 %o A351842 (PARI) list(nn) = forcomposite(n=1, nn, if (sumdigits(n) == (numdiv(n) - 1), print1(n, ", "))); %o A351842 list(1700); %Y A351842 Cf. A007953, A032741, A057531. %K A351842 nonn,base %O A351842 1,1 %A A351842 _Zdenek Cervenka_, Feb 21 2022