OFFSET
1,1
COMMENTS
24 * a(n) == 1 (mod 7^n).
LINKS
Eric Weisstein's World of Mathematics, Modular Inverse
Index entries for linear recurrences with constant coefficients, signature (1,49,-49).
FORMULA
a(n) = (17*7^n+1)/24 for n odd; a(n) = (23*7^n+1)/24 for n even.
G.f.: x*(5 + 42*x - 49*x^2)/(1 - x - 49*x^2 + 49*x^3). - Stefano Spezia, May 12 2021
EXAMPLE
a(1) = 5 because 24 * 5 == 1 (mod 7^1).
MATHEMATICA
LinearRecurrence[{1, 49, -49}, {5, 47, 243}, 23] (* Amiram Eldar, May 11 2021 *)
PROG
(PARI) a(n) = if(n%2 == 1, (17*7^n+1)/24, (23*7^n+1)/24);
(PARI) a(n) = lift(1/Mod(24, 7^n)) \\ Andrew Howroyd, May 11 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Washington Bomfim, May 11 2021
STATUS
approved