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

Home > Numbers
Pandigital Squares II (Posted on 2008-03-15) Difficulty: 3 of 5
Adrian asked some friends to each make up a list of four perfect squares greater than zero, each having no more than four digits, that together use all ten digits exactly once.

Alice's and Brian's lists contained exactly two squares in common. Carol's list had no square in common with either Alice's or Brian's. David found a different set.

What was Carol's list and what was David's list?

  Submitted by Charlie    
Rating: 1.0000 (1 votes)
Solution: (Hide)
The only possible lists are:

1, 36, 784, 9025
9, 16, 784, 3025
9, 81, 324, 7056
9, 81, 576, 2304

Only the last two share two squares (9 and 81), so they must be Alice's and Brian's, but we don't know which is which.

The second list shares a number with those two, and so can't be Carol's list.

So Carol's list must be the first one, and David's is the second.

OPEN "squarely.txt" FOR OUTPUT AS #2
DIM sq(100)
FOR i = 1 TO 99
sq(i) = i * i
NEXT

FOR a = 1 TO 96
s1$ = LTRIM$(STR$(sq(a)))
FOR b = a + 1 TO 97
s2$ = s1$ + LTRIM$(STR$(sq(b)))
FOR c = b + 1 TO 98
s3$ = s2$ + LTRIM$(STR$(sq(c)))
IF LEN(s3$) >= 6 AND LEN(s3$) <= 9 THEN s4$ = s3$ + LTRIM$(STR$(sq(d)))
IF LEN(s4$) = 10 THEN
REDIM had(9): good = 1
FOR i = 1 TO 10
v = VAL(MID$(s4$, i, 1))
IF had(v) THEN good = 0: EXIT FOR
had(v) = 1
NEXT
IF good THEN
PRINT sq(a); sq(b); sq(c); sq(d)
PRINT #2, sq(a); sq(b); sq(c); sq(d)
END IF
END IF
NEXT
END IF
NEXT
NEXT
NEXT

Based on Enigma No. 1478, "Yours squarely", by Adrian Somerfield, New Scientist, 26 January 2008.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
AnswerK Sengupta2009-01-01 16:20:47
SolutionComputer solutionEigenray2008-03-17 01:28:10
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 (2)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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