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.
%I A108122 #36 Jun 13 2015 00:51:50 %S A108122 1,1,1,4,7,16,34,73,157,337,724,1555,3340,7174,15409,33097,71089, %T A108122 152692,327967,704440,1513066,3249913,6980485,14993377,32204260, %U A108122 69171499,148573396,319120654,685438945,1472253649,3162252193,6792198436,14588956471,31335605536 %N A108122 G.f.: (1-2*x^2)/(1-x-2*x^2-x^3). %C A108122 The sequence counts row lengths of an array in which rows are obtained by the substitution 1->2, 2->3, 3->1,2,2,3 from previous rows: %C A108122 1; %C A108122 2; %C A108122 3; %C A108122 1,2,2,3; %C A108122 2,3,3,1,2,2,3; %C A108122 3,1,2,2,3,1,2,2,3,2,3,3,1,2,2,3; %H A108122 Robert Israel, <a href="/A108122/b108122.txt">Table of n, a(n) for n = 0..303</a> %H A108122 <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,1). %F A108122 a(n) = a(n-1) + 2*a(n-2) + a(n-3), starting 1,1,1. %F A108122 a(n) = A002478(n) - 2*A002478(n-2), n>1. %F A108122 a(n) = sum(m=0..n/2, sum(i=0..m, 2^i*binomial(n-2*m+1,m-i)*binomial(n-2*m+i,n-2*m))). - _Vladimir Kruchinin_, Dec 17 2011 %p A108122 a[0],a[1],a[2]:= 1,1,1: %p A108122 for n from 3 to 100 do %p A108122 a[n]:= a[n-1]+2*a[n-2]+a[n-3] %p A108122 od: %p A108122 seq(a[i],i=0..100); # _Robert Israel_, Jun 15 2014 %t A108122 s[1] = {2}; s[2] = {3}; s[3] = {1, 2, 2, 3}; t[a_] := Flatten[s /@ a]; p[0] = {1}; p[1] = t[p[0]]; p[n_] := t[p[n - 1]] a0 = Table[Length[p[i]], {i, 0, 20}] %t A108122 f[n_] := Sum[ 2^i*Binomial[n - 2 m, m - i]*Binomial[n - 2 m + i - 1, n - 2 m - 1], {m, 0, (n - 1)/2}, {i, 0, m}]; f[0] = 1; Array[f, 33, 0] (* or *) %t A108122 CoefficientList[ Series[(1 - 2 x^2)/(1 - x - 2 x^2 - x^3), {x, 0, 33}], x] (* or *) %t A108122 LinearRecurrence[ {1, 2, 1}, {1, 1, 1}, 34] (* or *) %t A108122 Length /@ NestList[ Flatten[ # /. {1 -> 2, 2 -> 3, 3 -> {1, 2, 2, 3}}] &, {1}, 24] (* _Robert G. Wilson v_, Jun 13 2014 *) %o A108122 (Maxima) %o A108122 a(n):=sum(sum(2^i*binomial(n-2*m+1,m-i)*binomial(n-2*m+i,n-2*m),i,0,m),m,0,(n)/2); /* _Vladimir Kruchinin_, Dec 17 2011 */ %Y A108122 Cf. A078007, A101399. %K A108122 nonn,easy %O A108122 0,4 %A A108122 _Roger L. Bagula_, Jun 04 2005 %E A108122 More terms from _Wesley Ivan Hurt_, Jun 14 2014