In a specified range, I want to get the number of numbers, in which sum of its digits and sum of squares of its digits are prime number. For an example from 2
to 12
, there are only 2
numbers which has both its sum of digit and sum of square of its digit are prime number. These two numbers are 11
and 12
. In 12
, sum of its digit 1+2=3
and sum of square of its digit 1+4=5
are prime numbers.
Although the question is related to programming but it seems that there must be some number theory trick which can solve it quickly. I am very keen to know that trick if at all exists. Thank you.
Is Sum of digits related with Sum of Squares of its digit
2
$\begingroup$
elementary-number-theory
-
3For your grammatical edification: "it's" is NOT possessive; "it's" is short for "it is", which is a complete sentence. "Its" is possessive, and should be used in every place you used "it's" here. (I could just edit, but "teach a man to fish...") – 2012-04-15
-
0@TheChaz: Thank you for the information. i have corrected it. If anywhere you find any grammatical mistakes, please let me know. :) – 2012-04-15
-
0The other two most common homophone mistakes are you're/your and they're/their/there. – 2012-04-15
-
2Discussed as a programming problem at http://codereview.stackexchange.com/questions/8319/puzzle-sum-of-the-digits-is-prime-or-not – 2012-04-16