Skip to content

Commit

Permalink
Problem 301
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbantuelle committed Oct 5, 2018
1 parent a5c2cf4 commit c0bfdbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 301.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
winners = 0
1.upto(2**30) do |n|
winners += 1 if n ^ (n*2) ^ (n*3) == 0
puts n if n % 10_000_000 == 0
end
puts winners

0 comments on commit c0bfdbb

Please sign in to comment.