RosettaCodeData/Task/Increasing-gaps-between-consecutive-Niven-numbers/00-TASK.txt
2023-07-01 13:44:08 -04:00

32 lines
1.9 KiB
Text

Note:   '''[[wp:Harshad_number|Niven]]'''   numbers are also called   '''Harshad'''   numbers.
::::   They are also called    '''multidigital'''   numbers.
'''Niven''' numbers are positive integers which are evenly divisible by the sum of its
digits   (expressed in base ten).
''Evenly divisible''   means   ''divisible with no remainder''.
;Task:
:*   find the gap (difference) of a Niven number from the previous Niven number
:*   if the gap is   ''larger''   than the (highest) previous gap,   then:
:::*   show the index (occurrence) of the gap     (the 1st gap is   '''1''')
:::* &nbsp; show the index of the Niven number that starts the gap &nbsp; &nbsp; (1<sup>st</sup> Niven number is &nbsp; '''1''', &nbsp; 33<sup>rd</sup> Niven number is &nbsp; '''100''')
:::* &nbsp; show the Niven number that starts the gap
:::* &nbsp; show all numbers with comma separators where appropriate &nbsp; (optional)
:::* &nbsp; I.E.: &nbsp; the gap size of &nbsp; '''60''' &nbsp; starts at the &nbsp; 33,494<sup>th</sup> &nbsp; Niven number which is Niven number &nbsp; '''297,864'''
:* &nbsp; show all increasing gaps up to the &nbsp; ten millionth &nbsp; ('''10,000,000<sup>th</sup>''') &nbsp; Niven number
:* &nbsp; (optional) &nbsp; show all gaps up to whatever limit is feasible/practical/realistic/reasonable/sensible/viable on your computer
:* &nbsp; show all output here, on this page
;Related task:
:* &nbsp; [https://rosettacode.org/wiki/Harshad_or_Niven_series Harshad or Niven series].
;Also see:
:* &nbsp; [https://cs.uwaterloo.ca/journals/JIS/VOL6/Doyon/doyon.html Journal of Integer Sequences, Vol. 6 (2004), Article 03.2.5, <big>Large and Small Gaps Between Consecutive Niven Numbers</big>].
:* &nbsp; [https://cs.uwaterloo.ca/journals/JIS/VOL6/Doyon/doyon.pdf (PDF) version of the (above) article by Doyon].
<br><br>