OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,19,0,-90).
FORMULA
a(2n) = 2*(10^n - 9^n); a(2n + 1) = 2*(10^n - 9^n) + 9*10^n - 8*9^n. - David Wasserman, Feb 14 2002
EXAMPLE
Up to 10^2 we find two numbers 1 and 11.
MATHEMATICA
Table[If[EvenQ[n], 2*(10^(n/2) - 9^(n/2)) , 2*(10^((n - 1)/2) - 9^((n - 1)/2)) + 9*10^((n - 1)/2) - 8*9^((n - 1)/2)], {n, 25}] (* G. C. Greubel, Oct 27 2016 *)
(* Alternative: *)
LinearRecurrence[{0, 19, 0, -90}, {1, 2, 20, 38}, 25] (* G. C. Greubel, Oct 27 2016 *)
PROG
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; -90, 0, 19, 0]^(n-1)*[1; 2; 20; 38])[1, 1] \\ Charles R Greathouse IV, May 29 2026
CROSSREFS
KEYWORD
nonn,base,easy,changed
AUTHOR
Patrick De Geest, Aug 15 1999
EXTENSIONS
More terms from David Wasserman, Feb 14 2002
STATUS
approved
