Recaman's sequence: Difference between revisions
m
typo
m (→{{header|Wren}}: Changed to Wren S/H) |
m (typo) |
||
Line 2:
The '''[[wp:Recamán's sequence|Recamán's sequence]]''' generates Natural numbers.
Starting from a(0)=0, the n'th term <code>a(n)</code>, where n>0, is the previous term minus <code>n</code> i.e <code>a(n) = a(n-1) - n</code> but only if this is '''both''' positive ''and'' has not been
If the conditions ''don't'' hold then <code>a(n) = a(n-1) + n</code>.
|