I have the following script in ruby:
set = []
for i in 2..100
for j in 2..100
set << i**j
end
end
puts set.uniq!.count
When running this script with Ruby version ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
, the output is 8243.
When I run this script with Ruby version ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin12.4.0]
, the output is 9183 (which is what I expect the result to be).
Any ideas why there is a discrepancy between the two versions?