Increasing gaps between consecutive Niven numbers: Difference between revisions
Content added Content deleted
m (Minor edit to C++ code) |
m (added whitespace to the task's preamble, aligned some text.) |
||
Line 1: | Line 1: | ||
{{task}} |
{{task}} |
||
Note: '''Niven''' numbers are also called '''Harshad''' numbers. |
Note: '''Niven''' numbers are also called '''Harshad''' numbers. |
||
:::: They are also called '''multidigital''' numbers. |
:::: They are also called '''multidigital''' numbers. |
||
Line 14: | Line 14: | ||
:* find the gap (difference) of a Niven number from the previous Niven number |
:* find the gap (difference) of a Niven number from the previous Niven number |
||
:* if the gap is ''larger'' than the (highest) previous gap, then: |
:* if the gap is ''larger'' than the (highest) previous gap, then: |
||
:::* show the index (occurrence) of the gap (the 1st gap is '''1''') |
:::* show the index (occurrence) of the gap (the 1st gap is '''1''') |
||
:::* show the index of the Niven number that starts the gap (1<sup>st</sup> Niven number is '''1''', 33<sup>rd</sup> Niven number is '''100''') |
:::* show the index of the Niven number that starts the gap (1<sup>st</sup> Niven number is '''1''', 33<sup>rd</sup> Niven number is '''100''') |
||
:::* show the Niven number that starts the gap |
:::* show the Niven number that starts the gap |
||
:::* show all numbers with comma separators where appropriate (optional) |
:::* show all numbers with comma separators where appropriate (optional) |
||
:::* I.E.: the gap size of '''60''' starts at the 33,494<sup>th</sup> Niven number which is Niven number 297,864 |
:::* I.E.: the gap size of '''60''' starts at the 33,494<sup>th</sup> Niven number which is Niven number '''297,864''' |
||
:* show all increasing gaps up to the ten millionth ('''10,000,000<sup>th</sup>''') Niven number |
:* show all increasing gaps up to the ten millionth ('''10,000,000<sup>th</sup>''') Niven number |
||
:* (optional) show all gaps up to whatever limit is feasible/practical/realistic/reasonable/sensible/viable on your computer |
:* (optional) show all gaps up to whatever limit is feasible/practical/realistic/reasonable/sensible/viable on your computer |