cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A290566 Coefficients in 5-adic expansion of 2^(1/3).

Original entry on oeis.org

3, 0, 2, 2, 3, 1, 4, 0, 2, 3, 0, 0, 4, 0, 4, 4, 3, 1, 1, 2, 0, 0, 2, 4, 0, 0, 2, 1, 4, 2, 2, 4, 0, 4, 2, 3, 1, 2, 3, 0, 0, 2, 0, 3, 4, 4, 2, 3, 2, 0, 4, 1, 2, 2, 3, 3, 0, 4, 2, 2, 3, 4, 4, 3, 4, 0, 2, 1, 2, 3, 4, 4, 2, 3, 3, 0, 3, 4, 1, 3, 1, 0, 2, 2, 1, 4, 4, 1
Offset: 0

Views

Author

Seiichi Manyama, Aug 06 2017

Keywords

Crossrefs

Programs

  • PARI
    Vecrev( digits( truncate( (2+O(5^100))^(1/3) ), 5) ) \\ Joerg Arndt, Aug 06 2017
  • Ruby
    require 'OpenSSL'
    def f_a(ary, a)
      (0..ary.size - 1).inject(0){|s, i| s + ary[i] * a ** i}
    end
    def df(ary)
      (1..ary.size - 1).map{|i| i * ary[i]}
    end
    def A(c_ary, k, m, n)
      x = OpenSSL::BN.new((-f_a(df(c_ary), k)).to_s).mod_inverse(m).to_i % m
      f_ary = c_ary.map{|i| x * i}
      f_ary[1] += 1
      d_ary = []
      ary = [0]
      a, mod = k, m
      (n + 1).times{|i|
        b = a % mod
        d_ary << (b - ary[-1]) / m ** i
        ary << b
        a = f_a(f_ary, b)
        mod *= m
      }
      d_ary
    end
    def A290566(n)
      A([-2, 0, 0, 1], 3, 5, n)
    end
    p A290566(100)