Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #25 Aug 24 2023 10:14:09
%S 0,0,1,18,261,3411,42048,499131,5770611,65427678,730784601,8065910511,
%T 88170256008,956125498671,10298661792111,110293085617038,
%U 1175325726682341,12470569310694411,131813055336390768,1388552621823766611,14583291094441416411,152746593446386647198
%N a(n) is the number of n-digit numbers that contain '22' in their decimal representation.
%C a(n) is also valid for '11', '33', '44', '55', '66', '77', '88' or '99' instead of '22'.
%H Felix Huber, <a href="/A365137/b365137.txt">Table of n, a(n) for n = 0..996</a>
%H Armin Widmer, <a href="/A365137/a365137_1.pdf">The number of Licence Plates that contain '22'</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (19,-81,-90).
%F a(n) = 19*a(n - 1) - 81*a(n - 2) - 90*a(n - 3) with a(0) = a(1) = 0, a(2) = 1 and a(3) = 18 for n >= 4.
%F a(n) = 9*10^(n - 1) - A057092(n) + A057092(n - 2) with a(0) = a(1) = 0 for n >= 2.
%F a(0) = 0, a(n) = 9*10^(n - 1) - (p^(n + 1) - q^(n + 1))/(3*sqrt(13)) + (p^(n - 1) - q^(n - 1))/(3*sqrt(13)) with p = (9 + 3*sqrt(13))/2 and q = (9 - 3*sqrt(13))/2 for n >= 1.
%F G.f.: x^2*(1 - x)/((1 - 10*x)*(1 - 9*x - 9*x^2)).
%F a(n) = A255372(n) for n <= 5.
%e a(2) = 1, the number 22 itself.
%e a(3) = 18, 10 numbers 22X plus 9 numbers X22 minus 1 number 222.
%e a(4) = 261, 100 numbers 22XX plus 90 numbers X22X plus 90 numbers XX22 minus 10 numbers 222X minus 9 numbers X222.
%p A365137 := proc(n) option remember; if n <= 1 then 0; elif n = 2 then 1; elif n = 3 then 18; else 19*procname(n - 1) - 81*procname(n - 2) - 90*procname(n - 3); end if; end proc; seq(A365137(n), n = 0 .. 21);
%t LinearRecurrence[{19, -81, -90}, {0, 0, 1, 18}, 22] (* _Robert P. P. McKone_, Aug 24 2023 *)
%Y Cf. A057092, A255372.
%K nonn,base,easy
%O 0,4
%A _Felix Huber_, Aug 23 2023