OFFSET
0,2
COMMENTS
x = ...112623,
x^2 = ...666662 = -5.
LINKS
Robert Israel, Table of n, a(n) for n = 0..1182
Wikipedia, Hensel's Lemma.
FORMULA
a(0) = 0 and a(1) = 3, a(n) = a(n-1) + (a(n-1)^2 + 5) mod 7^n for n > 1.
EXAMPLE
a(1) = 3_7 = 3,
a(2) = 23_7 = 17,
a(3) = 623_7 = 311,
a(4) = 2623_7 = 997.
MAPLE
with(padic):
R:= [rootp(x^2+5, 7, 100)]:
R1:= op(select(t -> ratvaluep(evalp(t, 7, 1))=3, R)):
seq(ratvaluep(evalp(R1, 7, n)), n=0..100); # Robert Israel, Aug 13 2017
PROG
(PARI) a(n) = if (n, truncate(sqrt(-5+O(7^(n)))), 0)
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Aug 11 2017
STATUS
approved