require 'mathn' N = 1<<3 f = Array.new(N) {|x| (x