TDPRIMES - Printing some primes

The problem statement is really simple. You are to write all primes less than 10^8

Input

There is no input.

Output

To make the problem less output related write out only the 1st, 101st, 201st, ... 1st mod 100.

Example

Input:

Output:
2
547
1229
...
99995257
99996931
99998953

Added by:Alfonso² Peterssen
Date:2010-04-06
Time limit:1.325s
Source limit:10000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM32 ASM64 BF CLPS LISP sbcl LISP clisp ERL HASK ICON ICK JS-RHINO LUA NEM NICE OBJC OCAML PHP PIKE PRLG-swi SCALA SCM guile SCM qobi ST SQLITE TCL WHITESPACE
Resource:Thanks to TDuke

hide comments
2024-12-27 09:36:15
I didn't store prime number in bool array why?
2024-10-21 12:13:29
<snip>
This code works fine. solved Using simple sieve
[Simes]: good for you.

Last edit: 2024-10-22 15:05:51
2024-06-18 19:28:01
Getting TLE with simple sieve,also used bool array
2023-12-27 14:52:19
is solution available on the website?
2023-06-02 08:50:13 Simes
@naim19149 @mr_variable: Take the index of a prime, mod it by 100 and if the result is 1, print it.
2023-05-31 19:57:42
what does this "1st mod 100." mean in the question?
2023-05-09 08:12:36
what does this "1st mod 100." mean in the question?
2023-01-09 17:48:54
read carefully how to output answer
2022-09-28 21:36:00
use boolean vector or array
2022-04-11 06:29:38
simple sieve ... ac

Last edit: 2022-04-11 06:31:19
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.