fork download
  1. {-# OPTIONS_GHC -O2 #-}
  2.  
  3. main = print $
  4. last $ take 1200
  5. [n | n<-[2..], let i=div n 2, and [rem n j /= 0| j <-[i,i-1..2]]]
  6.  
  7. {-
  8. n=1000
  9. Success time: 0.41 memory: 6280 signal:0
  10. N=7919
  11.  
  12. n=2000
  13. Success time: 2.24 memory: 6280 signal:0
  14. N=17389
  15.  
  16. ... N^2.1 n^2.4
  17.  
  18. (http://e...content-available-to-author-only...a.org/wiki/Analysis_of_algorithms#Empirical_orders_of_growth)
  19. -}
  20.  
  21. main2 = print $
  22. [logBase (17389/7919) (2.25/0.42),
  23. logBase (2000/1000) (2.25/0.42)]
Success #stdin #stdout 0.67s 6236KB
stdin
Standard input is empty
stdout
9733