Talk:Henry Ernest Dudeney/Puzzles and Curious Problems/83 - Three Different Digits/Solution
Jump to navigation
Jump to search
Code:
#include <stdio.h> int main() { for (int i = 100; i < 1000; i++) { int a = i / 100; int b = (i / 10) % 10; int c = i % 10; if (a != b && b != c && c!= a && i % ((a + b + c)*(a + b + c)) == 0) printf("%d, ", i); } }
Output:
162, 243, 324, 392, 405, 512, 605, 648, 810, 972,
Alternately, refer to OEIS: A072081 for a list of numbers divisible by the square of the sum of their digits in base 10, repetition included, however.
--RandomUndergrad (talk) 12:29, 20 January 2022 (UTC)
- That's a worthy precedent. I have taken the opportunity to put this live. Thanks. --prime mover (talk) 17:01, 20 January 2022 (UTC)