Determine all (non leading zero) 3-digit positive integers n such that the sum of squares of digits of n is precisely one-third of n.
just one:
267 4 + 36 + 49 = 89
program is here.
Adding a couple of lines of code gives the result for other divisors. I wonder if there is an analytic approach... It seems messy.
divisor: 2 298 4 + 81 + 64 = 149
divisor: 3 267 4 + 36 + 49 = 89
divisor: 4 376 9 + 49 + 36 = 94
divisor: 6 372 9 + 49 + 4 = 62
divisor: 6 480 16 + 64 + 0 = 80
divisor: 7 133 1 + 9 + 9 = 19
divisor: 7 917 81 + 1 + 49 = 131
divisor: 7 973 81 + 49 + 9 = 139
divisor: 8 360 9 + 36 + 0 = 45
divisor: 9 315 9 + 1 + 25 = 35
divisor: 11 550 25 + 25 + 0 = 50
divisor: 11 803 64 + 0 + 9 = 73
divisor: 12 240 4 + 16 + 0 = 20
divisor: 13 130 1 + 9 + 0 = 10
divisor: 14 532 25 + 9 + 4 = 38
divisor: 14 630 36 + 9 + 0 = 45
divisor: 20 500 25 + 0 + 0 = 25
divisor: 21 420 16 + 4 + 0 = 20
divisor: 24 120 1 + 4 + 0 = 5
divisor: 25 400 16 + 0 + 0 = 16
divisor: 31 310 9 + 1 + 0 = 10
divisor: 37 111 1 + 1 + 1 = 3
divisor: 42 210 4 + 1 + 0 = 5
divisor: 50 200 4 + 0 + 0 = 4
divisor: 55 110 1 + 1 + 0 = 2
divisor: 100 100 1 + 0 + 0 = 1
lord@rabbit 12780 %
Edited on November 13, 2022, 10:27 am