Post Reply 
(35S) Ulam Spiral Programme
12-05-2014, 08:13 AM (This post was last modified: 02-12-2024 12:31 PM by Gerald H.)
Post: #1
(35S) Ulam Spiral Programme
For integer entry N > 1 the programme returns the two difficult non-diagonal neighbours of N

1 LBL U
2 STO N
3 4
4 *
5 2
6 -
7 IP(SQRT(REGX))
8 2*REGX
9 STO K
10 R↓
11 x<>y
12 4
13 -
14 SQRTx
15 IP
16 x<y?
17 -K►K
18 N-K+3
19 N+ABS(K)+5
20 RTN

The spiral begins

10 ....
09 2 3
08 1 4
07 6 5

So for entry 2 the programme returns 9 & 11.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)