6 
 
        
      
      有理生成関数の係数を見つける
      
  数値のシーケンスをべき級数の係数として記述する場合、そのべき級数はそのシーケンスの(通常の)生成関数(またはGf)と呼ばれます。つまり、ある関数F(x)と一連の整数a(n)について次のようになっている場合: a(0) + a(1)x + a(2)x^2 + a(3)x^3 + a(4)x^4 + ... = F(x) 次にF(x)はの生成関数ですa。たとえば、幾何級数は次のことを示しています。 1 + x + x^2 + x^3 + x^4 + ... = 1/(1-x) したがって、の生成関数は1, 1, 1, ...です1/(1-x)。上記の式の両側を微分して乗算するxと、次の等式が得られます。 x + 2x^2 + 3x^3 + 4x^4 + ... = x/(1-x)^2 したがって、の生成関数は1, 2, 3, ...ですx/(1-x)^2。関数の生成は非常に強力なツールであり、それらを使用して多くの便利なことができます。簡単な紹介はここにありますが、本当に徹底的な説明のために、素晴らしい本生成機能があります。 この課題では、入力として有理関数(整数係数を持つ2つの多項式の商)を、最初に分子、次に分母の2つの整数係数の配列として受け取ります。たとえば、関数f(x) = x …
      
        
          
                   12
                
        
        
          
                  
                    code-golf 
                  
                    math 
                  
                    integer 
                  
                    polynomials 
                  
                    code-golf 
                  
                    math 
                  
                    abstract-algebra 
                  
                    restricted-time 
                  
                    code-golf 
                  
                    math 
                  
                    primes 
                  
                    code-golf 
                  
                    math 
                  
                    number 
                  
                    arithmetic 
                  
                    code-golf 
                  
                    quine 
                  
                    code-golf 
                  
                    number 
                  
                    sequence 
                  
                    code-golf 
                  
                    string 
                  
                    number 
                  
                    code-golf 
                  
                    array-manipulation 
                  
                    code-golf 
                  
                    number 
                  
                    code-golf 
                  
                    string 
                  
                    code-golf 
                  
                    arithmetic 
                  
                    code-golf 
                  
                    string 
                  
                    array-manipulation 
                  
                    rubiks-cube 
                  
                    code-golf 
                  
                    math 
                  
                    number 
                  
                    code-golf 
                  
                    tips 
                  
                    bash 
                  
                    code-golf 
                  
                    ascii-art 
                  
                    music 
                  
                    code-golf 
                  
                    arithmetic 
                  
                    code-golf 
                  
                    math 
                  
                    number 
                  
                    arithmetic 
                  
                    integer 
                  
                    code-golf 
                  
                    number 
                  
                    array-manipulation 
                  
                    code-golf 
                  
                    geometry 
                  
                    grid 
                  
                    set-partitions 
                  
                    code-golf 
                  
                    math 
                  
                    number 
                  
                    code-golf 
                  
                    combinatorics 
                  
                    code-golf 
                  
                    regular-expression 
                  
                    code-golf 
                  
                    permutations 
                  
                    code-golf 
                  
                    ascii-art 
                  
                    code-golf 
                  
                    number 
                  
                    array-manipulation 
                  
                    matrix 
                  
                    code-golf 
                  
                    kolmogorov-complexity 
                  
                    compile-time 
                  
                    cops-and-robbers 
                  
                    polyglot 
                  
                    cops-and-robbers 
                  
                    polyglot 
                  
                    code-golf 
                  
                    string 
                  
                    code-golf 
                  
                    string 
                  
                    ascii-art 
                  
                    matrix 
                  
                    animation 
                  
                    code-golf 
                  
                    ascii-art 
                  
                    code-golf 
                  
                    string 
                  
                    balanced-string 
                  
                    code-golf 
                  
                    integer 
                  
                    integer-partitions 
                  
                    expression-building