Skip to content

Instantly share code, notes, and snippets.

@nahi
Created August 14, 2009 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahi/167573 to your computer and use it in GitHub Desktop.
Save nahi/167573 to your computer and use it in GitHub Desktop.
0% irb19
irb(main):001:0> require 'prime'
=> true
irb(main):002:0> 4207869677.prime_division
=> [[11, 1], [382533607, 1]]
irb(main):003:0> 382533607.prime_division
=> [[382533607, 1]]
irb(main):004:0> a = 4207869677
=> 4207869677
irb(main):005:0> a.to_s.reverse.to_i
=> 7769687024
irb(main):006:0> a.to_s.reverse.to_i.prime_division
=> [[2, 4], [11, 1], [19, 1], [167, 1], [13913, 1]]
irb(main):007:0> a.to_s(16)
=> "facefeed"
irb(main):008:0> 0xfacefeed
=> 4207869677
irb(main):009:0> 0xfaceb00c
=> 4207849484
irb(main):010:0> 0xfeedb00c
=> 4276989964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment