From 124ae44c0d8d1d4e6e6a7b9fed1e7e53d09c4e99 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Fri, 25 Dec 2015 18:06:24 -0800 Subject: [PATCH] Day 25.0 --- ruby/day_25.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ruby/day_25.rb diff --git a/ruby/day_25.rb b/ruby/day_25.rb new file mode 100644 index 0000000..6883d28 --- /dev/null +++ b/ruby/day_25.rb @@ -0,0 +1,15 @@ +row = 2981 +col = 3075 + +i = row*(row-1)/2 + 1 +i += (row..row+col-1).inject(:+) - row + +value = 20151125 +(i-1).times do + value *= 252533 + value %= 33554393 +end +puts value + +__END__ +Enter the code at row 2981, column 3075.