A052020 Sum of digits of k is a prime proper factor of k.
12, 20, 21, 30, 50, 70, 102, 110, 111, 120, 133, 140, 200, 201, 209, 210, 230, 247, 300, 308, 320, 322, 364, 407, 410, 476, 481, 500, 506, 511, 605, 629, 700, 704, 715, 782, 803, 832, 874, 902, 935, 1002, 1010, 1011, 1015, 1020, 1040, 1066, 1088, 1100, 1101
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
filter:= proc(n) local s; s:= convert(convert(n,base,10),`+`); isprime(s) and (n mod s = 0) end proc: select(filter, [$10..10^4]); # Robert Israel, Feb 26 2017
-
Mathematica
Select[Range[0, 2000], With[{s = DigitSum[#]}, s < # && Divisible[#, s] && PrimeQ[s]] &] (* Paolo Xausa, May 18 2024 *)
-
Python
from sympy import isprime def ok(n): sd = sum(map(int, str(n))) return 1 < sd < n and n%sd == 0 and isprime(sd) print([k for k in range(1102) if ok(k)]) # Michael S. Branicky, Dec 20 2021
Comments