Numbers with equal rises and falls: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: elided a blank line, moved one-liner functions to top of subroutine code. |
m added whitespace and highlighting, added the word "decimal", moved the (URL) reference to the OEIS entry to ";See also:". |
||
Line 1:
{{draft task}}
When a number is written in base 10, adjacent digits may "rise" or "fall" as the number is read (usually from left to right).
<br>▼
OEIS Sequence A296712 describes numbers whose digit sequence in base 10 have equal "rises" and "falls".▼
Definition:▼
Given the digits of the number are written as a series d:<br>▼
Examples:<br>▼
:* The number 726169 has 3 rises and 2 falls, so it is not in the sequence.▼
:* The number 83548 has 2 rises and 2 falls, so it is in the sequence.▼
;Task▼
▲;Definition:
Print the first 200 numbers in the sequence. Show that the 10 millionth▼
:* 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>
;See also:▼
▲:* The number '''726169''' has '''3''' rises and '''2''' falls, so it
▲:* The number '''83548''' 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 '''41909002'''
▲;See also:
▲* OEIS Sequence A296712 describes numbers whose digit sequence in base 10 have equal "rises" and "falls". [[OEIS:A296712]].
;Related:▼
*[[Esthetic_numbers|Esthetic numbers]]▼
▲;Related tasks:
▲* [[Esthetic_numbers|Esthetic numbers]]
▲<br><br>
=={{header|11l}}==
|