class Sequence

class List end

Public Class Methods

new() click to toggle source
# File lib/M500_containers.rb, line 417
def initialize
  @index0 = 0
  @indexn = 50
  @func = proc{|k|
    @a_n_minus1 = @a_n
    @a_n *= (Quotient(1) + Quotient(Zahlen(1),Natural(k+1)))
  }
  @a_n_minus1 = Quotient(1)
  @a_n = Quotient(1)
  @sequence = List.new!#([])
  (@index0..@indexn).to_a.each{|n|
    @sequence << @func.call(n)}
end

Public Instance Methods

to_Series() click to toggle source
# File lib/M500_containers.rb, line 441
def to_Series
  a = Sigma(@sequence.inject(:+).to_Q) {@func}
  a.k0 = @index0
  a.k = @indexn
  a
end
to_Set() click to toggle source
# File lib/M500_containers.rb, line 438
def to_Set
  Set(@sequence)
end
to_cols() click to toggle source
# File lib/M500_containers.rb, line 432
def to_cols
  result = [[],[]]
  (@index0..@indexn).to_a.each{|n|
    result.at(0)<< n
    result.at(1)<< @func.call(n)}
end
to_h() click to toggle source
# File lib/M500_containers.rb, line 430
def to_h
end