*a=0,0,0,0,1,1 6.upto(1e6){a<<(a[-1]*2-a[-5])%17} gets $<.map{|n|p a[n.to_i]}