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.

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).

This page as a plain text file.
%I A286840 #45 Dec 04 2022 13:06:33
%S A286840 0,5,70,239,239,143044,1999509,6826318,6826318,822557039,85658552023,
%T A286840 1188526486815,11941488851037,291518510320809,2108769149874327,
%U A286840 13920898306972194,13920898306972194,2675587335039691558,63228498770709057089,513050126578538629605
%N 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).
%H A286840 Seiichi Manyama, <a href="/A286840/b286840.txt">Table of n, a(n) for n = 0..897</a>
%H A286840 Wikipedia, <a href="https://en.wikipedia.org/wiki/Hensel%27s_lemma">Hensel's Lemma</a>.
%F A286840 a(0) = 0 and a(1) = 5, a(n) = a(n-1) + 9 * (a(n-1)^2 + 1) mod 13^n for n > 1.
%F A286840 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
%t A286840 {0}~Join~Table[#&@@Select[PowerModList[-1, 1/2, 13^k], Mod[#, 13] == 5 &], {k, 20}]  (* _Giorgos Kalogeropoulos_, Oct 21 2022 *)
%o A286840 (Ruby)
%o A286840 def A(k, m, n)
%o A286840   ary = [0]
%o A286840   a, mod = k, m
%o A286840   n.times{
%o A286840     b = a % mod
%o A286840     ary << b
%o A286840     a = b ** m
%o A286840     mod *= m
%o A286840   }
%o A286840   ary
%o A286840 end
%o A286840 def A286840(n)
%o A286840   A(5, 13, n)
%o A286840 end
%o A286840 p A286840(100)
%o A286840 (Python)
%o A286840 def A(k, m, n):
%o A286840     ary=[0]
%o A286840     a, mod = k, m
%o A286840     for i in range(n):
%o A286840           b=a%mod
%o A286840           ary.append(b)
%o A286840           a=b**m
%o A286840           mod*=m
%o A286840     return ary
%o A286840 def a286840(n):
%o A286840     return A(5, 13, n)
%o A286840 print(a286840(100)) # _Indranil Ghosh_, Aug 03 2017, after Ruby
%o A286840 (PARI) a(n) = truncate(sqrt(-1+O(13^n))); \\ _Michel Marcus_, Aug 04 2017
%Y A286840 The two successive approximations up to p^n for p-adic integer sqrt(-1): A048898 and A048899 (p=5), this sequence and A286841 (p=13), A286877 and A286878 (p=17).
%Y A286840 Cf. A034944, A114525, A286838.
%K A286840 nonn,easy
%O A286840 0,2
%A A286840 _Seiichi Manyama_, Aug 01 2017