RosettaCodeData/Task/Hofstadter-Q-sequence/Maple/hofstadter-q-sequence-1.maple
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

8 lines
221 B
Text

Q := proc( n )
option remember, system;
if n = 1 or n = 2 then
1
else
thisproc( n - thisproc( n - 1 ) ) + thisproc( n - thisproc( n - 2 ) )
end if
end proc: