27 lines
1.3 KiB
Text
27 lines
1.3 KiB
Text
When a number is written in base 10, adjacent digits may "rise" or "fall" as the number is read (usually from left to right).
|
|
|
|
|
|
;Definition:
|
|
Given the decimal digits of the number are written as a series <big>d</big>:
|
|
:* A ''rise'' is an index <big>i</big> such that <big> d(i) < d(i+1)</big>
|
|
:* A ''fall'' is an index <big>i</big> such that <big> d(i) > d(i+1)</big>
|
|
|
|
|
|
;Examples:
|
|
:* The number '''726,169''' has '''3''' rises and '''2''' falls, so it <u>isn't</u> in the sequence.
|
|
:* The number '''83,548''' has '''2''' rises and '''2''' falls, so it <u>is</u> in the sequence.
|
|
|
|
|
|
;Task:
|
|
:* Print the first '''200''' numbers in the sequence
|
|
:* Show that the '''10 millionth''' (10,000,000<sup>th</sup>) number in the sequence is '''41,909,002'''
|
|
|
|
|
|
;See also:
|
|
* OEIS Sequence [[OEIS:A296712|A296712]] describes numbers whose digit sequence in base 10 have equal "rises" and "falls".
|
|
|
|
|
|
;Related tasks:
|
|
* [[Esthetic_numbers|Esthetic numbers]]
|
|
<br><br>
|
|
|