RosettaCodeData/Task/Hofstadter-Q-sequence/APL/hofstadter-q-sequence.apl
2023-07-01 13:44:08 -04:00

8 lines
261 B
APL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Q_sequence;seq;size
size100000
seq{,+/[(1+)-¯2]}(size-2)1 1
'The first 10 terms are:', seq[10]
'The 1000th term is:', seq[1000]
(+/ 2>/seq),'terms were preceded by a larger term.'