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

Home > Numbers
The Last Three Digits (Posted on 2007-08-28) Difficulty: 3 of 5
A number and its square both have the same last three digits. What are the possibilities for those digits?

See The Solution Submitted by Brian Smith    
Rating: 4.0000 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re: No, a fuller List [part spoiler?] | Comment 5 of 9 |
(In reply to No, a fuller List [part spoiler?] by Vernon Lewis)

FOR i = 0 TO 999
    sq = i * i
    d1$ = RIGHT$("000" + LTRIM$(STR$(i)), 3)
    d$ = RIGHT$("000" + LTRIM$(STR$(sq)), 3)
    s$ = d$
    good = 1
    FOR j = 1 TO 3
      ix = INSTR(s$, MID$(d1$, j, 1))
      IF ix = 0 THEN
        good = 0
        EXIT FOR
      ELSE
        s$ = LEFT$(s$, ix - 1) + MID$(s$, ix + 1)
      END IF
    NEXT
    IF good THEN
     PRINT d1$, d$
    END IF
NEXT

 i            i^2 mod 1000
000           000
001           001
010           100
050           500
060           600
205           025
376           376
421           241
625           625
963           369

  Posted by Charlie on 2007-08-28 22:29: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 (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