<commit_before>require "linear1/function"
module Linear1
	class ArthmeticSequence < Function
		attr_reader :a, :common_difference
		alias d common_difference
		alias to_a a
		alias slope d
		def initialize a
			i = 0
			while i < a.length - 2 
				raise ArgumentError, "Elements must have a common difference" unless a[i+1] - a[i] == a[i+2] - a[i+1]
				i += 1
			end
			@common_difference, @a = a[1] - a[0], a
			super @common_difference, @a[0]
		end
		def to_s # Modified to count from zero instead of one
			"a[n] = #{a[0]} + #{idx d}n"
		end
	end
end<commit_msg>Update arthmetic_sequence.rb<commit_after>require "linear1/function"
module Linear1
	class ArthmeticSequence < Function
		attr_reader :a, :common_difference
		alias d common_difference
		private :slope, :y_intercept
		alias to_a a
		alias slope d
		def initialize a
			i = 0
			while i < a.length - 2 
				raise ArgumentError, "Elements must have a common difference" unless a[i+1] - a[i] == a[i+2] - a[i+1]
				i += 1
			end
			@common_difference, @a = display_num(a[1]) - display_num(a[0]), a
			super @common_difference, @a[0]
		end
		def to_s # Modified to count from zero instead of one
			"a[n] = #{a[0]} + #{idx d}n"
		end
	end
end
{'fraction_non_alphanumeric': 0.11295681063122924, 'fraction_numerical': 0.019933554817275746, 'mean_word_length': 3.397810218978102, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4772511', 'n_tokens_mistral': 513, 'n_tokens_neox': 441, 'n_words': 143}