OFFSET
0,2
COMMENTS
x = ...256052,
x^2 = ...666664 = -3.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..1184
Wikipedia, Hensel's Lemma.
FORMULA
a(0) = 0 and a(1) = 2, a(n) = a(n-1) + 5 * (a(n-1)^2 + 3) mod 7^n for n > 1.
a(n) = L(7^n,2) (mod 7^n) = ( (1 + sqrt(2))^(7^n) + (1 - sqrt(2))^(7^n) ) (mod 7^n), where L(n,x) denotes the n-th Lucas polynomial of A114525. - Peter Bala, Nov 28 2022
EXAMPLE
a(1) = 2_7 = 2,
a(2) = 52_7 = 37,
a(3) = 52_7 = 37,
a(4) = 6052_7 = 2095,
a(5) = 56052_7 = 14100.
PROG
(PARI) a(n) = if (n, truncate(sqrt(-3+O(7^(n)))), 0)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Aug 11 2017
STATUS
approved