Challenge
Generate \$n-1\$ consecutive composite numbers using this prime gap formula
$$n!+2,n!+3,...,n!+n$$
Input
An integer \$n\$ wheresuch that \$3 \leq n \leq 50 \$.
Output
Sequence of \$n-1\$ consecutive composite numbers.
Example
Input
3
Output
8
9
Rules
- Output should be in integer format.
Test Cases
For \$n > 20\$, the results are very BIG integers (greater than 64-bits) and will most likely require a language that natively supports large numbers or a 3rd party library to handle them.
n | \$n-1\$ consecutive composites |
---|---|
3 | 8 9 |
5 | 122 123 124 125 |
21 | 51090942171709440002 51090942171709440003 51090942171709440004 51090942171709440005 51090942171709440006 51090942171709440007 51090942171709440008 51090942171709440009 51090942171709440010 51090942171709440011 51090942171709440012 51090942171709440013 51090942171709440014 51090942171709440015 51090942171709440016 51090942171709440017 51090942171709440018 51090942171709440019 51090942171709440020 51090942171709440021 |