Yellowstone sequence: Difference between revisions

m
J →‎explicit: maybe closer to classic syntax as used in other languages
m (J →‎explicit: more concise, roughly the same speed (sometimes faster, sometimes not))
m (J →‎explicit: maybe closer to classic syntax as used in other languages)
Line 1,124:
while. y > # s do.
z=. <./(1+s)-.s NB. lowest positive inteeger not in sequence
while. if. 0 1 -: z relatively_prime _2{.s do. z e. s end. do.
while.
endz=. z+1
if. 0 1 -: z relatively_prime _2{.s do.
end. NB. zfind e.next value for ssequence
end.
do. z=. z+1 end. NB. find next value for sequence
s=. s, z
end.
6,962

edits