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

Home > Numbers
15-Digits and Repunit Division (Posted on 2010-01-07) Difficulty: 3 of 5
Determine all possible value(s) of a 15-digit base ten positive integer N which is constituted entirely by the digits 2 and 3, such that N is divisible by the base ten repunit R7.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

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

DECLARE SUB build ()
DEFDBL A-Z
DIM SHARED dig(15), placeVal, psn, tot

placeVal = 100000000000000#: psn = 1

build

SUB build
 FOR d = 2 TO 3
  dig(psn) = d
  tot = tot + d * placeVal
  IF psn = 15 THEN
    q = INT(tot / 1111111)
    totMod = tot - q * 1111111
    IF totMod = 0 THEN
      FOR i = 1 TO 15
        PRINT dig(i);
      NEXT
      PRINT , q
    END IF
  ELSE
   psn = psn + 1: placeVal = placeVal / 10
   build
   psn = psn - 1: placeVal = placeVal * 10
  END IF
  tot = tot - d * placeVal
 NEXT
END SUB

finds

2  3  3  3  3  3  3  2  3  3  3  3  3  3  2             210000012

being the digits of the answer and the quotient upon dividing by 1111111.


  Posted by Charlie on 2010-01-07 15:57:38
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 (24)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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