OFFSET
0,2
COMMENTS
x = ...04B6ED,
x^2 = ...GGGGGG = -1.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..812
Wikipedia, Hensel's Lemma.
FORMULA
If n > 0, a(n) = 17^n - A286877(n).
a(0) = 0 and a(1) = 13, a(n) = a(n-1) + 15 * (a(n-1)^2 + 1) mod 17^n for n > 1.
EXAMPLE
a(1) = ( D)_17 = 13,
a(2) = ( ED)_17 = 251,
a(3) = ( 6ED)_17 = 1985,
a(4) = (B6ED)_17 = 56028.
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 A286878(n)
A(13, 17, n)
end
p A286878(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 a286878(n): return A(13, 17, n)
print(a286878(100)) # Indranil Ghosh, Aug 03 2017, after Ruby
(PARI) a(n) = if (n, 17^n-truncate(sqrt(-1+O(17^n))), 0); \\ Michel Marcus, Aug 04 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Aug 02 2017
STATUS
approved