A286840 One of the two successive approximations up to 13^n for 13-adic integer sqrt(-1). Here the 5 (mod 13) case (except for n=0).
0, 5, 70, 239, 239, 143044, 1999509, 6826318, 6826318, 822557039, 85658552023, 1188526486815, 11941488851037, 291518510320809, 2108769149874327, 13920898306972194, 13920898306972194, 2675587335039691558, 63228498770709057089, 513050126578538629605
Offset: 0
Links
- Seiichi Manyama, Table of n, a(n) for n = 0..897
- Wikipedia, Hensel's Lemma.
Crossrefs
Programs
-
Mathematica
{0}~Join~Table[#&@@Select[PowerModList[-1, 1/2, 13^k], Mod[#, 13] == 5 &], {k, 20}] (* Giorgos Kalogeropoulos, Oct 21 2022 *)
-
PARI
a(n) = truncate(sqrt(-1+O(13^n))); \\ Michel Marcus, Aug 04 2017
-
Python
def A(k, m, n): ary=[0] a, mod = k, m for i in range(n): b=a%mod ary.append(b) a=b**m mod*=m return ary def a286840(n): return A(5, 13, n) print(a286840(100)) # Indranil Ghosh, Aug 03 2017, after Ruby
-
Ruby
def A(k, m, n) ary = [0] a, mod = k, m n.times{ b = a % mod ary << b a = b ** m mod *= m } ary end def A286840(n) A(5, 13, n) end p A286840(100)
Formula
a(0) = 0 and a(1) = 5, a(n) = a(n-1) + 9 * (a(n-1)^2 + 1) mod 13^n for n > 1.
a(n) == L(13^n,5) (mod 13^n) == ((5 + sqrt(29))/2)^(13^n) + ((5 - sqrt(29))/2)^(13^n) (mod 13^n), where L(n,x) denotes the n-th Lucas polynomial of A114525. - Peter Bala, Nov 20 2022