OFFSET
0,3
COMMENTS
x = ...140231,
x^2 = ...666661 = -6.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..1183
Wikipedia, Hensel's Lemma.
FORMULA
a(0) = 0 and a(1) = 1, a(n) = a(n-1) + 3 * (a(n-1)^2 + 6) mod 7^n for n > 1.
EXAMPLE
a(1) = 1_7 = 1,
a(2) = 31_7 = 22,
a(3) = 231_7 = 120,
a(4) = 231_7 = 120,
a(5) = 40231_7 = 9724.
MAPLE
with(padic):
R:= [rootp(x^2+6, 7, 100)]:
R1:= op(select(t -> ratvaluep(evalp(t, 7, 1))=1, R)):
seq(ratvaluep(evalp(R1, 7, n)), n=0..100); # Robert Israel, Aug 11 2017
PROG
(PARI) a(n) = if (n, truncate(sqrt(-6+O(7^(n)))), 0)
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Aug 10 2017
STATUS
approved