OFFSET
0,2
COMMENTS
x = ...450454,
x^2 = ...000002 = 2.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..1183
Wikipedia, Hensel's Lemma.
FORMULA
If n > 0, a(n) = 7^n - A290557(n).
a(0) = 0 and a(1) = 4, a(n) = a(n-1) + 6 * (a(n-1)^2 - 2) mod 7^n for n > 1.
a(n) == 2*T(7^n, 2) (mod 7^n) == (2 + sqrt(3))^(7^n) + (2 - sqrt(3))^(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) = ( 4)_7 = 4,
a(2) = ( 54)_7 = 39,
a(3) = ( 454)_7 = 235,
a(4) = ( 454)_7 = 235,
a(5) = (50454)_7 = 12240.
PROG
(PARI) a(n) = if (n==0, 0, 7^n - truncate(sqrt(2+O(7^n)))); \\ Michel Marcus, Aug 06 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Aug 05 2017
STATUS
approved