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