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

 Fair and Square (Posted on 2003-11-03)
Jack and Jill each have marble collections. The number in Jack's collection in a square number.

Jack says to Jill, "If you give me all your marbles I'll still have a square number." Jill replies, "Or, if you gave me the number in my collection you would still be left left with an even square."

What is the fewest number of marbles Jack could have?

 See The Solution Submitted by Ravi Raja Rating: 2.3333 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Fuller Solution | Comment 21 of 23 |
(In reply to Fuller Solution by DJ)

More solutions in order of the number that Jack started out with can be gotten just by trying out the squares in sequence and within each square subtracting and adding up to the number available in Jack's possession. In tabular form showing x-y, x, x+y and y:

```
1             25            49            24

4             100           196           96

49            169           289           120

9             225           441           216

49            289           529           240

16            400           784           384

289           625           961           336

25            625           1225          600

196           676           1156          480

1             841           1681          840

36            900           1764          864

196           1156          2116          960

49            1225          2401          1176

529           1369          2209          840

441           1521          2601          1080

64            1600          3136          1536

961           1681          2401          720

81            2025          3969          1944

1156          2500          3844          1344

100           2500          4900          2400

441           2601          4761          2160

784           2704          4624          1920

289           2809          5329          2520

121           3025          5929          2904

4             3364          6724          3360

144           3600          7056          3456

2401          3721          5041          1320

2209          4225          6241          2016

1225          4225          7225          3000

529           4225          7921          3696

169           4225          8281          4056

784           4624          8464          3840

196           4900          9604          4704

49            5329          10609         5280

2116          5476          8836          3360

2601          5625          8649          3024

225           5625          11025         5400

1764          6084          10404         4320

256           6400          12544         6144

3844          6724          9604          2880

5041          7225          9409          2184

1681          7225          12769         5544

1225          7225          13225         6000

289           7225          14161         6936

9             7569          15129         7560

1681          7921          14161         6240

324           8100          15876         7776

2401          8281          14161         5880

361           9025          17689         8664

49            9409          18769         9360

4624          10000         15376         5376

400           10000         19600         9600

6241          10201         14161         3960

1764          10404         19044         8640

3136          10816         18496         7680

441           11025         21609         10584

1156          11236         21316         10080

961           11881         22801         10920

484           12100         23716         11616

4761          12321         19881         7560

9409          12769         16129         3360

529           13225         25921         12696

16            13456         26896         13440

3969          13689         23409         9720

2401          14161         25921         11760

576           14400         28224         13824

9604          14884         20164         5280

8649          15129         21609         6480

7225          15625         24025         8400

5329          15625         25921         10296

625           15625         30625         15000

8836          16900         24964         8064

4900          16900         28900         12000

2116          16900         31684         14784

676           16900         33124         16224

729           18225         35721         17496

3136          18496         33856         15360

289           18769         37249         18480

784           19600         38416         18816

5929          20449         34969         14520

16129         21025         25921         4896

14161         21025         27889         6864

841           21025         41209         20184

25            21025         42025         21000

196           21316         42436         21120

8464          21904         35344         13440

7921          22201         36481         14280

10404         22500         34596         12096

900           22500         44100         21600

3969          23409         42849         19440

961           24025         47089         23064

7056          24336         41616         17280

2209          24649         47089         22440

2601          25281         47961         22680

1024          25600         50176         24576

15376         26896         38416         11520

1089          27225         53361         26136

8281          28561         48841         20280

1             28561         57121         28560

20164         28900         37636         8736

6724          28900         51076         22176

4900          28900         52900         24000

1156          28900         56644         27744

12769         29929         47089         17160

36            30276         60516         30240

14161         30625         47089         16464

1225          30625         60025         29400

6724          31684         56644         24960

1296          32400         63504         31104

25921         32761         39601         6840

9604          33124         56644         23520

21609         33489         45369         11880

14161         34225         54289         20064

13225         34225         55225         21000

2401          34225         66049         31824

1369          34225         67081         32856

5929          34969         64009         29040

1444          36100         70756         34656

5329          37249         69169         31920

196           37636         75076         37440

```

........
The program:
DEFDBL A-Z
DO
n = n + 1
nsq = n * n
FOR i = 1 TO nsq
tr = nsq - i
trl = INT(SQR(tr) + .5)
IF trl * trl = tr THEN
tr = nsq + i
trl = INT(SQR(tr) + .5)
IF trl * trl = tr THEN
PRINT nsq - i, nsq, nsq + i, i
ct = ct + 1
IF ct MOD 40 = 0 THEN DO: LOOP UNTIL INKEY\$ > ""
END IF
END IF
NEXT
LOOP

 Posted by Charlie on 2003-11-03 22:09:37

 Search: Search body:
Forums (0)