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.

A247594 a(n) = a(n-1) + a(n-2) + 3*a(n-3) with a(0) = 1, a(1) = 2, a(2) = 5.

This page as a plain text file.
%I A247594 #33 Aug 07 2022 07:53:23
%S A247594 1,2,5,10,21,46,97,206,441,938,1997,4258,9069,19318,41161,87686,
%T A247594 186801,397970,847829,1806202,3847941,8197630,17464177,37205630,
%U A247594 79262697,168860858,359740445,766389394,1632712413,3478323142,7410203737,15786664118,33631837281
%N A247594 a(n) = a(n-1) + a(n-2) + 3*a(n-3) with a(0) = 1, a(1) = 2, a(2) = 5.
%C A247594 a(n) is the number of words of length n in {A,B,C} such that no two consecutive letters are B and every letter C is adjacent to exactly one letter B.
%H A247594 Reinhard Zumkeller, <a href="/A247594/b247594.txt">Table of n, a(n) for n = 0..1000</a>
%H A247594 David Beckwith, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.121.05.455">Problem 11776</a>, The American Mathematical Monthly, 121 (2014), 455. See solution, 123 (May, 2016), 508-510.
%H A247594 Roberto Tauraso, <a href="http://www.mat.uniroma2.it/~tauraso/AMM/AMM11776.pdf">Solution of Problem 11776</a>.
%H A247594 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,3).
%F A247594 G.f.: (1 + x + 2*x^2) / (1 - x - x^2 - 3*x^3).
%F A247594 0 = a(n) - a(n-1) - a(n-2) - 3*a(n-3) for all n in Z.
%F A247594 From _Greg Dresden_, Aug 05 2022: (Start)
%F A247594 a(n) = b(n+3) - b(n) for b(n) = A103143(n).
%F A247594 a(n) = c(n+2) - 2*c(n-1) for c(n) = A123102(n). (End)
%e A247594 G.f. = 1 + 2*x + 5*x^2 + 10*x^3 + 21*x^4 + 46*x^5 + 97*x^6 + 206*x^7 + ...
%e A247594 a(3) = 10 with words [AAA, AAB, ABA, ABC, ACB, BAA, BAB, BCA, CBA, CBC].
%t A247594 LinearRecurrence[{1, 1, 3}, {1, 2, 5}, 40] (* _Vincenzo Librandi_, Aug 13 2015 *)
%o A247594 (PARI) {a(n) = if( n<0, polcoeff( (2*x + x^2 + x^3) / (3 + x + x^2 - x^3) + x * O(x^-n), -n), polcoeff( (1 + x + 2*x^2) / (1 - x - x^2 - 3*x^3) + x * O(x^n), n))};
%o A247594 (PARI) first(m)={my(v=vector(m));v[1]=1;v[2]=2;v[3]=5;for(i=4,m,v[i]=v[i-1]+v[i-2]+3*v[i-3]);v;} /* _Anders Hellström_, Aug 12 2015 */
%o A247594 (Haskell)
%o A247594 a247594 n = a247594_list !! n
%o A247594 a247594_list = 1 : 2 : 5 : zipWith (+)
%o A247594    (tail $ zipWith (+) a247594_list $ tail a247594_list)
%o A247594    (map (* 3) a247594_list)
%o A247594 -- _Reinhard Zumkeller_, Sep 21 2014
%o A247594 (Magma) I:=[1,2,5]; [n le 3 select I[n] else Self(n-1)+Self(n-2)+3*Self(n-3): n in [1..40]]; // _Vincenzo Librandi_, Aug 13 2015
%Y A247594 Cf. A103143, A123102.
%K A247594 nonn,easy
%O A247594 0,2
%A A247594 _Michael Somos_, Sep 20 2014