32 lines
1.6 KiB
Plaintext
32 lines
1.6 KiB
Plaintext
;Definitions
|
|
A '''Smarandache-Wellin number''' (S-W number for short) is an integer that in a given base is the concatenation of the first n prime numbers written in that base. A base of 10 will be assumed for this task.
|
|
|
|
A '''Derived S-W number''' (not an 'official' term) is an integer formed from a S-W number by working out the number of times each of the digits 0 to 9 occurs in that number, concatenating those frequencies in the same order (i.e. frequency of '0' first, frequency of '1' second etc) and removing any leading zeros.
|
|
|
|
;Examples
|
|
|
|
'23571113' is the sixth S-W number formed by concatenating the first 6 primes: 2, 3, 5, 7, 11 and 13.
|
|
|
|
The corresponding Derived S-W number is '312010100' because '1' occurs 3 times, '3' occurs twice and '2', '5' and '7' all occur once.
|
|
|
|
;Task
|
|
|
|
* Find and show the first three S-W numbers which are prime.
|
|
|
|
* Find and show the first three Derived S-W numbers which are prime.
|
|
|
|
;Stretch (requires 'big integer' support)
|
|
|
|
Find and show the index in the sequence (starting from 1), the total number of digits and the last prime used to form the fourth, fifth, sixth, seventh and (optionally) the eighth S-W numbers which are prime or probably prime with reasonable certainty. It is unknown whether there are any more but, if you fancy searching for one, good luck! You can start from an index of 22,077.
|
|
|
|
Also find and show up to the first twenty Derived S-W numbers which are prime and their index in the sequence.
|
|
|
|
; References
|
|
|
|
* [[wp:Smarandache-Wellin_number|Wikipedia: Smarandache-Wellin number]]
|
|
* [[oeis:A019518|OEIS:A019518 - Smarandache-Wellin numbers]]
|
|
* [[oeis:A069151|OEIS:A069151 - Smarandache-Wellin primes]]
|
|
|
|
<br>
|
|
|