47 lines
2.1 KiB
Text
47 lines
2.1 KiB
Text
For this task, a ''number'' is to be understood as a positive integer expressed in base ten,
|
|
and a ''palindromic'' number is one that is equal to the integer formed by reversing its decimal digits.
|
|
|
|
A number that is evenly divisible by the number formed by concatenating its
|
|
first and last digits in that order is known as a '''gapful number'''.
|
|
All one─ and two─digit numbers have this property and accordingly only
|
|
numbers greater than or equal to '''100''' should be considered for this Rosetta Code task.
|
|
|
|
(''Evenly divisible'' here means divisible with no remainder.)
|
|
|
|
;Example:
|
|
<big>'''1037'''</big> is a '''gapful''' number because it is evenly divisible by the
|
|
number <big>'''17'''</big> which is formed by the first and last decimal digits
|
|
of <big> '''<u>1</u>03<u>7</u>'''. </big>
|
|
|
|
;Task:
|
|
:* Show (nine sets) the first '''20''' palindromic gapful numbers that ''end'' with:
|
|
:::* the digit '''1'''
|
|
:::* the digit '''2'''
|
|
:::* the digit '''3'''
|
|
:::* the digit '''4'''
|
|
:::* the digit '''5'''
|
|
:::* the digit '''6'''
|
|
:::* the digit '''7'''
|
|
:::* the digit '''8'''
|
|
:::* the digit '''9'''
|
|
:* Show (nine sets, like above) of palindromic gapful numbers:
|
|
:::* the last '''15''' palindromic gapful numbers (out of '''100''')
|
|
:::* the last '''10''' palindromic gapful numbers (out of '''1,000''') {optional}
|
|
|
|
|
|
For other ways of expressing the (above) requirements, see the ''discussion'' page.
|
|
|
|
|
|
;Note:
|
|
All palindromic gapful numbers are divisible by eleven.
|
|
|
|
|
|
;Related tasks:
|
|
:* [https://rosettacode.org/wiki/Palindrome_detection palindrome detection].
|
|
:* [https://rosettacode.org/wiki/Gapful_numbers gapful numbers].
|
|
|
|
|
|
;Also see:
|
|
:* The OEIS entry: [https://oeis.org/A108343 A108343 gapful numbers].
|
|
<br><br>
|
|
|