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

 N Nine Nuance (Posted on 2016-01-29)
Determine the minimum value of a positive integer N > 2 such that:
the number 199...991, containing precisely N nines, is divisible by 1991.

 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 6 |
5   open "n9nuance.txt" for output as #2
10   Midpart=90:Ct9=1
20   Frontpart=100
30   while Done=0
40     N=Frontpart+Midpart+1
50     if N @ 1991=0 then
60        :if N>1991 then Done=1:print #2,N:endif
70     if Done then print Ct9
80     Frontpart=Frontpart*10
90     Midpart=(Midpart+9)*10:Ct9=Ct9+1
100   wend
110   close #2

finds 182 9's.

The number N is definitely 184 digits long, with 182 9's:

1999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999991

 Posted by Charlie on 2016-01-29 10:47:03

 Search: Search body:
Forums (0)