A385656 Numbers k such that the sum of the decimal digits of k^2 divides k^2.
1, 2, 3, 6, 9, 10, 12, 15, 18, 20, 21, 24, 30, 36, 39, 42, 45, 48, 49, 51, 52, 54, 60, 63, 65, 66, 68, 72, 78, 80, 84, 88, 90, 96, 100, 102, 104, 105, 108, 110, 111, 112, 117, 120, 126, 132, 138, 140, 144, 148, 150, 156, 162, 168, 174, 180, 182, 190, 198, 200, 201, 204, 207
Offset: 1
Examples
15 is a term 15^2 = 225; digit sum of 225 = 2 + 2 + 5 = 9; 225 mod 9 = 0, so 15 is included. 18 is a term 18^2 = 324; digit sum of 324 = 3 + 2 + 4 = 9; 324 mod 9 = 0, so 16 is included.
Links
- Vighnesh Patil, Table of n, a(n) for n = 1..1000
Programs
-
Maple
digitSum := n -> add(i,i=convert(n, base, 10)): isok := n -> modp(n^2, digitSum(n^2)) = 0: select(isok, [$1..400])[];
-
Mathematica
DigitSum[n_] := Total[IntegerDigits[n]]; Select[Range[400], Mod[#^2, DigitSum[#^2]] == 0 &]
-
PARI
isok(k) = (k^2 % sumdigits(k^2)) == 0; \\ Michel Marcus, Jul 06 2025
-
Python
def digit_sum(n): return sum(int(d) for d in str(n)) def ok(n): return (n**2) % digit_sum(n**2) == 0 print([n for n in range(1, 1000) if ok(n)])
Formula
a(n) = sqrt(A118547(n)). - Michel Marcus, Jul 07 2025