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

Home > Probability
(sod(x))^2 = x+2 (Posted on 2011-01-26) Difficulty: 3 of 5
Determine the probability that for a base ten positive integer x chosen at random from 1 to 9999 inclusively, this relationship is satisfied: (sod(x))2 = x+2, where sod(n) denotes the sum of the digits in the base ten representation of n.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution using QuickBasic | Comment 2 of 3 |

 denCt = 0
 Do
  ix = InStr(l$, ",")
  If ix Then
   denCt = denCt + 1: l$ = Mid(l$, ix + 1)
  Else
   denCt = denCt + 1
  End If
 Loop Until ix = 0
 ReDim den(denCt)
 l$ = txtDenom.Text
 denCt = 0
 Do
  ix = InStr(l$, ",")
  If ix Then
   denCt = denCt + 1: den(denCt) = Val(Left(l$, ix - 1))
   l$ = Mid(l$, ix + 1)
  Else
   denCt = denCt + 1: den(denCt) = Val(l$)
  End If
 Loop Until ix = 0

finds

2
23
62
119
194
287
398
7             7.000700070007001D-04       1428.428571428571

That is the list of 7 integers satisfying the relationship, and the probability of 0.00070007..., or 1/1428.428571428571....


  Posted by Charlie on 2011-01-26 15:37:33
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 (9)
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