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.

A034945 Successive approximations to 7-adic integer sqrt(2).

Original entry on oeis.org

0, 3, 10, 108, 2166, 4567, 38181, 155830, 1802916, 24862120, 266983762, 1961835256, 5916488742, 19757775943, 116646786350, 9611769806236, 42844700375837, 275475214363044, 6789129606004840, 75182500718243698
Offset: 0

Views

Author

Keywords

References

  • K. Mahler, Introduction to p-Adic Numbers and Their Functions, Cambridge, 1973, p. 35.

Crossrefs

Cf. A290557.

Programs

  • PARI
    seq(n)={my(v=vector(n), i=1, k=0); while(i<#v, k++; my(t=truncate(sqrt(2 + O(7^k)))); if(t > v[i], i++; v[i]=t)); v} \\ Andrew Howroyd, Nov 03 2018
    
  • Python
    def a034945(n):
        ary=[0]
        a, mod=3, 7
        while len(ary) - 1Indranil Ghosh, Aug 03 2017, after Ruby
  • Ruby
    def A034945(n)
      ary = [0]
      a, mod = 3, 7
      while ary.size - 1 < n
        b = a % mod
        ary << b if b != ary[-1]
        a = b * b + b - 2
        mod *= 7
      end
      ary
    end
    p A034945(100) # Seiichi Manyama, Aug 03 2017