Ludic numbers: Difference between revisions

m
added whitespace before the TOC (table of contents), used a constant uncapitalized spelling of ludic.
m (→‎{{header|360 Assembly}}: Superfluous blanks suppressed)
m (added whitespace before the TOC (table of contents), used a constant uncapitalized spelling of ludic.)
Line 1:
{{task|Sieves}}
[https://oeis.org/wiki/Ludic_numbers Ludicludic 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 <span style="color:blue;font-weight:bold">1</span>.
Line 6:
:<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 Ludicludic number <span style="color:blue;font-weight:bold">2</span>.
* Remove every '''2'nd''' 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 Ludicludic number <span style="color:blue;font-weight:bold">3</span>.
* Remove every '''3'rd''' 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 Ludicludic number <span style="color:blue;font-weight:bold">5</span>.
* Remove every '''5'th''' 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 Ludicludic number <span style="color:blue;font-weight:bold">7</span>.
* Remove every '''7'th''' 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 Ludicludic number <span style="color:blue;font-weight:bold">L</span>.
* Remove every '''L'th''' indexed item from the array (including the first).
* ...
 
 
;Task:
Line 28 ⟶ 29:
* How many ludic numbers are there less than or equal to 1000?
* Show the 2000..2005'th ludic numbers.
* A triplet is any three numbers <math>x,</math> <math>x+2,</math> <math>x+6</math> where all three numbers are also ludic numbers. Show all triplets of ludic numbers < 250 (Stretch goal)
 
<br>
Show all triplets of ludic numbers < 250 (Stretch goal)
<br><br>
 
=={{header|360 Assembly}}==