%I #24 Sep 08 2022 08:44:58
%S 0,0,9,18,189,360,2799,5238,36189,67140,435699,804258,5021289,9238320,
%T 56191599,103144878,615724389,1128303900,6641519499,12154735098,
%U 70773675489,129392615880,746963079399,1364533542918,7822667714589
%N Number of nonzero palindromes < 10^n and containing at least one digit '0'.
%H G. C. Greubel, <a href="/A050685/b050685.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,19,-19,-90,90).
%F G.f.: (9*x^2*(x+1))/((1-x)*(1 - 9*x^2)*(1 - 10*x^2)). - Maksym Voznyy (voznyy(AT)mail.ru), Jul 28 2009
%F From _G. C. Greubel_, Oct 27 2016: (Start)
%F a(n) = a(n-1) + 19*a(n-2) - 19*a(n-3) - 90*a(n-4) + 90*a(n-5).
%F a(n) = (1/(4*sqrt(10)))*( 4*sqrt(10)*(1 + (-1)^n)*(10)^(n/2) + 22*(1 - (-1)^n)*(10)^(n/2) + sqrt(10)*(1 + ((-1)^n - 4)*3^(n + 1)) ).
%F E.g.f.: (1/(4*sqrt(10)))*( sqrt(10)*(3*exp(-3*x) + exp(x) -12*exp(3*x)) + 44*sinh(sqrt(10)*x) + 8*sqrt(10)*cosh(sqrt(10)*x)).
%F a(2*n) = (1/4)*(1 + 8*(10)^n - 9^(1 + n)), n>=1.
%F a(2*n+1) = (1/20)*(5 + 22*(10)^(n+1) - 25*9^(n+1)), n>=0. (End)
%e Up to 10^4 we find 18 numbers -> 101, 202, ..., 909, 1001, 2002, ... and 9009.
%t LinearRecurrence[{1,19,-19,-90,90},{0,0,9,18,189},25] (* or *) Table[If[OddQ[n], (5 + 22*(10)^((n + 1)/2) - 25*9^((n + 1)/2))/20, (1 + 8*(10)^(n/2) - 9^((n/2) + 1))/4], {n, 1, 10}] (* _G. C. Greubel_, Oct 27 2016 *)
%o (Magma) [IsOdd(n) select (5+22*(10)^((n+1) div 2)-25*9^((n+1) div 2)) div 20 else (1+8*(10)^(n div 2)-9^((n div 2)+1)) div 4:n in [1..30]]; // _Vincenzo Librandi_, Oct 29 2016
%Y Cf. A050250, A050684.
%K nonn,base
%O 1,3
%A _Patrick De Geest_, Aug 15 1999
%E More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
%E Corrected by _T. D. Noe_, Nov 08 2006
|