OFFSET
0,2
COMMENTS
x = ...216213,
x^2 = ...000002 = 2.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..1184
Wikipedia, Hensel's Lemma.
FORMULA
a(0) = 0 and a(1) = 3, a(n) = a(n-1) + (a(n-1)^2 - 2) mod 7^n for n > 1.
a(n) == 2*T(7^n, 3/2) (mod 7^n) == ((3 + sqrt(5))/2)^(7^n) + ((3 - sqrt(5))/2)^(7^n) (mod 7^n), where T(n,x) denotes the n-th Chebyshev polynomial of the first kind. - Peter Bala, Dec 03 2022
EXAMPLE
a(1) = ( 3)_7 = 3,
a(2) = ( 13)_7 = 10,
a(3) = ( 213)_7 = 108,
a(4) = ( 6213)_7 = 2166,
a(5) = (16213)_7 = 4567.
PROG
(PARI) a(n) = truncate(sqrt(2+O(7^(n)))); \\ Michel Marcus, Aug 06 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Aug 05 2017
STATUS
approved