Nice primes: Difference between revisions

Content added Content deleted
(→‎{{header|Wren}}: Simplification.)
m (added highlighting and whitespace, corrected a misspelling, implied that N is to be in base ten.)
Line 1: Line 1:
{{Draft task}}
{{Draft task}}
::#   Take an integer n, greater than zero.
::#   Take an positive integer   '''n'''
::#   sumn is sum of n's digits
::#   '''sumn'''   is the sum of the decimal digits of   '''n'''
::#   If sumn's lenght greater than 1 repeat the (2) for n = sumn
::#   If  '''sumn''''s  length is greater than   '''1'''   (unity),   repeat step 2 for   '''n = sumn'''
::#   Stop when sumn's length equal to 1
::#   Stop when  '''sumn''''s  length is equal to   '''1'''   (unity)

<br> If n and sumn are prime then n is Nice prime

<br> Let 500 < n < 1000
If &nbsp; '''n''' &nbsp; and &nbsp; '''sumn''' &nbsp; are prime, &nbsp; then &nbsp; '''n''' &nbsp; is a &nbsp; '''Nice prime'''
<br>

Let &nbsp; &nbsp; '''500 &nbsp; &lt; &nbsp; n &nbsp; &lt; &nbsp; 1000'''


;Example:
;Example:
<pre>
<pre>
Line 13: Line 17:
1 + 6 = 7 (prime)
1 + 6 = 7 (prime)
</pre>
</pre>
<br><br>


=={{header|Factor}}==
=={{header|Factor}}==