# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a213816 Showing 1-1 of 1 %I A213816 #60 Oct 27 2024 17:55:30 %S A213816 1,1,1,2,2,3,4,6,7,11,13,20,24,37,44,68,81,125,149,230,274,423,504, %T A213816 778,927,1431,1705,2632,3136,4841,5768,8904,10609,16377,19513,30122, %U A213816 35890,55403,66012,101902,121415,187427,223317,344732,410744,634061,755476,1166220 %N A213816 Tribonacci sequences A000073 and A001590 interleaved. %C A213816 Bruce (see link) formulated the sequence using the following two equations: %C A213816 a(2n) = a(2n-1)+a(2n-3), %C A213816 a(2n+1) = a(2n-1)+a(2n-2), %C A213816 with n>1 and initial conditions a(1)=a(2)=a(3)= 1. %C A213816 These equations lead to a pair of tribonacci-type recurrence equations, for n>2: %C A213816 a(2n+1) = a(2n-1)+a(2n-3)+a(2n-5), %C A213816 a(2n+2) = a(2n)+a(2n-2)+a(2n-4). %C A213816 It could be more appropriate to consider the sequence as a kind of two-dimensional tribonacci sequence (a(2n-1),a(2n)), i.e. as (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),... since after the first three initial pairs, the next pair can be obtained by adding three previous pairs component-wise. However, the first three initial pairs (1, 1), (1, 2), (2, 3) are redundant in comparison with the original integer sequence that needs only three initial integers 1, 1 and 1. %C A213816 One method to construct the two-dimensional sequence is by using the well-known tribonacci-related morphism f with f(a) = ab, f(b) = ac, f(c) = a on the monoid of strings over the alphabet {a, b, c}. Using component-wise map, the following sequence of pairs is obtained: (c,b), (a, ac), (ab, aba), (abac, abacab), (abacaba, abacabaabac), (abacabaabacab, abacabaabacababacaba), ...; which is initialized by the pair (c,b) and any pair (x,y) is followed by (f(x),f(y)). The length of every string in every component consitutes the two-dimensional sequence. %H A213816 Vincenzo Librandi, Table of n, a(n) for n = 1..1000 %H A213816 Ian Bruce, A Modified Tribonacci Sequence, The Fibonacci Quarterly 22, no.3 (1984), 244-246. %H A213816 Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,1). %F A213816 G.f.: x*(1+x+x^3)/(1-x^2-x^4-x^6). [corrected by _G. C. Greubel_, Nov 03 2018] %F A213816 a(1) = a(2) = a(3) = 1; for n>1: %F A213816 a(2n) = a(2n-1) + a(2n-3), %F A213816 a(2n+1) = a(2n-1) + a(2n-2). %e A213816 The first 14 pairs of string and its length are %e A213816 (c, 1); %e A213816 (b, 1); %e A213816 (a, 1); %e A213816 (ac, 2); %e A213816 (ab, 2); %e A213816 (aba, 3); %e A213816 (abac, 4); %e A213816 (abacab, 6); %e A213816 (abacaba, 7); %e A213816 (abacabaabac, 11); %e A213816 (abacabaabacab, 13); %e A213816 (abacabaabacababacaba, 20); %e A213816 (abacabaabacababacabaabac, 24); %e A213816 (abacabaabacababacabaabacabacabaabacab, 37); ... %p A213816 with(StringTools): %p A213816 # The following procedure defines the morphism f %p A213816 Morphf := proc (x::string) local Start, L, Init, i; %p A213816 Init := x; %p A213816 L := length(Init); %p A213816 Start := 1; %p A213816 for i from Start to 2*L do %p A213816 if Init[i] = "c" then %p A213816 Init := Insert(Init, i, "a"); i := i+1; L := L+1; %p A213816 Init := Delete(Init, i-1 .. i-1); i := i-1; L := L-1; %p A213816 elif Init[i] = "b" then %p A213816 Init := Insert(Init, i, "ac"); i := i+2; L := L+2; %p A213816 Init := Delete(Init, i-2 .. i-2); i := i-1; L := L-1; %p A213816 elif Init[i] = "a" then %p A213816 Init := Insert(Init, i, "b"); i := i+1; L := L+1; %p A213816 end if; %p A213816 end do; %p A213816 eval(Init); %p A213816 end proc: %p A213816 #The following procedure is intended to create sequence of %p A213816 #strings c, b, a, ac, ab, aba, abac, ..., etc, obtained by %p A213816 #iterating the morphism f n times but it starts from the third %p A213816 #string "a", i.e. leaving the first two strings "c" and "b" %p A213816 #behind: %p A213816 TribWord := proc (x1, x2::string, n) local A, B, C, i; %p A213816 A := x1; B := x2; %p A213816 for i to n do %p A213816 if type(i, odd) = true then %p A213816 A := Morphf(A); %p A213816 C := A; %p A213816 else %p A213816 B := Morphf(B); C := B %p A213816 end if; %p A213816 end do; %p A213816 eval(C); %p A213816 end proc; %p A213816 #The following command will print a(1), a(2), ..., a(30). %p A213816 for i to 30 do %p A213816 printf("%d%s", length(TribWord("c", "b", i-2)), `, `); %p A213816 end do %t A213816 LinearRecurrence[{0, 1, 0, 1, 0, 1}, {1, 1, 1, 2, 2, 3}, 48] (* _Bruno Berselli_, Jun 25 2012 *) %o A213816 (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 %o A213816 (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 %Y A213816 Cf. A000073. %K A213816 nonn,easy,changed %O A213816 1,4 %A A213816 _Loeky Haryanto_, Jun 22 2012 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE