class AntBooks attr_reader :n def initialize(n: 0) @n = n end def cause begin @n = Integer(gets.chomp) rescue end end def arithmetic_sequence(n) 316 + (52 * (n-1)) end def result puts arithmetic_sequence(@n) end def run cause result end end if $0 == __FILE__ AntBooks.new.run end