OFFSET
0,2
COMMENTS
x = ...GC5A24,
x^2 = ...GGGGGG = -1.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..813
Wikipedia, Hensel's Lemma.
FORMULA
a(0) = 0 and a(1) = 4, a(n) = a(n-1) + 2 * (a(n-1)^2 + 1) mod 17^n for n > 1.
a(n) == L(17^n,4) (mod 17^n) == (2 + sqrt(5))^(17^n) + (2 - sqrt(5))^(17^n) (mod 17^n), where L(n,x) denotes the n-th Lucas polynomial of A114525. - Peter Bala, Dec 02 2022
EXAMPLE
a(1) = ( 4)_17 = 4,
a(2) = ( 24)_17 = 38,
a(3) = ( A24)_17 = 2928,
a(4) = (5A24)_17 = 27493.
PROG
(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 A286877(n)
A(4, 17, n)
end
p A286877(100)
(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 a286877(n):
return A(4, 17, n)
print(a286877(100)) # Indranil Ghosh, Aug 03 2017
(PARI) a(n) = truncate(sqrt(-1+O(17^n))); \\ Michel Marcus, Aug 04 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Aug 02 2017
STATUS
approved