Recaman's sequence: Difference between revisions

clarify
m (Updated description and link for Fōrmulæ solution)
(clarify)
Line 2:
The '''[[wp:Recamán's sequence|Recamán's sequence]]''' generates Natural numbers.
 
Starting from zeroa(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 previousely generated.<br>
 
If the conditions ''don't'' hold then <code>a(n) = a(n-1) + n</code>.
2,469

edits