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-8 of 8 results.

A047081 a(n) = Sum_{k=0..n} T(n, k), array T as in A047080.

Original entry on oeis.org

1, 2, 3, 6, 11, 20, 37, 68, 125, 230, 423, 778, 1431, 2632, 4841, 8904, 16377, 30122, 55403, 101902, 187427, 344732, 634061, 1166220, 2145013, 3945294, 7256527, 13346834, 24548655, 45152016, 83047505, 152748176, 280947697, 516743378, 950439251, 1748130326, 3215312955, 5913882532, 10877325813
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n le 3 select n else Self(n-1) +Self(n-2) +Self(n-3): n in [1..60]]; // G. C. Greubel, Oct 31 2022
    
  • Mathematica
    LinearRecurrence[{1,1,1}, {1,2,3}, 61] (* G. C. Greubel, Oct 31 2022 *)
  • SageMath
    @CachedFunction
    def a(n): return (n+1) if (n<3) else a(n-1) +a(n-2) +a(n-3) # a = A047081
    [a(n) for n in (0..60)] # G. C. Greubel, Oct 31 2022

Formula

From G. C. Greubel, Oct 31 2022: (Start)
G.f.: (1 + x)/(1 - x - x^2 - x^3).
a(n) = A000073(n+1) + A000073(n+2). (End)
a(n) = Sum_{r root of x^3-x^2-x-1} r^n/(-3*r^2+5*r+2). - Fabian Pereyra, Nov 23 2024
a(n) = A001590(n+3). - R. J. Mathar, Mar 28 2025

Extensions

Data corrected by G. C. Greubel, Oct 31 2022

A163325 Pick digits at the even distance from the least significant end of the ternary expansion of n, then convert back to decimal.

Original entry on oeis.org

0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 6, 7, 8, 6, 7, 8, 6, 7, 8, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 6, 7, 8, 6, 7, 8, 6, 7, 8, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 6, 7, 8, 6, 7, 8, 6, 7, 8, 9, 10, 11, 9, 10, 11, 9, 10, 11, 12, 13, 14, 12, 13, 14
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Examples

			11 in ternary base (A007089) is written as '102' (1*9 + 0*3 + 2), from which we pick the "zeroth" and 2nd digits from the right, giving '12' = 1*3 + 2 = 5, thus a(11) = 5.
		

Crossrefs

A059905 is an analogous sequence for binary.

Programs

  • PARI
    a(n) = fromdigits(digits(n,9)%3,3); \\ Kevin Ryde, May 14 2020

Formula

a(0) = 0, a(n) = (n mod 3) + 3*a(floor(n/9)).
a(n) = Sum_{k>=0} {A030341(n,k)*b(k)} where b is the sequence (1,0,3,0,9,0,27,0,81,0,243,0... = A254006): powers of 3 alternating with zeros. - Philippe Deléham, Oct 22 2011
A037314(a(n)) + 3*A037314(A163326(n)) = n for all n.

Extensions

Edited by Charles R Greathouse IV, Nov 01 2009

A052993 a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3), with a(0)=a(1)=1, a(2)=4.

Original entry on oeis.org

1, 1, 4, 4, 13, 13, 40, 40, 121, 121, 364, 364, 1093, 1093, 3280, 3280, 9841, 9841, 29524, 29524, 88573, 88573, 265720, 265720, 797161, 797161, 2391484, 2391484, 7174453, 7174453, 21523360, 21523360, 64570081, 64570081, 193710244
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Crossrefs

Cf. A062318.

