Template:Task

From Rosetta Code
Revision as of 05:35, 26 July 2020 by rosettacode>JusC
Task
Task
You are encouraged to solve this task according to the task description, using any language you may know.

This is a template. There are many others. See Category:RCTemplates for a complete list of templates.
Task
Task
You are encouraged to solve this task according to the task description, using any language you may know.

Template loop detected: Template:Task A twin prime is a pair of natural numbers P1 and P2 that satisfy the following:

1. P1 and P2 are primes

2. P1 + 2 = P2

Write a program that displays the number of twin primes that can be found under a user-inputted number.

Examples below:

Output:
> Search Size: 100
> 8 twin prime pairs.
> Search Size: 1000
> 35 twin prime pairs.

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

1. P1 and P2 are primes

2. P1 + 2 = P2

Write a program that displays the number of twin primes that can be found under a user-inputted number.

Examples below:

Output:
> Search Size: 100
> 8 twin prime pairs.
> Search Size: 1000
> 35 twin prime pairs.