RosettaCodeData/Task/Rare-numbers/00-TASK.txt
2023-07-01 13:44:08 -04:00

26 lines
1.6 KiB
Text

;Definitions and restrictions:
'''Rare''' &nbsp; numbers are positive integers &nbsp; <big> '''n''' </big> &nbsp; where:
:::* &nbsp; <big> '''n''' </big> &nbsp; is expressed in base ten
:::* &nbsp; <big> '''r''' </big> &nbsp; is the reverse of &nbsp; <big> '''n''' </big> &nbsp; &nbsp; (decimal digits)
:::* &nbsp; <big> '''n''' </big> &nbsp; must be non-palindromic &nbsp; <big>('''n''' &ne; '''r''')</big>
:::* &nbsp; <big> '''(n+r)''' </big> &nbsp; is the &nbsp; '''sum'''
:::* &nbsp; <big> '''(n-r)''' </big> &nbsp; is the &nbsp; '''difference''' &nbsp; and must be positive
:::* &nbsp; the &nbsp; '''sum''' &nbsp; and the &nbsp; '''difference''' &nbsp; must be perfect squares
;Task:
:* &nbsp; find and show the first &nbsp; '''5''' &nbsp; ''rare'' &nbsp; numbers
:* &nbsp; find and show the first &nbsp; '''8''' &nbsp; ''rare'' &nbsp; numbers &nbsp; &nbsp; &nbsp; (''optional'')
:* &nbsp; find and show more &nbsp; ''rare'' &nbsp; numbers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(''stretch goal'')
Show all output here, on this page.
;References:
:* &nbsp; an &nbsp; OEIS &nbsp; entry: &nbsp; [http://oeis.org/A035519 A035519 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rare numbers].
:* &nbsp; an &nbsp; OEIS &nbsp; entry: &nbsp; [http://oeis.org/A059755 A059755 &nbsp; odd rare numbers].
:* &nbsp; planetmath entry: &nbsp; [https://www.planetmath.org/RareNumbers rare numbers]. &nbsp; &nbsp; (some hints)
:* &nbsp; author's &nbsp;website: &nbsp; [http://www.shyamsundergupta.com/rare.html rare numbers] &nbsp; by Shyam Sunder Gupta. &nbsp; &nbsp; (lots of hints and some observations).
<br><br>