A072081 Numbers divisible by the square of the sum of their digits in base 10.
1, 10, 20, 50, 81, 100, 112, 162, 200, 243, 324, 392, 400, 405, 500, 512, 605, 648, 810, 972, 1000, 1053, 1100, 1120, 1134, 1183, 1215, 1296, 1400, 1620, 1701, 1900, 1944, 2000, 2025, 2106, 2156, 2240, 2268, 2300, 2401, 2430, 2511, 2592, 2704, 2800, 2916
Offset: 1
Examples
k=9477, sumdigits(9477)=27, q=9477=27*27*13.
Links
- Donovan Johnson, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[k:k in [1..3000]| k mod &+Intseq(k)^2 eq 0]; // Marius A. Burtea, Mar 19 2020
-
Mathematica
sud[x_] := Apply[Plus, IntegerDigits[x]] Do[s=sud[n]^2; If[IntegerQ[n/s], Print[n]], {n, 1, 10000}] Select[Range[3000],Divisible[#,Total[IntegerDigits[#]]^2]&] (* Harvey P. Dale, May 04 2011 *)
-
PARI
for(n=1,10^4,s=sumdigits(n);if(!(n%s^2),print1(n,", "))) \\ Derek Orr, Apr 29 2015
-
Python
def ok(n): return n and n%sum(di for di in map(int, str(n)))**2 == 0 print([k for k in range(3000) if ok(k)]) # Michael S. Branicky, Jan 10 2025
Comments