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.

A070199 Number of palindromes of length <= n.

Original entry on oeis.org

10, 19, 109, 199, 1099, 1999, 10999, 19999, 109999, 199999, 1099999, 1999999, 10999999, 19999999, 109999999, 199999999, 1099999999, 1999999999, 10999999999, 19999999999, 109999999999, 199999999999, 1099999999999, 1999999999999, 10999999999999, 19999999999999
Offset: 1

Views

Author

Keywords

Crossrefs

Partial sums of A070252.
Cf. A050250.

Programs

  • Mathematica
    LinearRecurrence[{1,10,-10},{10,19,109},30] (* Harvey P. Dale, Mar 18 2016 *)
  • PARI
    Vec(x*(10+9*x-10*x^2)/((1-x)*(1-10*x^2)) + O(x^40)) \\ Colin Barker, Mar 17 2017
    
  • Python
    def A070199(n): return 10**(n>>1)*(11 if n&1 else 2)-1 # Chai Wah Wu, Jul 30 2025

Formula

From Colin Barker, Jun 30 2012: (Start)
a(n) = a(n-1) + 10*a(n-2) - 10*a(n-3).
G.f.: x*(10 + 9*x - 10*x^2)/((1 - x)*(1 - 10*x^2)). (End)
a(n) = (-2*sqrt(10)+10^(n/2)*(11+2*sqrt(10)+(-1)^n*(-11+2*sqrt(10))))/(2*sqrt(10)). - Harvey P. Dale, Mar 18 2016
From Colin Barker, Mar 17 2017: (Start)
a(n) = 2^(n/2 + 1)*5^(n/2) - 1 for n even.
a(n) = 11*10^((n-1)/2) - 1 for n odd. (End)
a(n) = A050250(n) + 1. - Andrew Howroyd, Oct 28 2020
E.g.f.: 2*cosh(sqrt(10)*x) - cosh(x) - 1 - sinh(x) + 11*sinh(sqrt(10)*x)/sqrt(10). - Stefano Spezia, Jul 01 2023