Programs

  • Magma
    I:=[1,1,4]; [n le 3 select I[n] else Self(n-1) +3*Self(n-2) -3*Self(n-3): n in [1..30]]; // G. C. Greubel, Nov 21 2018
    
  • Maple
    spec := [S,{S=Prod(Sequence(Prod(Union(Z,Z,Z),Z)),Sequence(Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
  • Mathematica
    (3^(1+Floor[(Range@40-1)/2])-1)/2 (* Federico Provvedi, Nov 22 2018 *)
    LinearRecurrence[{1,3,-3}, {1,1,4}, 30] (* or *) RecurrenceTable[{a[n + 2] == 3*a[n] + 1, a[0] == 1, a[1] == 1}, a, {n,0,30}] (* G. C. Greubel, Nov 21 2018 *)
  • PARI
    x='x+O('x^30); Vec(1/((1-3*x^2)*(1-x))) \\ G. C. Greubel, Nov 21 2018
    
  • Sage
    s=(1/((1-3*x^2)*(1-x))).series(x,30); s.coefficients(x, sparse=False) # G. C. Greubel, Nov 21 2018

Formula

G.f.: 1/((1-3*x^2)*(1-x)).
a(n+2) = 3*a(n) + 1, where a(0) = a(1) = 1.
a(n) = -1/2 + Sum((1/4)*(1+3*_alpha)*_alpha^(-1-n), _alpha = RootOf(-1 + 3*_Z^2)).
a(n) = Sum{k=0..n} 3^(k/2)*(1-(-1)^k)/(2*sqrt(3)). - Paul Barry, Jul 28 2004
a(n) = (3^(1+floor((n-1)/2)) - 1)/2. - Federico Provvedi, Nov 22 2018
a(n)-a(n-1) = A254006(n). - R. J. Mathar, Feb 27 2019

Extensions

More terms from James Sellers, Jun 06 2000

A124812 Number of 4-ary Lyndon words of length n with exactly four 1s.

Original entry on oeis.org

3, 21, 135, 702, 3402, 15282, 65610, 270540, 1082565, 4221639, 16120377, 60450138, 223205220, 813100356, 2927177028, 10428053400, 36804946455, 128817263385, 447470664795, 1543773631158, 5292938720718, 18044108743734, 61193066237550
Offset: 5

Views

Author

Mike Zabrocki, Nov 08 2006

Keywords

Examples

			a(6) = 21 because 1111ab, 1111ba, 111a1b, 111b1a, 11a11b for ab = 23, 24, 34 (accounting for 15 words) and 1111aa, 111a1a for a=2,3,4 (accounting for 6 words) are all Lyndon of length 6
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 3*(1-5*x+9*x^2-6*x^3)/((1-3*x)^4*(1-3*x^2)^2) )); // G. C. Greubel, Aug 09 2023
    
  • Mathematica
    3*(1-5*x+9*x^2-6*x^3)/((1-3*x)^4*(1-3*x^2)^2) + O[x]^23 // CoefficientList[#, x]& (* Jean-François Alcover, Sep 19 2017 *)
    LinearRecurrence[{12,-48,36,234,-540,0,972,-729}, {3,21,135,702,3402, 15282,65610,270540}, 41] (* G. C. Greubel, Aug 09 2023 *)
  • SageMath
    def A124812(n): return (3/4)*(3^(n-5)*binomial(n-1,3) - ((n-2)//2)*3^((n-6)//2)*((n-5)%2))
    [A124812(n) for n in range(5,41)] # G. C. Greubel, Aug 09 2023

Formula

O.g.f.: 3*x^5*(1 - 5*x + 9*x^2 - 6*x^3)/((1 - 3*x^2)^2*(1 - 3*x)^4).
G.f.: (1/4)*( (x/(1-3*x))^4 - x^4/(1-3*x^2)^2 ).
a(n) = (1/4)*Sum_{d|4,d|n} mu(d)*C(n/d - 1, (n-4)/d)*3^((n-4)/d).
a(n) = (1/4)*C(n-1, 3)*3^(n-4) if n is odd, a(n) = (1/4)*( C(n-1, 3)*3^(n-4) - (n/2-1)*3^((n-4)/2) ) if n is even.
a(n) = (3/4)*( 3^(n-5)*binomial(n-1, 3) - ((n-2)/2)*A254006(n-6) ). - G. C. Greubel, Aug 09 2023

A084156 Binomial transform of sinh(x)*cosh(sqrt(3)*x).

Original entry on oeis.org

0, 1, 2, 13, 44, 181, 662, 2521, 9368, 35113, 130922, 489061, 1824836, 6811741, 25420670, 94875313, 354076208, 1321442641, 4931681234, 18405321661, 68689566044, 256353060613, 956722558310, 3570537526921, 13325427195080, 49731172316281, 185599261007162
Offset: 0

Views

Author

Paul Barry, May 16 2003

Keywords

Crossrefs

Programs

  • Magma
    I:=[0,1,2,13]; [n le 4 select I[n] else 4*Self(n-1)+2*Self(n-2)-12*Self(n-3)+3*Self(n-4): n in [1..30]]; // Vincenzo Librandi, Feb 13 2014
    
  • Maple
    seq((2*simplify(ChebyshevT(n,2)) - (1+(-1)^n)*3^(n/2))/4, n = 0..30); # G. C. Greubel, Oct 10 2022
  • Mathematica
    LinearRecurrence[{4,2,-12,3},{0,1,2,13},30] (* Harvey P. Dale, Feb 01 2014 *)
  • SageMath
    def A084156(n): return (chebyshev_T(n, 2) - ((n+1)%2)*3^(n/2))/2
    [A084156(n) for n in range(31)] # G. C. Greubel, Oct 10 2022

Formula

a(n) = 4*a(n-1) + 2*a(n-2) - 12*a(n-3) + 3*a(n-4).
a(n) = ((2+sqrt(3))^n + (2-sqrt(3))^n - (sqrt(3))^n - (-sqrt(3))^n)/4.
G.f.: x*(1-2*x+3*x^2)/((1-3*x^2)(1-4*x+x^2)).
E.g.f. : exp(x)*sinh(x)*cosh(sqrt(3)*x).
a(n) = (2*ChebyshevT(n, 2) - (1+(-1)^n)*3^(n/2))/4 = (A001075(n) - A254006(n))/2. - G. C. Greubel, Oct 10 2022

A102756 Triangle T(n,k), 0<=k<=n, read by rows defined by: T(n,k) = T(n-1,k-1) + 2*T(n-1,k) + T(n-2,k-2) - T(n-2,k), T(0,0) = 1, T(n,k) = 0 if k < 0 or if n < k.

Original entry on oeis.org

1, 2, 1, 3, 4, 2, 4, 10, 10, 3, 5, 20, 31, 20, 5, 6, 35, 76, 78, 40, 8, 7, 56, 161, 232, 184, 76, 13, 8, 84, 308, 582, 636, 406, 142, 21, 9, 120, 546, 1296, 1831, 1604, 861, 260, 34, 10, 165, 912, 2640, 4630, 5215, 3820, 1766, 470, 55
Offset: 0

Views

Author

Philippe Deléham, Dec 18 2006

Keywords

Comments

Rising and falling diagonals are A008999, A124400.
Subtriangle of triangle given by (1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Feb 17 2012
Jointly generated with A209130 as an array of coefficients of polynomials u(n,x): initially, u(1,x)=v(1,x)=1; for n>1, u(n,x)=u(n-1,x)+(x+1)*v(n-1)x and v(n,x)=x*u(n-1,x)+(x+1)*v(n-1,x). See the Mathematica section. - Clark Kimberling, Mar 05 2012

Examples

			Triangle begins:
  1;
  2, 1;
  3, 4, 2;
  4, 10, 10, 3;
  5, 20, 31, 20, 5;
  6, 35, 76, 78, 40, 8;
  7, 56, 161, 232, 184, 76, 13;
  8, 84, 308, 582, 636, 406, 142, 21;
  9, 120, 546, 1296, 1831, 1604, 861, 260, 34;
  10, 165, 912, 2640, 4630, 5215, 3820, 1766, 470, 55;
Triangle (1, 1, -1, 1, 0, 0, ...) DELTA (0, 1, 1, -1, 0, 0, ...) begins:
  1
  1, 0
  2, 1, 0
  3, 4, 2, 0
  4, 10, 10, 3, 0
  5, 20, 31, 20, 5, 0
  6, 35, 76, 78, 40, 8, 0
  7, 56, 161, 232, 184, 76, 13, 0
		

Crossrefs

Programs

  • Mathematica
    u[1, x_] := 1; v[1, x_] := 1; z = 16;
    u[n_, x_] := u[n - 1, x] + (x + 1)*v[n - 1, x];
    v[n_, x_] := x*u[n - 1, x] + (x + 1)*v[n - 1, x];
    Table[Expand[u[n, x]], {n, 1, z/2}]
    Table[Expand[v[n, x]], {n, 1, z/2}]
    cu = Table[CoefficientList[u[n, x], x], {n, 1, z}];
    TableForm[cu]
    Flatten[%]    (* A102756 *)
    Table[Expand[v[n, x]], {n, 1, z}]
    cv = Table[CoefficientList[v[n, x], x], {n, 1, z}];
    TableForm[cv]
    Flatten[%]    (* A209130 *)
    (* Clark Kimberling, Mar 05 2012 *)

Formula

Sum_{k=0..n} x^k*T(n,k) = A254006(n), A000012(n), A000027(n+1), A000244(n), A015530(n+1), A015544(n+1) for x = -2, -1, 0, 1, 2, 3 respectively.
T(n,n-1) = 2*A001629(n+1) for n>=1.
T(n,n) = Fibonacci(n+1) = A000045(n+1).
T(n,0) = n+1.
T(n,1) = A000292(n) for n>=1.
T(n+1,2) = binomial(n+4,n-1)+binomial(n+2,n-1)= A051747(n) for n>=1.
G.f.: 1/(1-(2+y)*x+(1+y)*(1-y)*x^2). - Philippe Deléham, Feb 17 2012

A358027 Expansion of g.f.: (1 + x - 2*x^2 + 2*x^4)/((1-x)*(1-3*x^2)).

Original entry on oeis.org

1, 2, 3, 6, 11, 20, 35, 62, 107, 188, 323, 566, 971, 1700, 2915, 5102, 8747, 15308, 26243, 45926, 78731, 137780, 236195, 413342, 708587, 1240028, 2125763, 3720086, 6377291, 11160260, 19131875, 33480782, 57395627
Offset: 0

Views

Author

G. C. Greubel, Oct 31 2022

Keywords

Crossrefs

Programs

  • Magma
    I:=[3,6,11]; [1,2] cat [n le 3 select I[n] else Self(n-1) +3*Self(n-2) -3*Self(n-3): n in [1..60]];
    
  • Mathematica
    LinearRecurrence[{1,3,-3}, {1,2,3,6,11}, 61]
  • SageMath
    def A254006(n): return 3^(n/2)*(1 + (-1)^n)/2
    def A358027(n): return (1/3)*( 4*A254006(n) + 7*A254006(n-1) +2*int(n==0) + 2*int(n==1) - 3 )
    [A358027(n) for n in (0..60)]

Formula

a(n) = (1/3)*(2*[n=0] + 2*[n=1] - 3 + 4*A254006(n) + 7*A254006(n-1)).
a(n) = a(n-1) - 3*a(n-2) + 3*a(n-3), for n >= 5.
E.g.f.: (1/3)*( 2 + 2*x - 3*exp(x) + 4*cosh(sqrt(3)*x) + (7/sqrt(3))*sinh(sqrt(3)*x) ).
G.f.: (1 +x -2*x^2 +2*x^4)/((1-x)*(1-3*x^2)). - Clark Kimberling, Oct 31 2022

A319234 T(n, k) is the coefficient of x^k of the polynomial p(n) which is defined as the scalar part of P(n) = Q(x, 1, 1, 1) * P(n-1) for n > 0 and P(0) = Q(1, 0, 0, 0) where Q(a, b, c, d) is a quaternion, triangle read by rows.

Original entry on oeis.org

1, 0, 1, -3, 0, 1, 0, -9, 0, 1, 9, 0, -18, 0, 1, 0, 45, 0, -30, 0, 1, -27, 0, 135, 0, -45, 0, 1, 0, -189, 0, 315, 0, -63, 0, 1, 81, 0, -756, 0, 630, 0, -84, 0, 1, 0, 729, 0, -2268, 0, 1134, 0, -108, 0, 1, -243, 0, 3645, 0, -5670, 0, 1890, 0, -135, 0, 1
Offset: 0

Views

Author

Peter Luschny, Sep 14 2018

Keywords

Comments

The symbol '*' in the name refers to the noncommutative multiplication in Hamilton's division algebra. Traditionally Q(a, b, c, d) is written a + b*i + c*j + d*k.

Examples

			The list of polynomials starts 1, x, x^2 - 3, x^3 - 9*x, x^4 - 18*x^2 + 9, ... and the list of coefficients of the polynomials starts:
[0] [  1]
[1] [  0,    1]
[2] [ -3,    0,    1]
[3] [  0,   -9,    0,     1]
[4] [  9,    0,  -18,     0,   1]
[5] [  0,   45,    0,   -30,   0,    1]
[6] [-27,    0,  135,     0, -45,    0,   1]
[7] [  0, -189,    0,   315,   0,  -63,   0,    1]
[8] [ 81,    0, -756,     0, 630,    0, -84,    0, 1]
[9] [  0,  729,    0, -2268,   0, 1134,   0, -108, 0, 1]
		

Crossrefs

Inspired by the sister sequence A181738 of Roger L. Bagula.
Cf. A254006 (T(n,0) up to sign), A138230 (row sums).

Programs

  • Mathematica
    Needs["Quaternions`"]
    P[x_, 0 ] := Quaternion[1, 0, 0, 0];
    P[x_, n_] := P[x, n] = Quaternion[x, 1, 1, 1] ** P[x, n - 1];
    Table[CoefficientList[P[x, n][[1]], x], {n, 0, 10}] // Flatten
  • Sage
    R. = QQ[]
    K = R.fraction_field()
    H. = QuaternionAlgebra(K, -1, -1)
    def Q(a, b, c, d): return H(a + b*i + c*j + d*k)
    @cached_function
    def P(n):
        return Q(x, 1, 1, 1)*P(n-1) if n > 0 else Q(1, 0, 0, 0)
    def p(n): return P(n)[0].numerator().list()
    flatten([p(n) for n in (0..10)]) # Kudos to William Stein
Showing 1-8 of 8 results.