53 lines
2.1 KiB
Text
53 lines
2.1 KiB
Text
Numbers (positive integers expressed in base ten) that are (evenly) divisible by the number formed by the
|
|
first and last digit are known as '''gapful numbers'''.
|
|
|
|
|
|
''Evenly divisible'' means divisible with no remainder.
|
|
|
|
|
|
All one─ and two─digit numbers have this property and are trivially excluded. Only
|
|
numbers <big> ≥ </big> '''100''' will be considered for this Rosetta Code task.
|
|
|
|
|
|
;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>
|
|
|
|
|
|
A palindromic number is (for this task, a positive integer expressed in base ten), when the number is
|
|
reversed, is the same as the original number.
|
|
|
|
|
|
;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>
|
|
|