Template:Task: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
{{task|Twin Prime Conjecture}}[[Category:Primes]]{{requires|Input}}
{{infobox_begin}}{{Task/Icon}}{{#set:is task=true}}You are encouraged to [[Rosetta Code:Solve a Task|solve this task]] according to the task description, using any language you may know.<includeonly>[[Category:Programming Tasks]]{{#if:{{{1|}}}|[[Category:{{{1}}}]]|[[Category:Solutions by Programming Task]]}}</includeonly>{{infobox_end}}<noinclude>


Twin primes are pairs of natural numbers(P1 and P2) that satisfy the following:


# P1 and P2 are primes
A twin prime is a pair of natural numbers P1 and P2 that satisfy the following:


1. P1 and P2 are primes
# P1 + 2 = P2

2. P1 + 2 = P2


Write a program that displays the number of twin primes that can be found under a user-inputted number.
Write a program that displays the number of twin primes that can be found under a user-inputted number.
Line 53: Line 52:
</lang>
</lang>
{{out}}
{{out}}
<pre>
<pre>
<pre>
> Search Size:
> Search Size: