RosettaCodeData/Task/Unprimeable-numbers/00-TASK.txt

52 lines
2.5 KiB
Plaintext

;Definitions:
As used here, all unprimeable numbers   (positive integers)   are always expressed in base ten.
───── Definition from OEIS ─────:
<br>Unprimeable numbers are composite numbers that always remain composite when a single decimal digit of the number is changed.
───── Definition from Wiktionary &nbsp; (referenced from Adam Spencer's book) ─────:
<br>(''arithmetic'') &nbsp; that cannot be turned into a prime number by changing just one of its digits to any other
digit. &nbsp; (<small>sic</small>)
'''Unprimeable''' numbers are also spelled: &nbsp; '''unprimable'''.
All one─ and two─digit numbers can be turned into primes by changing a single decimal digit.
;Examples:
'''190''' &nbsp; isn't unprimeable, &nbsp; because by changing the zero digit into a three yields &nbsp; '''193''', &nbsp; which is a prime.
The number &nbsp; '''200''' &nbsp; <u>is</u> unprimeable, &nbsp; since none of the numbers &nbsp; '''201, 202, 203, ··· 209''' &nbsp; are
prime, and all the other numbers obtained by changing a single digit to
produce &nbsp; '''100, 300, 400, ··· 900''', &nbsp; or &nbsp; '''210, 220, 230, ··· 290''' &nbsp; which are all even.
It is valid to change &nbsp; '''189''' &nbsp; into &nbsp; '''089''' &nbsp; by changing the &nbsp; '''1''' &nbsp; (one) &nbsp; into
a &nbsp; '''0''' &nbsp; (zero), &nbsp; which then the leading zero can be removed, &nbsp; and then treated as if
the &nbsp; "new" &nbsp; number is &nbsp; '''89'''.
;Task:
::* &nbsp; show the first &nbsp; '''35''' &nbsp; unprimeable numbers &nbsp; (horizontally, on one line, preferably with a title)
::* &nbsp; show the &nbsp; '''600<sup>th</sup>''' &nbsp; unprimeable number
::* &nbsp; (optional) show the lowest unprimeable number ending in a specific decimal digit &nbsp; ('''0, 1, 2, 3, 4, 5, 6, 7, 8, 9''')
::* &nbsp; (optional) use commas in the numbers where appropriate
Show all output here, on this page.
;Also see:
:* &nbsp; the &nbsp; &nbsp; OEIS &nbsp; &nbsp; entry: &nbsp; [https://oeis.org/A118118 A118118 (unprimeable)]
:* &nbsp; with some useful counts to compare [http://www.numbersaplenty.com/set/unprimeable_number/ unprimeable number]
:* &nbsp; the Wiktionary entry (reference from below): &nbsp; [https://en.wiktionary.org/wiki/unprimeable (arithmetic definition) unprimeable]
:* &nbsp; from the Adam Spencer book &nbsp; (page 200): &nbsp; ''Adam Spencer's World of Numbers'' &nbsp; &nbsp; &nbsp; (Xoum Publishing)
<br><br>