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

Home > Numbers
123456 (Posted on 2005-07-04) Difficulty: 2 of 5
What six digit number added to itself five times will give a sum each time having the same 6 digits as the original number?

(It's not 000000.)

See The Solution Submitted by Erik O.    
Rating: 3.4000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): Trial and Error | Comment 8 of 21 |
(In reply to re: Trial and Error by Old Original Oskar!)

Revised version looks at all possibilities, including repeated digits:

DEFLNG A-Z
FOR d1 = 1 TO 9
 used(d1) = used(d1) + 1
 t1 = d1 * 100000
FOR d2 = 0 TO 9
  used(d2) = used(d2) + 1
  t2 = t1 + d2 * 10000
FOR d3 = 0 TO 9
  used(d3) = used(d3) + 1
  t3 = t2 + d3 * 1000
FOR d4 = 0 TO 9
  used(d4) = used(d4) + 1
  t4 = t3 + d4 * 100
FOR d5 = 0 TO 9
  used(d5) = used(d5) + 1
  t5 = t4 + d5 * 10
FOR d6 = 0 TO 9
  used(d6) = used(d6) + 1
  t6 = t5 + d6

  t = t6
  FOR i = 1 TO 5
    t = t + t6
    flag = 1: t$ = LTRIM$(STR$(t))
    REDIM u2(9)
    FOR j = 1 TO LEN(t$)
     d = VAL(MID$(t$, j, 1))
     u2(d) = u2(d) + 1
    NEXT j
    FOR j = 0 TO 9
      IF u2(j) <> used(j) THEN flag = 0: EXIT FOR
    NEXT j
    IF flag = 0 THEN EXIT FOR
  NEXT i
  IF flag THEN PRINT t6

  used(d6) = used(d6) - 1
NEXT d6
  used(d5) = used(d5) - 1
NEXT d5
  used(d4) = used(d4) - 1
NEXT d4
  used(d3) = used(d3) - 1
NEXT d3
  used(d2) = used(d2) - 1
NEXT d2
  used(d1) = used(d1) - 1
NEXT d1

and still finds only the one answer.


  Posted by Charlie on 2005-07-05 13:30:19
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 (3)
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