gets *r=0,0,0,a=1 5000.times{|i|a=a-r[i]+r[i+4]=a%17};$<.map{|n|p r[~-n.to_i%4912]}