SHARE
TWEET

Untitled

a guest Jul 27th, 2014 268 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = 1
  2. b = 1
  3. 20.times do |n|
  4.   a += a * 10
  5.   b += b * 20
  6.   puts "a #{a}. b #{b}. b/a #{b.to_f/a}"
  7.   puts
  8. end
  9.  
  10. __END__
  11.  
  12. Output:
  13.  
  14. a 11. b 21. b/a 1.90909090909091
  15.  
  16. a 121. b 441. b/a 3.64462809917355
  17.  
  18. a 1331. b 9261. b/a 6.95792637114951
  19.  
  20. a 14641. b 194481. b/a 13.2833139812854
  21.  
  22. a 161051. b 4084101. b/a 25.3590539642722
  23.  
  24. a 1771561. b 85766121. b/a 48.4127393863378
  25.  
  26. a 19487171. b 1801088541. b/a 92.4243206466449
  27.  
  28. a 214358881. b 37822859361. b/a 176.446430325413
  29.  
  30. a 2357947691. b 794280046581. b/a 336.852276075788
  31.  
  32. a 25937424601. b 16679880978201. b/a 643.081617962869
  33.  
  34. a 285311670611. b 350277500542221. b/a 1227.70127065639
  35.  
  36. a 3138428376721. b 7355827511386641. b/a 2343.79333488946
  37.  
  38. a 34522712143931. b 154472377739119461. b/a 4474.51454842534
  39.  
  40. a 379749833583241. b 3243919932521508681. b/a 8542.25504699383
  41.  
  42. a 4177248169415651. b 68122318582951682301. b/a 16307.9414533519
  43.  
  44. a 45949729863572161. b 1430568690241985328321. b/a 31133.3427745808
  45.  
  46. a 505447028499293771. b 30041942495081691894741. b/a 59436.3816605634
  47.  
  48. a 5559917313492231481. b 630880792396715529789561. b/a 113469.455897439
  49.  
  50. a 61159090448414546291. b 13248496640331026125580781. b/a 216623.506713293
  51.  
  52. a 672749994932560009201. b 278218429446951548637196401. b/a 413553.967361741
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top