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

Home > Numbers
Child Play.. (Posted on 2009-08-07) Difficulty: 3 of 5
111111111....or maybe not! *

A version of "hopscotch" has this layout:

D G
A B C F
E H

Replace each of the letters with a unique digit from 0 to 9 such that you "hop" from one criterion to the next:
11111 AB is Prime,
11111 BCD is a Triangle,
11111 DEF is a Square and
11111 FGH is a Fibonacci number,
111111111111111 and none begin with a zero.

What 8-digit numbers are formed by this process?
What is significant about the highest and lowest?

* This can be logically deduced albeit a little time consuming.

See The Solution Submitted by brianjn    
No Rating

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

For curiosity's sake, the below program allows for leading zeros:

DIM prm$(24), fib$(10), tri$(99), squ$(32)
CLS

DATA 02,03,05,07,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97


FOR i = 1 TO 24: READ prm$(i):  NEXT
f = 0: a = 0: b = 1
DO
 c = a + b: a = b: b = c
 IF c > 9 AND c < 1000 THEN
   f = f + 1
   fib$(f) = RIGHT$("0" + LTRIM$(STR$(c)), 3): PRINT f, c
 END IF
LOOP UNTIL c > 1000
fibmax = f

t = 0: tot = 0
FOR i = 1 TO 200:
  tot = tot + i
  IF tot > 9 AND tot < 1000 THEN
   t = t + 1
   tri$(t) = RIGHT$("0" + LTRIM$(STR$(tot)), 3): PRINT t, tot
  END IF
NEXT
trimax = t

s = 0
FOR i = 1 TO 32:
  tot = i * i
  IF tot > 9 AND tot < 1000 AND (tot \ 10) MOD 10 <> tot MOD 10 THEN
   s = s + 1
   squ$(s) = RIGHT$("0" + LTRIM$(STR$(tot)), 3): PRINT s, tot
  END IF
NEXT
squmax = s

 

FOR p = 1 TO 24
 used(VAL(LEFT$(prm$(p), 1))) = 1
 used(VAL(RIGHT$(prm$(p), 1))) = 1
 FOR t = 1 TO trimax
   IF LEFT$(tri$(t), 1) = RIGHT$(prm$(p), 1) AND used(VAL(MID$(tri$(t), 2, 1))) = 0 AND used(VAL(RIGHT$(tri$(t), 1))) = 0 THEN
     used(VAL(LEFT$(tri$(t), 1))) = 1: used(VAL(RIGHT$(tri$(t), 1))) = 1
      used(VAL(MID$(tri$(t), 2, 1))) = 1
 FOR s = 1 TO squmax
   IF LEFT$(squ$(s), 1) = RIGHT$(tri$(t), 1) AND used(VAL(MID$(squ$(s), 2, 1))) = 0 AND used(VAL(RIGHT$(squ$(s), 1))) = 0 THEN
     used(VAL(LEFT$(squ$(s), 1))) = 1: used(VAL(RIGHT$(squ$(s), 1))) = 1
      used(VAL(MID$(squ$(s), 2, 1))) = 1
 FOR f = 1 TO fibmax
   IF LEFT$(fib$(f), 1) = RIGHT$(squ$(s), 1) AND used(VAL(MID$(fib$(f), 2, 1))) = 0 AND used(VAL(RIGHT$(fib$(f), 1))) = 0 THEN
     used(VAL(LEFT$(fib$(f), 1))) = 1: used(VAL(RIGHT$(fib$(f), 1))) = 1
      used(VAL(MID$(fib$(f), 2, 1))) = 1
     PRINT prm$(p); " "; tri$(t); " "; squ$(s); " "; fib$(f);
     IF LEFT$(fib$(f), 1) = "0" OR LEFT$(squ$(s), 1) = "0" OR LEFT$(tri$(t), 1) = "0" OR LEFT$(prm$(p), 1) = "0" THEN
       PRINT " *"
     ELSE
       PRINT
     END IF

     used(VAL(LEFT$(fib$(f), 1))) = 0: used(VAL(RIGHT$(fib$(f), 1))) = 0
      used(VAL(MID$(fib$(f), 2, 1))) = 0
   END IF
 NEXT
     used(VAL(LEFT$(squ$(s), 1))) = 0: used(VAL(RIGHT$(squ$(s), 1))) = 0
      used(VAL(MID$(squ$(s), 2, 1))) = 0
   END IF
 NEXT
     used(VAL(LEFT$(tri$(t), 1))) = 0: used(VAL(RIGHT$(tri$(t), 1))) = 0
      used(VAL(MID$(tri$(t), 2, 1))) = 0
   END IF
 NEXT
 used(VAL(LEFT$(prm$(p), 1))) = 0
 used(VAL(RIGHT$(prm$(p), 1))) = 0
NEXT
 

 


The results are:

02 231 169 987 *
02 253 361 144 *
03 351 169 987 *
13 300 049 987 *
23 300 049 987 *
23 300 081 144 *
23 351 169 987
29 903 361 144
29 990 081 144 *
31 105 529 987
31 120 049 987 *
41 105 529 987
43 325 576 610
43 351 169 987
53 300 049 987 *
53 300 081 144 *
59 903 361 144
59 990 081 144 *
61 105 529 987
61 120 049 987 *
73 300 081 144 *
79 903 361 144
79 990 081 144 *
83 325 576 610
89 903 361 144
89 946 676 610
97 703 361 144

where the * indicates one of the numbers has a leading zero.

The remaining 8-digit numbers are:

23516987
29036144
31052987
41052987
43257610
43516987
59036144
61052987
79036144
83257610
89036144
89467610
97036144

I don't know the significance of the lowest and highest of these.


  Posted by Charlie on 2009-08-07 13:55:09
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 (8)
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