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

Home > Numbers
Square Birthdays (Posted on 2007-11-29) Difficulty: 3 of 5
A date can be written as DD/MM/YY, so that for example 01/08/16 means 1 August 1916. But if you concatenate just the digits, 010816 happens to be a perfect square, as it is 104². Call such a day a "square day".

Adrian's grandfather was one of six cousins born on different square days in the same year, which was a leap year in the 20th century. All of them died on square days in leap years, and none of them lived to see age 99. Each of them except Adrian's grandfather died in the same month as his or her birthday.

What was Adrian's grandfather's date of birth?

See The Solution Submitted by Charlie    
Rating: 3.3333 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Some Unanswered Questions | Comment 2 of 7 |
I concur with Dej Mar but had a different journey to get there (and a different journey to post this comment)
Program written below produces these two data lists.

The second is an alphabetical listing of the first.
From that list it is relatively easy to pinpoint years
and other dates. 

One must note however that  "00" actually refers to
"2000"; the program is not attentive to that detail.

Contents of "sqdaylst.txt"
04 102010404 1
16 104010816 2
36 106011236 3
64 142020164 4
36 144020736 5
76 174030276 6
76 176030976 7
04 202040804 8
76 224050176 9
76 226051076 10
16 246060516 11
56 266070756 12
56 284080656 13
04 302091204 14
24 318101124 15
24 332110224 16
04 348121104 17
44 362131044 18
44 388150544 19
04 448200704 20
00 470220900 21
00 480230400 22
00 490240100 23
00 510260100 24
00 520270400 25
00 530280900 26
04 548300304 27

Compilation after "alphalst.txt"  but duly edited
to indicate solution.  "04" occurs 6 times, thus
the birth year.
Different colours match the birth-death months.
Note that some potential death dates occur more
than once, and there are several dates not
addressed; Charlie had to ask the right question!

My solution? Yes, it is there.
00 470 220900 21
00 480 230400 22
00 490 240100 23
00 510 260100 24
00 520 270400 25
00 530 280900 26
04 102 010404  1
04 202 040804  8
04 302 091204 14
04 348 121104 17
04 448 200704 20
04 548 300304 27
16 104 010816  2
16 246 060516 11
24 318 101124 15
24 332 110224 16
36 106 011236  3
36 144 020736  5
44 362 131044 18
44 388 150544 19
56 266 070756 12
56 284 080656 13
64 142 020164  4
76 174 030276  6
76 176 030976  7
76 224 050176  9
76 226 051076 10

DIM SHARED leap$(50)CLSOPEN "sqdaylst.txt" FOR OUTPUT AS #1

d = 1

FOR a = 0 TO 9
FOR b = 0 TO 9
FOR c = 0 TO 9

x = 100 * a + 10 * b + c

Y = x * xAnniv$ = LTRIM$(STR$(Y))

IF LEN(Anniv$) = 5 THEN Anniv$ = "0"
+ Anniv$year$ = RIGHT$(Anniv$, 2)Month$
= MID$(Anniv$, 3, 2)Day$ = LEFT$(Anniv$, 2)

'Validate data and then print

IF ((x > 99 AND INT(VAL(year$) / 4) = VAL(year$) / 4)
AND (VAL(Month$) > 0 AND VAL(Month$) < 13)
AND VAL(Day$) < 32) THEN
x$ = STR$(x)

d$ = STR$(d)

PRINT year$; x$; " "; Anniv$; d$ 'Screen view

PRINT #1, year$; x$; Anniv$; d$  'Save to disk

d = d + 1

END IF

NEXT  'c
NEXT  'b
NEXT  'a
CLOSE     

n = 0   

OPEN "sqdaylst.txt" FOR INPUT AS #1 
 
DO       
LINE INPUT #1, leap$(n)    
          
n = n + 1           

LOOP UNTIL (EOF(1))   

CLOSE   

PRINT

'Bubble Sort
FOR i = 0 TO n - 1  
FOR j = 0 TO n - i - 1    

IF leap$(j + 1) < leap$(j) THEN      
Temp$ = leap$(j)      
leap$(j) = leap$(j + 1)      
leap$(j + 1) = Temp$    
END IF  
NEXT
NEXT

OPEN "alphalst.txt" FOR OUTPUT AS #1

FOR p = 0 TO n 
  
year$ = LEFT$(leap$(p), 2)    
x$ = MID$(leap$(p), 3, 4)    
Anniv$ = MID$(leap$(p), 7, 6)    
d$ = RIGHT$(leap$(p), 2)    
PRINT year$; x$; " "; Anniv$; " "; d$ 'rearranged data    
PRINT #1, year$; x$; " "; Anniv$; " "; d$

NEXT
CLOSE


Edited on November 29, 2007, 9:17 pm

Edited on November 29, 2007, 9:23 pm
  Posted by brianjn on 2007-11-29 17:34:36

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 (13)
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