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.

Showing 1-3 of 3 results.

A030195 a(n) = 3*a(n-1) + 3*a(n-2), a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 3, 12, 45, 171, 648, 2457, 9315, 35316, 133893, 507627, 1924560, 7296561, 27663363, 104879772, 397629405, 1507527531, 5715470808, 21668995017, 82153397475, 311467177476, 1180861724853, 4476986706987, 16973545295520
Offset: 0

Views

Author

Keywords

Comments

Scaled Chebyshev U-polynomials evaluated at I*sqrt(3)/2.
Number of zeros in the substitution system {0 -> 1111100, 1 -> 10} at step n from initial string "1" (1 -> 10 -> 101111100 -> ...). - Ilya Gutkovskiy, Apr 10 2017
a(n+1) is the number of compositions of n having parts 1 and 2, both of three kinds. - Gregory L. Simay, Sep 21 2017
More generally, define a(n) = k*a(n-1) + k*a(n-2), a(0) = 0 and a(1) = 1. Then g.f. a(n) = 1/(1 - k*x - k*x^2) and a(n+1) is the number of compositions of n having parts 1 and 2, both of k kinds. - Gregory L. Simay, Sep 22 2017

Examples

			G.f. = x + 3*x^2 + 12*x^3 + 45*x^4 + 171*x^5 + 648*x^6 + 2457*x^7 + ...
		

Crossrefs

Programs

  • Haskell
    a030195 n = a030195_list !! n
    a030195_list =
       0 : 1 : map (* 3) (zipWith (+) a030195_list (tail a030195_list))
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Magma
    I:=[0,1]; [n le 2 select I[n] else 3*Self(n-1) + 3*Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 24 2018
  • Mathematica
    CoefficientList[Series[1/(1-3x-3x^2), {x, 0, 25}], x] (* Zerinvary Lajos, Mar 22 2007 *)
    LinearRecurrence[{3, 3}, {0, 1}, 24] (* Or *)
    RecurrenceTable[{a[n] == 3 a[n - 1] + 3 a[n - 2], a[0] == 0, a[1] == 1}, a, {n, 0, 23}] (* Robert G. Wilson v, Aug 18 2012 *)
  • PARI
    {a(n) = n--; polchebyshev(n, 2, I*sqrt(3)/2) * (-I*sqrt(3))^n};
    
  • Sage
    [lucas_number1(n,3,-3) for n in range(0, 25)] # Zerinvary Lajos, Apr 22 2009
    

Formula

a(n+1) = (-I*sqrt(3))^n*U(n, I*sqrt(3)/2).
G.f.: x / (1 - 3*x - 3*x^2).
a(n+1) = Sum_{k=0..floor(n/2)} 3^(n-k)*binomial(n-k, k). - Emeric Deutsch, Nov 14 2001
a(n) = (p^n - q^n)/sqrt(21); p = (3 + sqrt 21)/2, q = (3 - sqrt 21)/2. - Gary W. Adamson, Jul 02 2003
For n > 0, a(n) = Sum_{k=0..n-1} (2^k)*A063967(n-1,k). - Gerald McGarvey, Jul 23 2006
a(n+1) = Sum_{k=0..n} 2^k*A063967(n,k). - Philippe Deléham, Nov 03 2006

Extensions

Edited by Ralf Stephan, Aug 02 2004
I simplified the definition. As a result the offsets in some of the formulas may need to shifted by 1. - N. J. A. Sloane, Apr 01 2006
Formulas shifted to match offset. - Charles R Greathouse IV, Jan 31 2011

A172013 a(n) = 6*A142459(2*n, n)/(n+1).

Original entry on oeis.org

3, 118, 20343, 8530698, 6711481694, 8575821262764, 16243345162977759, 42826533033277249154, 150138953276380791799098, 675925071086215282939520628, 3802445616812067139270851537718, 26147695687370407271086390933321188, 215852465255521412471161891166554453788
Offset: 1

Views

Author

Roger L. Bagula, Nov 19 2010

Keywords

Crossrefs

Programs

  • Mathematica
    T[n_, k_, m_]:= T[n, k, m]= If[k==1 || k==n, 1, (m*n-m*k+1)*T[n-1, k-1, m] + (m*k-m+1)*T[n-1, k, m]];
    A142459[n_, k_]:= A142459[n, k]= T[n,k,4];
    A172013[n_]:= A172013[n]= 6*A142459[2*n, n]/(n+1);
    Table[A172013[n], {n,30}] (* modified by G. C. Greubel, Mar 18 2022 *)
  • Sage
    @CachedFunction
    def T(n,k,m):
        if (k==1 or k==n): return 1
        else: return (m*(n-k)+1)*T(n-1,k-1,m) + (m*k-m+1)*T(n-1,k,m)
    def A142459(n,k): return T(n,k,4)
    def A172013(n): return 6*A142459(2*n, n)/(n+1)
    [A172013(n) for n in (1..30)] # G. C. Greubel, Mar 18 2022

Formula

a(n) = 6*A142459(2*n, n)/(n+1).

Extensions

Offset and formula corrected by G. C. Greubel, Mar 18 2022

A172018 a(n) = A142458(2*n-1, n)/n.

Original entry on oeis.org

1, 4, 182, 27410, 8890310, 5051270688, 4459786293372, 5659222645997646, 9770821427711370950, 22041005972637205198568, 62967534725721252354766676, 222256499446324679350316816644, 950020052553444052606973276792092, 4836606673194788521307702032786510240, 28920975283745982162014025622769293094712
Offset: 1

Views

Author

Roger L. Bagula, Nov 19 2010

Keywords

Crossrefs

Programs

  • Mathematica
    T[n_, k_, m_]:= T[n, k, m]= If[k==1 || k==n, 1, (m*n-m*k+1)*T[n-1, k-1, m] + (m*k-m+1)*T[n-1, k, m]];
    A172018[n_]:= T[2*n-1, n, 3]/n;
    Table[A172018[n], {n, 30}] (* modified by G. C. Greubel, Mar 16 2022 *)
  • Sage
    @CachedFunction
    def T(n,k,m):
        if (k==1 or k==n): return 1
        else: return (m*(n-k)+1)*T(n-1,k-1,m) + (m*k-m+1)*T(n-1,k,m)
    def A172018(n): return T(2*n-1, n, 3)/n
    [A172018(n) for n in (1..30)] # G. C. Greubel, Mar 16 2022

Formula

a(n) = A142458(2*n-1, n)/n.

Extensions

Offset changed and more terms added by G. C. Greubel, Mar 16 2022
Showing 1-3 of 3 results.