cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A050250 Number of nonzero palindromes less than 10^n.

This page as a plain text file.
%I A050250 #66 Feb 16 2025 08:32:40
%S A050250 9,18,108,198,1098,1998,10998,19998,109998,199998,1099998,1999998,
%T A050250 10999998,19999998,109999998,199999998,1099999998,1999999998,
%U A050250 10999999998,19999999998,109999999998,199999999998,1099999999998,1999999999998,10999999999998
%N A050250 Number of nonzero palindromes less than 10^n.
%H A050250 G. C. Greubel, <a href="/A050250/b050250.txt">Table of n, a(n) for n = 1..1000</a>
%H A050250 Dr. Math, <a href="https://web.archive.org/web/20200318230201/http://mathforum.org/library/drmath/view/57109.html">Palindromic Numbers</a>.
%H A050250 Dr. Math, <a href="https://web.archive.org/web/20200318230200/http://mathforum.org/library/drmath/view/56171.html">Palindromic Numbers</a>.
%H A050250 G. J. Simmons, <a href="/A002778/a002778_2.pdf">Palindromic powers</a>, J. Rec. Math., 3 (No. 2, 1970), 93-98. [Annotated scanned copy]
%H A050250 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PalindromicNumber.html">Palindromic Number.</a>
%H A050250 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,10,-10).
%F A050250 a(2*k) = 2*10^k - 2, a(2*k + 1) = 11*10^k - 2. - _Sascha Kurz_, Apr 14 2002
%F A050250 From _Jonathan Vos Post_, Jun 18 2008: (Start)
%F A050250 a(n) = Sum_{i=1..n} A050683(i).
%F A050250 a(n) = Sum_{i=1..n} 9*10^floor((i-1)/2).
%F A050250 a(n) = 9*Sum_{i=1..n} 10^floor((i-1)/2). (End)
%F A050250 From _Bruno Berselli_, Feb 15 2011: (Start)
%F A050250 G.f.: 9*x*(1+x)/((1-x)*(1-10*x^2)).
%F A050250 a(n) = (1/2)*10^((2*n + (-1)^n - 1)/4)*(13 - 9*(-1)^n) - 2. (End)
%F A050250 a(1)=9, a(2)=18, a(3)=108; for n>3, a(n) = a(n-1) + 10*a(n-2) - 10*a(n-3). - _Harvey P. Dale_, Jan 29 2012
%F A050250 a(n) = 10*a(n-2) + 18. - _R. J. Mathar_, Nov 07 2015
%F A050250 E.g.f.: 2*cosh(sqrt(10)*x) - 2*(cosh(x) + sinh(x)) + 11*sinh(sqrt(10)*x)/sqrt(10). - _Stefano Spezia_, Jun 11 2022
%p A050250 A050250List := proc(len);  local s, egf, ser; s:= 11/(2*sqrt(10));
%p A050250 egf := -2*exp(x) + (1-s)*exp(-sqrt(10)*x) + (1+s)*exp(sqrt(10)*x);
%p A050250 ser := series(egf, x, len+2): seq(simplify(n!*coeff(ser,x,n)), n = 1..len) end:
%p A050250 A050250List(25); # _Peter Luschny_, Jun 11 2022 after _Stefano Spezia_
%t A050250 LinearRecurrence[{1,10,-10},{9,18,108},30] (* _Harvey P. Dale_, Jan 29 2012 *)
%t A050250 CoefficientList[Series[2Cosh[Sqrt[10]x]-2(Cosh[x]+Sinh[x])+11Sinh[Sqrt[10]x]/Sqrt[10],{x,0,25}],x]Table[n!,{n,0,25}] (* _Stefano Spezia_, Jun 11 2022 *)
%o A050250 (PARI) a(n)=10^(n\2)*(13-9*(-1)^n)/2-2 \\ _Charles R Greathouse IV_, Jun 25 2017
%o A050250 (Python)
%o A050250 def a(n):
%o A050250   m = 10 ** (n >> 1)
%o A050250   if n & 1 == 0:
%o A050250     return (m - 1) << 1
%o A050250   else:
%o A050250     return (11 * m) - 2 # _DarĂ­o Clavijo_, Oct 16 2023
%Y A050250 Cf. A002113, A002778, A050683.
%K A050250 nonn,easy,base,nice
%O A050250 1,1
%A A050250 _Eric W. Weisstein_, Dec 11 1999
%E A050250 More terms from _Patrick De Geest_, Dec 15 1999
%E A050250 a(24)-a(25) from _Jonathan Vos Post_, Jun 18 2008