Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here's a specific example working off an idea from Mark Ronsom's answer:
- {2-2,3-3,4-4,6-6,8-8,10-10,12-12,20-20,22-22}
- 2=0 {3-3} | 2>0 {4-2,6-3,8-4,10-5,12-6,20-10,22-11} PRINT 2
- 2=0 {3-3} | 2=1 {6-3,10-5,22-11} | 2>1{8-2,12-3,20-5} PRINT 4 = 2*2
- 2=0 {3-3} | 2=1 {6-3,10-5,22-11} | 2=2 {12-3,20-5} | 2>2 {} PRINT 8 = 2*2*2
- 2, 4=2*2, 8=2*2*2, 12=2*2*3, 20=2*2*5, 6=2*3, 10=2*5, 22=2*11, 3=3.
- (3..) {3-3} | (3..) {6-3,10-5,22-11} | (3..) {12-3,20-5} | (2..) {}
- (3..) {3-3} | (3..) {6-3,10-5,22-11} | (5..) {20-5} | (3..) {} PRINT 12
- ....
- (p..) stops at sqrtN,... or is it? MOST WORTH IT to maintain the upper-limit too (in (3..N); (5..M))!!!.....
- when the limit is reached, print all the right-most bag, ordered/increasing! they are all primes...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement