Think logically not mathematically [part-27]

Logic Level 2

How many numbers between 11 to 99 have the sum of their digits a square number?


The answer is 16.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Brandon Monsen
Oct 30, 2015

Since the digits of a number have to be from 0-9, the sum of the digits have to be between 0 and 18. The perfect squares between 0 and 18 are 0,1,4,9, and 16.

Due to the constraints of our two digit number being between 11 and 99, we can ignore 0 and 1 as sums of digits, since the largest value we can get for a two digit number would be 10.

For 4, there is 40, 22, 31, and 13

If the sum of the digits add up to 9, the number is a multiple of 9, so we have 11 multiples of 9 up to 99, but the sum of the digits of 99 add up to 18, which isn't a perfect square, and 9 is less than 11, so we have 9 total.

For 16, theres 88, 97, and 79,

Since we have covered every possible sum of digits to produce a perfect square, now we just have to count them.

4+3+9= 16 \boxed{16}

Adhiraj Dutta
Apr 15, 2020
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
int main()
{ int n, k=0;
for(int i=1;i<10;i++)
{
   for(int j=0;j<10;j++)
   {  n=i+j;
      if (n==4)
          { std::cout<<10*i+j<<"\n";
             k++; }
      else if (n==9)
                  { std::cout<<10*i+j<<"\n";
                    k++; }
      else if (n==16)
                   { std::cout<<10*i+j<<"\n";
                     k++; }
     }
}
std::cout<<"Total number of such numbers = "<<k;
return 0;
}

13

18

22

27

31

36

40

45

54

63

72

79

81

88

90

97

Total number of such numbers = 16

PS: don't judge my pathetic code. I'm a noob -.-

Adhiraj Dutta - 1 year, 2 months ago
John Wyatt
Dec 23, 2015

MIN : 1+1=2 MAX = 9+9 = 18

Square numbers between 2 & 18 :4,9,16

4 = 4+0, 3+1, 2+2 9 = 9+0, 8+1, 7+2, 6+3, 5+4 16= 9+7, 8+8,

40 13 31 22 / 90 81 18 27 72 36 63 45 54 / 97 79 88 ==> 16 Numbers

missed by one .

Raven Herd - 5 years, 5 months ago

I got that right...but i think answer should also be different. For example→ 32 = 3 + 2 = 5 32=3+2=5 ....Can also be written as ( 5 ) 2 (\sqrt{5})^{2} ...The question does not mention any particular no.

Yeah.Your comment is right.The question must be mentioned as "It must be a square of a positive integer"

Vishal S - 5 years, 7 months ago
Sudoku Subbu
Oct 10, 2015

The possible square numbers are 4,9,16. Because sum of and to digits is always less than or equal to 18,since maximum possible sum is 9+9=18. So, now the possible numbers are 13,22,31,40 as a sum of 4,and 18,27,36,45,54,63,72,81,90 as a sum of 9 and 79,97 as a sum of 16. So the total possible numbers are 15.

I think the answer is wrong. There are 16 numbers whose sum of digits is a square. You missed 88 while enumerating as pointed out by Steven Tan Yee Hern

Guru 2691 - 5 years, 8 months ago

Log in to reply

Yeah you are right I got lucky to hit answer 15 15 AT LAST.

Department 8 - 5 years, 8 months ago

How about 88?

Steven Tan Yee Hern - 5 years, 8 months ago

Wrong answer, everyone report this problem.

Kushagra Sahni - 5 years, 8 months ago

Log in to reply

Yeah the answer should be 16

Satyajit Ghosh - 5 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...