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.

A124696 Number of base-3 circular n-digit numbers with adjacent digits differing by 1 or less.

Original entry on oeis.org

1, 3, 7, 15, 35, 83, 199, 479, 1155, 2787, 6727, 16239, 39203, 94643, 228487, 551615, 1331715, 3215043, 7761799, 18738639, 45239075, 109216787, 263672647, 636562079, 1536796803, 3710155683, 8957108167, 21624372015, 52205852195
Offset: 0

Views

Author

R. H. Hardin, Dec 28 2006

Keywords

Comments

These are the number of smooth cyclic words of length n over the alphabet {1,2,3}. See theorem 3.3 in Knopfmacher and others. - Peter Luschny, Aug 13 2012
This is the main entry for 234 similar sequences. Cf. the link to the OEIS Wiki for a list, the programs and a derivation of the linear recurrences. - Georg Fischer, Apr 09 2021

Crossrefs

Cf. A002426, Row 3 of A276562.

Programs

  • Maple
    T := (n, k) -> `if`(n=0, 1, add((1 + 2*cos(j*Pi/(k + 1)))^n, j=1..k)):
    a := n -> simplify(T(n, 3)): seq(a(n), n=0..28); # Peter Luschny, Mar 28 2021

Formula

[Empirical] a(base,n) = a(base-1,n) + A002426(n+1) for base = 1..floor(n/2)+1.
a(n) = T(n,3) for n > 0, where T(n,k) = Sum_{j=1..k} (1 + 2*cos(j*Pi/(k + 1)))^n. - Peter Luschny, Aug 13 2012
From Colin Barker, Nov 26 2012: (Start)
a(n) = 1 + (1 - sqrt(2))^n + (1 + sqrt(2))^n for n > 0.
a(n) = 3*a(n-1) - a(n-2) - a(n-3) for n > 3.
G.f.: -(2*x^3 + x^2 - 1)/((x - 1)*(x^2 + 2*x - 1)). (End)
a(n) = A002203(n)+1, n>0. - R. J. Mathar, May 09 2023