login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A351842 Numbers whose sum of digits and number of proper divisors are equal. 0
21, 32, 50, 70, 111, 162, 168, 201, 212, 232, 250, 308, 322, 380, 384, 405, 416, 430, 456, 546, 610, 650, 690, 740, 744, 812, 832, 870, 980, 1004, 1011, 1015, 1053, 1101, 1105, 1222, 1316, 1352, 1365, 1460, 1464, 1482, 1510, 1518, 1550, 1554, 1590, 1608, 1752 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
21 is a term since its digits sum to 2 + 1 = 3 and it has three proper divisors (1, 3, and 7).
MAPLE
S := n -> add(convert(n, base, 10)):
PD := n -> nops(NumberTheory[Divisors](n)) - 1:
a := n -> select(x -> S(x) = PD(x), [seq(1..n)])
MATHEMATICA
Select[Range[1, 1700], Total[IntegerDigits[#]] == Length[Divisors[#]] - 1 &]
PROG
(Python)
from sympy import divisor_count
def ok(n): return sum(map(int, str(n))) == divisor_count(n) - 1
print([k for k in range(1753) if ok(k)]) # Michael S. Branicky, Feb 21 2022
(PARI) isok(m) = sumdigits(m) == numdiv(m) - 1; \\ Michel Marcus, Feb 21 2022
(PARI) list(nn) = forcomposite(n=1, nn, if (sumdigits(n) == (numdiv(n) - 1), print1(n, ", ")));
list(1700);
CROSSREFS
Sequence in context: A319477 A035137 A261910 * A075110 A219684 A219881
KEYWORD
nonn,base
AUTHOR
Zdenek Cervenka, Feb 21 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 19 17:46 EDT 2024. Contains 375310 sequences. (Running on oeis4.)