My Profile

Keep Up to Date:
Blog RSS
Blog
Forum RSS
Forum
Post New Topic Post Reply
Posted 6 Months, 3 Weeks ago
JohnC
Senior Boarder
Posts: 67
graphgraph
User Offline
 
This is the second one of these puzzles I have posted. This one is not difficult; but the point of posting is to showcase some more possibilities regarding this kind of maze.

I think the maze works and has one solution.

Instructions: At each step you have an integer, n, which can change at each step. The goal is to get to the end of the maze successfully. (As with a computer program, if a conditional statement involves the value of n, the statement refers to the value before the line possibly changes it.)

1) start: n = 1 2) add or multiply by 2 3) add lowest prime > n 4) add or subtract 1 5) multiply by highest prime dividing n 6) subtract the number of positive divisors of n 7) if (n+1) is composite then dead-end. 8) divide by highest prime dividing n 9) add value of n gotten at line(2) (most recently) 10) if n <= 5 then go to line(n) 11) add or subtract highest prime dividing n 12) if 1 <= k <= 11 the go to line(n) 13) if n is a perfect square then dead-end. 14) finish (and n = ?)

(Of course, 'dead-end's are something to be avoided.)

And, yes, I will give the solution that I got in a few days if no one else gets it sooner.

The original maze is at: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8& threadm=b4be2fdf.0...

Thanks, Leroy Quet
The administrator has disabled public write access.
Posted 6 Months, 3 Weeks ago
124C41
Senior Boarder
Posts: 63
graphgraph
User Offline
 
n = 14
The administrator has disabled public write access.
Posted 6 Months, 3 Weeks ago
quest_marsman
Expert Boarder
Posts: 83
graphgraph
User Offline
 
s . . . . . . . p . . . . . . . o . . . . . . . i . . . . . . . l . . . . . . . e . . . . . . . r . . . . . . . This is a bit different to the other one in the fact that other solutions don't always end up as a dead end.. they just go round in infinite loops

1,2,5,6,18,12,4,6,9,11,22
The administrator has disabled public write access.
Posted 6 Months, 3 Weeks ago
ciproantib
Expert Boarder
Posts: 82
graphgraph
User Offline
 
'>' is not '<'. The lowest prime greater than 3 is 5, not 2, so solution goes haywire from here.

Someone else has already posted the solution I got.
The administrator has disabled public write access.
Posted 6 Months, 3 Weeks ago
MishaEE
Senior Boarder
Posts: 68
graphgraph
User Offline
 
lowest prime BIGGER than n is 5 and the other case gets us past this step too but we gets lots of infinite loop type things
The administrator has disabled public write access.
Posted 6 Months, 3 Weeks ago
klaretonor
Senior Boarder
Posts: 74
graphgraph
User Offline
 
Yes there is one solution, two deadends and three screaming loops - assuming that step 6 means all divisors not just proper divisors (and correcting the typo in step 12). If one, perhaps perversely, assumed only proper divisors the maze terminates at step 7. I was a bit disappointed that step 2 was only used once, since this added complexity - effectively adding another variable.

Programmers will recognise the algorithm maze as determining the possible paths and outcomes of a program, in general a difficult thing to do.

Here, although it is a simple program, it does have what were called in TWOTRAN (an old version of FORTRAN - (c) Eric Brunner) 'computational gotos', now in this PC age considered very harmful (RIP E Dijkstra).

Note that NOBOL (an old version of COBOL) had a kind of self-modifying ability in its 'IF ... THEN MODIFY x-999 TO GOTO y-876'. (COBOL liked to SHOUT its directives in those days of coding-sheets.)

What about adding this sort of most DIABOLical construct to the maze, eg:- 5) if n<6 then modify step 7 to be 'if n>5 then add or subtract 8'

This can of course be nested to many levels to achieve true amazement.

HTH
The administrator has disabled public write access.
Posted 6 Months, 3 Weeks ago
Pierre-Normand
Expert Boarder
Posts: 94
graphgraph
User Offline
 
I mean all positive divisors.

I was going to use the step-2 value more than once, I think. But I got lazy, finishing the maze when it was only half as long as I was going to make it originally. In any case, the reason for my post is to just showcase this particular basic idea behind such a maze existing only within the realm of abstraction.

And, yes, I got n = 22 as well.

Thanks, Leroy Quet
The administrator has disabled public write access.
 
Copyright © 2006 - Dec 2008 Fun Quizzes Club