Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Recamans-sequence/00-TASK.txt
Normal file
19
Task/Recamans-sequence/00-TASK.txt
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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 previousely generated.<br>
|
||||
|
||||
If the conditions ''don't'' hold then <code>a(n) = a(n-1) + n</code>.
|
||||
|
||||
|
||||
;Task:
|
||||
# Generate and show here the first 15 members of the sequence.
|
||||
# Find and show here, the first duplicated number in the sequence.
|
||||
# '''Optionally''': Find and show here, how many terms of the sequence are needed until all the integers 0..1000, inclusive, are generated.
|
||||
|
||||
|
||||
;References:
|
||||
* [https://oeis.org/A005132 A005132], The On-Line Encyclopedia of Integer Sequences.
|
||||
* [https://www.youtube.com/watch?v=FGC5TdIiT9U The Slightly Spooky Recamán Sequence], Numberphile video.
|
||||
* [https://en.wikipedia.org/wiki/Recam%C3%A1n%27s_sequence Recamán's sequence], on Wikipedia.
|
||||
<br><br>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue