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.

A290558 Coefficients in 7-adic expansion of sqrt(2).

This page as a plain text file.
%I A290558 #24 Dec 04 2022 13:06:15
%S A290558 4,5,4,0,5,4,5,4,2,0,0,4,5,5,6,4,5,5,2,0,5,3,4,0,0,3,1,1,0,3,2,1,6,5,
%T A290558 0,3,6,2,0,4,2,2,0,2,4,2,2,4,0,5,3,2,5,3,5,2,4,0,0,6,3,1,1,5,5,4,6,0,
%U A290558 0,5,5,4,2,2,2,4,3,0,0,3,0,5,2,2,4,4,5,3
%N A290558 Coefficients in 7-adic expansion of sqrt(2).
%H A290558 Seiichi Manyama, <a href="/A290558/b290558.txt">Table of n, a(n) for n = 0..10000</a>
%H A290558 Peter Bala, <a href="/A051277/a051277.pdf">Using Chebyshev polynomials to find the p-adic square roots of 2 and 3</a>, Dec 2022.
%F A290558 a(n) = 6 - A051277(n) for n > 0.
%F A290558 Equals the 7-adic limit as n -> oo of 2*T(7^n,2) = the 7-adic limit as n -> oo of (2 + sqrt(3))^(7^n) + (2 - sqrt(3))^(7^n), where T(n,x) denotes the n-th Chebyshev polynomial of the first kind. - _Peter Bala_, Nov 20 2022
%p A290558 t := proc(n) option remember; if n = 1 then 4 else irem(t(n-1)^7 - 7*t(n-1)^5 + 14*t(n-1)^3 - 7*t(n-1), 7^n) end if; end:
%p A290558 convert(t(100), base, 7); # _Peter Bala_, Nov 20 2022
%o A290558 (Ruby)
%o A290558 require 'OpenSSL'
%o A290558 def f_a(ary, a)
%o A290558   (0..ary.size - 1).inject(0){|s, i| s + ary[i] * a ** i}
%o A290558 end
%o A290558 def df(ary)
%o A290558   (1..ary.size - 1).map{|i| i * ary[i]}
%o A290558 end
%o A290558 def A(c_ary, k, m, n)
%o A290558   x = OpenSSL::BN.new((-f_a(df(c_ary), k)).to_s).mod_inverse(m).to_i % m
%o A290558   f_ary = c_ary.map{|i| x * i}
%o A290558   f_ary[1] += 1
%o A290558   d_ary = []
%o A290558   ary = [0]
%o A290558   a, mod = k, m
%o A290558   (n + 1).times{|i|
%o A290558     b = a % mod
%o A290558     d_ary << (b - ary[-1]) / m ** i
%o A290558     ary << b
%o A290558     a = f_a(f_ary, b)
%o A290558     mod *= m
%o A290558   }
%o A290558   d_ary
%o A290558 end
%o A290558 def A290558(n)
%o A290558   A([-2, 0, 1], 4, 7, n)
%o A290558 end
%o A290558 p A290558(100)
%o A290558 (PARI) { my(v=Vecrev( digits( truncate( (2+O(7^100))^(1/2) ), 7) )); vector(#v,k,6-v[k]+(k==1)) } \\ _Joerg Arndt_, Aug 06 2017
%Y A290558 Cf. A051277, A290559.
%K A290558 nonn
%O A290558 0,1
%A A290558 _Seiichi Manyama_, Aug 05 2017