A213816 Tribonacci sequences A000073 and A001590 interleaved.
1, 1, 1, 2, 2, 3, 4, 6, 7, 11, 13, 20, 24, 37, 44, 68, 81, 125, 149, 230, 274, 423, 504, 778, 927, 1431, 1705, 2632, 3136, 4841, 5768, 8904, 10609, 16377, 19513, 30122, 35890, 55403, 66012, 101902, 121415, 187427, 223317, 344732, 410744, 634061, 755476, 1166220
Offset: 1
Examples
The first 14 pairs of string and its length are (c, 1); (b, 1); (a, 1); (ac, 2); (ab, 2); (aba, 3); (abac, 4); (abacab, 6); (abacaba, 7); (abacabaabac, 11); (abacabaabacab, 13); (abacabaabacababacaba, 20); (abacabaabacababacabaabac, 24); (abacabaabacababacabaabacabacabaabacab, 37); ...
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Ian Bruce, A Modified Tribonacci Sequence, The Fibonacci Quarterly 22, no.3 (1984), 244-246.
- Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,1).
Crossrefs
Cf. A000073.
Programs
-
Magma
I:=[1, 1, 1, 2, 2, 3]; [n le 6 select I[n] else Self(n-2) + Self(n-4) + Self(n-6): n in [1..50]]; // G. C. Greubel, Nov 03 2018
-
Maple
with(StringTools): # The following procedure defines the morphism f Morphf := proc (x::string) local Start, L, Init, i; Init := x; L := length(Init); Start := 1; for i from Start to 2*L do if Init[i] = "c" then Init := Insert(Init, i, "a"); i := i+1; L := L+1; Init := Delete(Init, i-1 .. i-1); i := i-1; L := L-1; elif Init[i] = "b" then Init := Insert(Init, i, "ac"); i := i+2; L := L+2; Init := Delete(Init, i-2 .. i-2); i := i-1; L := L-1; elif Init[i] = "a" then Init := Insert(Init, i, "b"); i := i+1; L := L+1; end if; end do; eval(Init); end proc: #The following procedure is intended to create sequence of #strings c, b, a, ac, ab, aba, abac, ..., etc, obtained by #iterating the morphism f n times but it starts from the third #string "a", i.e. leaving the first two strings "c" and "b" #behind: TribWord := proc (x1, x2::string, n) local A, B, C, i; A := x1; B := x2; for i to n do if type(i, odd) = true then A := Morphf(A); C := A; else B := Morphf(B); C := B end if; end do; eval(C); end proc; #The following command will print a(1), a(2), ..., a(30). for i to 30 do printf("%d%s", length(TribWord("c", "b", i-2)), `, `); end do
-
Mathematica
LinearRecurrence[{0, 1, 0, 1, 0, 1}, {1, 1, 1, 2, 2, 3}, 48] (* Bruno Berselli, Jun 25 2012 *)
-
PARI
x='x+O('x^50); Vec(x*(1+x+x^3)/(1-x^2-x^4-x^6)) \\ G. C. Greubel, Nov 03 2018
Formula
G.f.: x*(1+x+x^3)/(1-x^2-x^4-x^6). [corrected by G. C. Greubel, Nov 03 2018]
a(1) = a(2) = a(3) = 1; for n>1:
a(2n) = a(2n-1) + a(2n-3),
a(2n+1) = a(2n-1) + a(2n-2).
Comments