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.

A287833 Number of words of length n over the alphabet {0,1,...,10} such that no two consecutive terms have distance 2.

Original entry on oeis.org

1, 11, 103, 967, 9079, 85243, 800351, 7514541, 70554457, 662439857, 6219685951, 58396989455, 548292695881, 5147951686649, 48334414751849, 453814602701801, 4260891430727991, 40005754941255473, 375616336261903907, 3526683405274793053, 33112233522155404139
Offset: 0

Views

Author

David Nacin, Jun 07 2017

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{10, -2, -37, 16, 19, 1}, {1, 11, 103, 967, 9079, 85243}, 20]
  • Python
    def a(n):
     if n in [0,1,2,3,4,5]:
      return [1, 11, 103, 967, 9079, 85243][n]
     return 10*a(n-1) - 2*a(n-2) - 37*a(n-3) + 16*a(n-4) + 19*a(n-5) + a(n-6)

Formula

a(n) = 10*a(n-1) - 2*a(n-2) - 37*a(n-3) + 16*a(n-4) + 19*a(n-5) + a(n-6), a(0)=1, a(1)=11, a(2)=103, a(3)=967, a(4)=9079, a(5)=85243.
G.f.: (-1 - x + 5*x^2 + 4*x^3 - 6*x^4 - 3*x^5)/(-1 + 10*x - 2*x^2 - 37*x^3 + 16*x^4 + 19*x^5 + x^6).