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

 Geo Pyramid (Posted on 2008-12-16)
A figurate number stack is built using only the digits 0 through 9 exactly once.

Each tier is a figurate number of the order labelled; no number has a leading zero.

How many solutions can you offer?

 See The Solution Submitted by brianjn No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 4

The program below originally produced the following table in 2-digit triangle order, but I re-sorted it to be in order of the "unit" number.

I'm not sure what counts as a valid unit number, but what is shown is what is left after the triangular, square and pentagonal numbers use up all but one of the ten digits.

`1 78 324 95602 45 361 90872 91 784 63053 15 784 69023 21 784 95604 10 529 38764 28 169 53704 28 196 53704 28 961 53704 36 289 50174 78 169 20354 78 196 20354 78 961 20354 91 576 23806 15 324 90876 15 784 32906 91 784 20357 36 289 45107 45 169 23807 45 196 23807 45 961 23808 36 729 45109 21 784 63059 36 784 15209 36 784 25019 78 324 6501`

DIM t\$(81), s\$(81), p\$(81)
CLS
FOR n = 1 TO 81
tri = n * (n + 1) / 2
tr\$ = LTRIM\$(STR\$(tri))
sq = n * n
sq\$ = LTRIM\$(STR\$(sq))
pent = n * (3 * n - 1) / 2
pe\$ = LTRIM\$(STR\$(pent))
IF LEN(tr\$) = 1 THEN COLOR 12: PRINT tr\$; " "; : COLOR 7
IF LEN(sq\$) = 1 THEN COLOR 14: PRINT sq\$; " "; : COLOR 7
IF LEN(pe\$) = 1 THEN COLOR 10: PRINT pe\$; " "; : COLOR 7

IF LEN(tr\$) = 2 THEN
good = 1
FOR i = 1 TO LEN(tr\$) - 1
IF INSTR(i + 1, tr\$, MID\$(tr\$, i, 1)) THEN good = 0: EXIT FOR
NEXT
IF good THEN
tCt = tCt + 1
t\$(tCt) = tr\$
END IF
END IF
IF LEN(sq\$) = 3 THEN
good = 1
FOR i = 1 TO LEN(sq\$) - 1
IF INSTR(i + 1, sq\$, MID\$(sq\$, i, 1)) THEN good = 0: EXIT FOR
NEXT
IF good THEN
sCt = sCt + 1
s\$(sCt) = sq\$
END IF
END IF
IF LEN(pe\$) = 4 THEN
good = 1
FOR i = 1 TO LEN(pe\$) - 1
IF INSTR(i + 1, pe\$, MID\$(pe\$, i, 1)) THEN good = 0: EXIT FOR
NEXT
IF good THEN
pCt = pCt + 1
p\$(pCt) = pe\$
END IF
END IF
NEXT
PRINT
FOR i = 1 TO tCt: PRINT t\$(i); " "; : NEXT: PRINT
FOR i = 1 TO sCt: PRINT s\$(i); " "; : NEXT: PRINT
FOR i = 1 TO pCt: PRINT p\$(i); " "; : NEXT: PRINT

PRINT

FOR i = 1 TO tCt
FOR j = 1 TO sCt
FOR k = 1 TO pCt
o\$ = t\$(i) + s\$(j) + p\$(k)
good = 1
FOR l = 1 TO LEN(o\$) - 1
IF INSTR(l + 1, o\$, MID\$(o\$, l, 1)) THEN good = 0: EXIT FOR
NEXT
miss = 0
IF good THEN
FOR l = 1 TO 9
IF INSTR(o\$, LTRIM\$(STR\$(l))) = 0 THEN miss = l
NEXT
IF miss > 0 THEN
PRINT miss; t\$(i); " "; s\$(j); " "; p\$(k)
END IF
END IF
NEXT
NEXT
NEXT

The program also lists what the valid triangular, square and pentagonal numbers in the given ranges are:

10 15 21 28 36 45 78 91

169 196 256 289 324 361 529 576 625 729 784 841 961

1247 1426 1520 1820 1926 2035 2147 2380 2501 3015 3290 3725 3876 4187 4510 5017 5192 5370 6305 6501 6902 7315 7526 9087 9560 9801

 Posted by Charlie on 2008-12-16 17:53:55

 Search: Search body:
Forums (0)