All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Sum Divisors - 1 = Number (Posted on 2010-12-16) Difficulty: 3 of 5
Determine all possible values of a positive integer P, such that P-1 has three divisors Q, R and S, with Q < R < S, such that: Q + R + S = P

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Computer solution Comment 3 of 3 |
I have written this program in java.

pubblic class Divisors
{
void main()
{
int a.b,c,ans;
for (int i=2;;i++)
    {
     for(int j=1;j<=i-1;j++)
         {
          if((i-1)%j==0)
              {
               a=j;
               for(int k=1;k<=i-1;k++)
                   {
                    if((i-1)%k==0)
                        {
                         b=k;
                         for(int l=1;l<=i-1;l++)
                             {
                              if((i-1)%l==0)
                                  {
                                  c=l;
                                  if((a+b+c)==i)
                                      {ans=i;break;}
                                   }
                              }
                          }
                     }
                 }
             }
       }
Syatem.out.print("The value of P is "+ans);
}
}

So this program gives the valus of P to be 13.


  Posted by Danish Ahmed Khan on 2012-10-26 06:29:02
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information