fork download
  1. var f = 0, j=2, q=0 // p = 2147483648-1;
  2. var p = parseInt(Math.random()*Math.pow(2,22)) -1 // 1234566674;
  3. var s = parseInt(Math.pow(p, 0.5))
  4.  
  5. print( p +" "+ s )
  6.  
  7. while (f < 1)
  8. { if (j >= s) { f=2 }
  9. if ( p % j == 0 )
  10. { q=1; print(p+" _ "+j+" _ "+ p/j) }
  11. j++
  12. }
  13.  
  14. if (q != 1) { print("Prime "+ p) }
  15.  
Success #stdin #stdout 0.03s 17612KB
stdin
Standard input is empty
stdout
2639264 1624
2639264 _ 2 _ 1319632
2639264 _ 4 _ 659816
2639264 _ 8 _ 329908
2639264 _ 16 _ 164954
2639264 _ 32 _ 82477
2639264 _ 67 _ 39392
2639264 _ 134 _ 19696
2639264 _ 268 _ 9848
2639264 _ 536 _ 4924
2639264 _ 1072 _ 2462
2639264 _ 1231 _ 2144