Ludic numbers: Difference between revisions

m
added whitespace to the task's preamble, used superscripts instead of quoted text ('nd, 'rd, 'th).
m (added a superscript th to a number.)
m (added whitespace to the task's preamble, used superscripts instead of quoted text ('nd, 'rd, 'th).)
Line 3:
[https://oeis.org/wiki/Ludic_numbers Ludic numbers]   are related to prime numbers as they are generated by a sieve quite like the [[Sieve of Eratosthenes]] is used to generate prime numbers.
 
The first ludic number is &nbsp; <span style="color:blue;font-weight:bold">1</span>.
<br>To generate succeeding ludic numbers create an array of increasing integers starting from &nbsp; 2
:<code><span style="color:blue;font-weight:bold">2</span> 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ...</code>
(Loop)
* Take the first member of the resultant array as the next ludic number &nbsp; <span style="color:blue;font-weight:bold">2</span>.
* Remove every &nbsp; '''2'<sup>nd</sup>''' &nbsp; indexed item from the array (including the first).
::<code><span style="color:blue;font-weight:bold"><s>2</s></span> 3 <s>4</s> 5 <s>6</s> 7 <s>8</s> 9 <s>10</s> 11 <s>12</s> 13 <s>14</s> 15 <s>16</s> 17 <s>18</s> 19 <s>20</s> 21 <s>22</s> 23 <s>24</s> 25 <s>26</s> ...</code>
* (Unrolling a few loops...)
* Take the first member of the resultant array as the next ludic number &nbsp; <span style="color:blue;font-weight:bold">3</span>.
* Remove every &nbsp; '''3'<sup>rd</sup>''' &nbsp; indexed item from the array (including the first).
::<code><span style="color:blue;font-weight:bold"><s>3</s></span> 5 7 <s>9</s> 11 13 <s>15</s> 17 19 <s>21</s> 23 25 <s>27</s> 29 31 <s>33</s> 35 37 <s>39</s> 41 43 <s>45</s> 47 49 <s>51</s> ...</code>
* Take the first member of the resultant array as the next ludic number &nbsp; <span style="color:blue;font-weight:bold">5</span>.
* Remove every &nbsp; '''5'<sup>th</sup>''' &nbsp; indexed item from the array (including the first).
::<code><span style="color:blue;font-weight:bold"><s>5</s></span> 7 11 13 17 <s>19</s> 23 25 29 31 <s>35</s> 37 41 43 47 <s>49</s> 53 55 59 61 <s>65</s> 67 71 73 77 ...</code>
* Take the first member of the resultant array as the next ludic number &nbsp; <span style="color:blue;font-weight:bold">7</span>.
* Remove every &nbsp; '''7'<sup>th</sup>''' &nbsp; indexed item from the array (including the first).
::<code><span style="color:blue;font-weight:bold"><s>7</s></span> 11 13 17 23 25 29 <s>31</s> 37 41 43 47 53 55 <s>59</s> 61 67 71 73 77 83 <s>85</s> 89 91 97 ...</code>
* ...
* Take the first member of the current array as the next ludic number &nbsp; <span style="color:blue;font-weight:bold">L</span>.
* Remove every &nbsp; '''L'<sup>th</sup>''' &nbsp; indexed item from the array (including the first).
* ...
 
Line 30:
* How many ludic numbers are there less than or equal to 1000?
* Show the 2000..2005<sup>th</sup> ludic numbers.
* A triplet is any three numbers &nbsp; &nbsp; <big><math> x, </math> &nbsp; <math> x+2, </math> &nbsp; <math> x+6 </math> </big> &nbsp; &nbsp; where all three numbers are also ludic numbers.
 
 
<br>
Show all triplets of ludic numbers < 250 (;Stretch goal):
Show all triplets of ludic numbers < 250.
<br><br>