Anonymous user
Hofstadter Figure-Figure sequences: Difference between revisions
m
added whitespace before the TOC (table of contents), added a ;Task: (bold) header.
m (→{{header|Sidef}}: modified the code to work with Sidef 2.30) |
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header.) |
||
Line 1:
{{task}}
These two sequences of positive integers are defined as:
:<math>\begin{align}
Line 9 ⟶ 10:
Sequence S starts: 2, 4, 5, 6, 8, ...
;Task:
# Create two functions named ffr and ffs that when given n return R(n) or S(n) respectively.<br><small>(Note that R(1) = 1 and S(1) = 2 to avoid off-by-one errors).</small>
# No maximum value for n should be assumed.
Line 19 ⟶ 21:
* [http://mathworld.wolfram.com/HofstadterFigure-FigureSequence.html Wolfram Mathworld]
* Wikipedia: [[wp:Hofstadter_sequence#Hofstadter_Figure-Figure_sequences|Hofstadter Figure-Figure sequences]].
<br><br>
=={{header|Ada}}==
Specifying a package providing the functions FFR and FFS:
|