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.

Showing 1-2 of 2 results.

A329023 Number of length-n ternary words having at most 5 palindromic subwords (including the empty word).

Original entry on oeis.org

1, 3, 9, 27, 81, 42, 54, 66, 78, 96, 120, 144, 174, 216, 264, 318, 390, 480, 582, 708, 870, 1062, 1290, 1578, 1932, 2352, 2868, 3510, 4284, 5220, 6378, 7794, 9504, 11598, 14172, 17298, 21102, 25770, 31470, 38400, 46872, 57240, 69870, 85272, 104112, 127110, 155142
Offset: 0

Views

Author

Jeffrey Shallit, Nov 02 2019

Keywords

Examples

			For n=6 the examples are 001200, 001201, 010210, 011201, 012001, 012010, 012011, 012012, 012201 under permutation of the letters.
		

Crossrefs

Cf. A164317(n).

Programs

  • Mathematica
    LinearRecurrence[{0, 0, 1, 1}, {1, 3, 9, 27, 81, 42, 54, 66, 78}, 50] (* Paolo Xausa, Aug 26 2025 *)
  • PARI
    Vec((1 + 3*x + 9*x^2 + 26*x^3 + 77*x^4 + 30*x^5 + 18*x^6 - 42*x^7 - 45*x^8) / (1 - x^3 - x^4) + O(x^47)) \\ Colin Barker, Nov 02 2019; adapted to a(0)=1 by Georg Fischer, Dec 03 2019

Formula

a(n) = a(n-3) + a(n-4) for n >= 9.
a(n) = 6*A164317(n) for n >= 5.
G.f.: (1 + 3*x + 9*x^2 + 26*x^3 + 77*x^4 + 30*x^5 + 18*x^6 - 42*x^7 - 45*x^8) / (1 - x^3 - x^4). - Colin Barker, Nov 02 2019

Extensions

a(0) = 1 prepended by Jeffrey Shallit, Dec 02 2019

A321025 a(n) = sum of a(n-4) and a(n-5), with the lowest possible initial values that will generate a sequence where a(n) is always > a(n-1): 4, 5, 6, 7 and 8.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 20, 24, 28, 32, 37, 44, 52, 60, 69, 81, 96, 112, 129, 150, 177, 208, 241, 279, 327, 385, 449, 520, 606, 712, 834, 969, 1126, 1318, 1546, 1803, 2095, 2444, 2864, 3349, 3898, 4539, 5308, 6213, 7247, 8437, 9847, 11521, 13460, 15684
Offset: 1

Views

Author

Mathew Munro, Oct 30 2018

Keywords

Comments

A sum of prior terms in the sequence, like the Fibonacci and Padovan sequences.

Examples

			a(6) = a(6-4) + a(6-5) = a(2) + a(1) = 5 + 4 = 9.
		

Crossrefs

Programs

  • Mathematica
    Rest@ CoefficientList[Series[x (4 + 5 x + 6 x^2 + 7 x^3 + 4 x^4)/(1 - x^4 - x^5), {x, 0, 54}], x] (* Michael De Vlieger, Oct 31 2018 *)
  • PARI
    a(n) = if(n<=5, n+3, a(n-4) + a(n-5)); \\ Michel Marcus, Oct 31 2018
    
  • PARI
    Vec((4 + 5*x + 6*x^2 + 7*x^3 + 4*x^4)/(1 - x^4 - x^5) + O(x^50)) \\ Andrew Howroyd, Oct 31 2018

Formula

a(n) = a(n-4) + a(n-5) with a(1) = 4, a(2) = 5, a(3) = 6, a(4) = 7 and a(5) = 8.
G.f.: x*(4 + 5*x + 6*x^2 + 7*x^3 + 4*x^4)/(1 - x^4 - x^5). - Andrew Howroyd, Oct 31 2018

Extensions

a(19), a(20) corrected by Georg Fischer, May 24 2019
Showing 1-2 of 2 results.