Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Yellowstone-sequence/Arturo/yellowstone-sequence.arturo
Normal file
24
Task/Yellowstone-sequence/Arturo/yellowstone-sequence.arturo
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
yellowstone: function [n][
|
||||
result: new [1 2 3]
|
||||
present: new [1 2 3]
|
||||
start: new 4
|
||||
while [n > size result][
|
||||
candidate: new start
|
||||
while ø [
|
||||
if all? @[
|
||||
not? contains? present candidate
|
||||
1 = gcd @[candidate last result]
|
||||
1 <> gcd @[candidate get result (size result)-2]
|
||||
][
|
||||
'result ++ candidate
|
||||
'present ++ candidate
|
||||
while [contains? present start] -> inc 'start
|
||||
break
|
||||
]
|
||||
inc 'candidate
|
||||
]
|
||||
]
|
||||
return result
|
||||
]
|
||||
|
||||
print yellowstone 30
|
||||
Loading…
Add table
Add a link
Reference in a new issue