Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Here's a specific example working off an idea from Mark Ronsom's answer:
  2.  
  3. {2-2,3-3,4-4,6-6,8-8,10-10,12-12,20-20,22-22}
  4.  
  5. 2=0 {3-3} | 2>0 {4-2,6-3,8-4,10-5,12-6,20-10,22-11} PRINT 2
  6. 2=0 {3-3} | 2=1 {6-3,10-5,22-11} | 2>1{8-2,12-3,20-5} PRINT 4 = 2*2
  7. 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
  8.  
  9. 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.
  10.  
  11.  
  12. (3..) {3-3} | (3..) {6-3,10-5,22-11} | (3..) {12-3,20-5} | (2..) {}
  13. (3..) {3-3} | (3..) {6-3,10-5,22-11} | (5..) {20-5} | (3..) {} PRINT 12
  14. ....
  15.  
  16. (p..) stops at sqrtN,... or is it? MOST WORTH IT to maintain the upper-limit too (in (3..N); (5..M))!!!.....
  17.  
  18. 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