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.

A240506 Number of length-n gap-free words on {1,2,3}.

This page as a plain text file.
%I A240506 #23 Mar 21 2021 17:35:00
%S A240506 1,3,7,21,67,213,667,2061,6307,19173,58027,175101,527347,1586133,
%T A240506 4766587,14316141,42981187,129009093,387158347,1161737181,3485735827,
%U A240506 10458256053,31376865307,94134790221,282412759267,847255055013,2541798719467,7625463267261
%N A240506 Number of length-n gap-free words on {1,2,3}.
%C A240506 A word is gap-free if it contains all the letters between the smallest and the largest element in the word.
%D A240506 S. Heubach and T. Mansour, Combinatorics of Compositions and Words, Chapman and Hall, 2009 page 86, Exercise 3.16.
%H A240506 Harvey P. Dale, <a href="/A240506/b240506.txt">Table of n, a(n) for n = 0..1000</a>
%H A240506 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (6,-11,6).
%F A240506 E.g.f.: 1 + Sum_{k=1..3} (3 - k + 1)*(exp(x) - 1)^k. Generally for gap free words on {1,2,...m} the e.g.f. is: 1 + Sum_{k=1..m} (m - k + 1)*(exp(x) - 1)^k.
%F A240506 From _Colin Barker_, Apr 07 2014: (Start)
%F A240506 a(n) = 2-2^n+3^n for n>0.
%F A240506 a(n) = 6*a(n-1)-11*a(n-2)+6*a(n-3) for n>3.
%F A240506 G.f.: -(6*x^3-3*x+1) / ((x-1)*(2*x-1)*(3*x-1)). (End)
%e A240506 a(3)=21 because there are 27 length 3 words on alphabet {1,2,3} but we don't count 113, 131, 133, 311, 313, or 331.
%t A240506 nn=25;Range[0,nn]!CoefficientList[Series[1+Sum[(3-k+1)(Exp[x]-1)^k,{k,1,3}],{x,0,nn}],x]
%t A240506 LinearRecurrence[{6,-11,6},{1,3,7,21},30] (* _Harvey P. Dale_, Dec 09 2015 *)
%K A240506 nonn
%O A240506 0,2
%A A240506 _Geoffrey Critzer_, Apr 06 2014