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

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

Original entry on oeis.org

0, 1, 2, 7, 20, 61, 182, 547, 1640, 4921, 14762, 44287, 132860, 398581, 1195742, 3587227, 10761680, 32285041, 96855122, 290565367, 871696100, 2615088301, 7845264902, 23535794707, 70607384120, 211822152361, 635466457082
Offset: 0

Views

Author

Keywords

Comments

Number of walks of length n between any two distinct vertices of the complete graph K_4. - Paul Barry and Emeric Deutsch, Apr 01 2004
For n >= 1, a(n) is the number of integers k, 1 <= k <= 3^(n-1), whose ternary representation ends in an even number of zeros (see A007417). - Philippe Deléham, Mar 31 2004
Form the digraph with matrix A=[0,1,1,1;1,0,1,1;1,1,0,1;1,0,1,1]. A015518(n) corresponds to the (1,3) term of A^n. - Paul Barry, Oct 02 2004
The same sequence may be obtained by the following process. Starting a priori with the fraction 1/1, the denominators of fractions built according to the rule: add top and bottom to get the new bottom, add top and 4 times the bottom to get the new top. The limit of the sequence of fractions is 2. - Cino Hilliard, Sep 25 2005
(A046717(n))^2 + (2*a(n))^2 = A046717(2n). E.g., A046717(3) = 13, 2*a(3) = 14, A046717(6) = 365. 13^2 + 14^2 = 365. - Gary W. Adamson, Jun 17 2006
For n >= 2, number of ordered partitions of n-1 into parts of sizes 1 and 2 where there are two types of 1 (singletons) and three types of 2 (twins). For example, the number of possible configurations of families of n-1 male (M) and female (F) offspring considering only single births and twins, where the birth order of M/F/pair-of-twins is considered and there are three types of twins; namely, both F, both M, or one F and one M - where birth order within a pair of twins itself is disregarded. In particular, for a(3)=7, two children could be either: (1) F, then M; (2) M, then F; (3) F,F; (4) M,M; (5) F,F twins; (6) M,M twins; or (7) M,F twins (emphasizing that birth order is irrelevant here when both/all children are the same gender and when two children are within the same pair of twins). - Rick L. Shepherd, Sep 18 2004
a(n) is prime for n = {2, 3, 5, 7, 13, 23, 43, 281, 359, ...}, where only a(2) = 2 corresponds to a prime of the form (3^k - 1)/4. All prime terms, except a(2) = 2, are the primes of the form (3^k + 1)/4. Numbers k such that (3^k + 1)/4 is prime are listed in A007658. Note that all prime terms have prime indices. Prime terms are listed in A111010. - Alexander Adamchuk, Nov 19 2006
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=-2, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n)=charpoly(A,1). - Milan Janjic, Jan 26 2010
Select an odd size subset S from {1,2,...,n}, then select an even size subset from S. - Geoffrey Critzer, Mar 02 2010
a(n) is the number of ternary sequences of length n where the numbers of (0's, 1's) are (even, odd) respectively, and, by symmetry, the number of such sequences where those numbers are (odd, even) respectively. A122983 covers (even, even), and A081251 covers (odd, odd). - Toby Gottfried, Apr 18 2010
An elephant sequence, see A175654. For the corner squares just one A[5] vector, with decimal value 341, leads to this sequence (without the leading 0). For the central square this vector leads to the companion sequence A046717 (without the first leading 1). - Johannes W. Meijer, Aug 15 2010
Let R be the commutative algebra resulting from adjoining the elements of the Klein four-group to the integers (equivalently, K = Z[x,y,z]/{x*y - z, y*z - x, x*z - y, x^2 - 1, y^2 - 1, z^2 - 1}). Then a(n) is equal to the coefficients of x, y, and z in the expansion of (x + y + z)^n. - Joseph E. Cooper III (easonrevant(AT)gmail.com), Nov 06 2010
Pisano period lengths: 1, 2, 2, 4, 4, 2, 6, 8, 2, 4, 10, 4, 6, 6, 4, 16, 16, 2, 18, 4, ... - R. J. Mathar, Aug 10 2012
The ratio a(n+1)/a(n) converges to 3 as n approaches infinity. - Felix P. Muga II, Mar 09 2014
This is a divisibility sequence, also the values of Chebyshev polynomials, and also the number of ways of packing a 2 X n-1 rectangle with dominoes and unit squares. - R. K. Guy, Dec 16 2016
For n>0, gcd(a(n),a(n+1))=1. - Kengbo Lu, Jul 02 2020

References

  • John Derbyshire, Prime Obsession, Joseph Henry Press, April 2004, see p. 16.

Crossrefs

a(n) = A080926(n-1) + 1 = (1/3)*A054878(n+1) = (1/3)*abs(A084567(n+1)).
First differences of A033113 and A039300.
Partial sums of A046717.
The following sequences (and others) belong to the same family: A000129, A001333, A002532, A002533, A002605, A015518, A015519, A026150, A046717, A063727, A083098, A083099, A083100, A084057.
Cf. A046717.

Programs

  • Magma
    [Round(3^n/4): n in [0..30]]; // Vincenzo Librandi, Jun 24 2011
    
  • Mathematica
    Table[(3^n-(-1)^n)/4,{n,0,30}] (* Alexander Adamchuk, Nov 19 2006 *)
  • Maxima
    a(n):= round(3^n/4)$ /* Dimitri Papadopoulos, Nov 28 2023 */
  • PARI
    a(n)=round(3^n/4)
    
  • Python
    for n in range(0, 20): print(int((3**n-(-1)**n)/4), end=', ') # Stefano Spezia, Nov 30 2018
    
  • Sage
    [round(3^n/4) for n in range(0,27)]
    

Formula

G.f.: x/((1+x)*(1-3*x)).
a(n) = (3^n - (-1)^n)/4 = floor(3^n/4 + 1/2).
a(n) = 3^(n-1) - a(n-1). - Emeric Deutsch, Apr 01 2004
E.g.f.: (exp(3*x) - exp(-x))/4. Second inverse binomial transform of (5^n-1)/4, A003463. Inverse binomial transform for powers of 4, A000302 (when preceded by 0). - Paul Barry, Mar 28 2003
a(n) = Sum_{k=0..floor(n/2)} C(n, 2k+1)*2^(2k). - Paul Barry, May 14 2003
a(n) = Sum_{k=1..n} binomial(n, k)*(-1)^(n+k)*4^(k-1). - Paul Barry, Apr 02 2003
a(n+1) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*2^(n-2*k)*3^k. - Paul Barry, Jul 13 2004
a(n) = U(n-1, i/sqrt(3))(-i*sqrt(3))^(n-1), i^2=-1. - Paul Barry, Nov 17 2003
G.f.: x*(1+x)^2/(1 - 6*x^2 - 8*x^3 - 3*x^4) = x(1+x)^2/characteristic polynomial(x^4*adj(K_4)(1/x)). - Paul Barry, Feb 03 2004
a(n) = sum_{k=0..3^(n-1)} A014578(k) = -(-1)^n*A014983(n) = A051068(3^(n-1)), for n > 0. - Philippe Deléham, Mar 31 2004
E.g.f.: exp(x)*sinh(2*x)/2. - Paul Barry, Oct 02 2004
a(2*n+1) = A054880(n) + 1. - M. F. Hasler, Mar 20 2008
2*a(n) + (-1)^n = A046717(n). - M. F. Hasler, Mar 20 2008
a(n) = ((1+sqrt(4))^n - (1-sqrt(4))^n)/4. - Al Hakanson (hawkuu(AT)gmail.com), Dec 31 2008
a(n) = abs(A014983(n)). - Zerinvary Lajos, May 28 2009
a(n) = round(3^n/4). - Mircea Merca, Dec 28 2010
a(n) = Sum_{k=1,3,5,...} binomial(n,k)*2^(k-1). - Geoffrey Critzer, Mar 02 2010
From Sergei N. Gladkovskii, Jul 19 2012: (Start)
G.f.: G(0)/4 where G(k)= 1 - 1/(9^k - 3*x*81^k/(3*x*9^k - 1/(1 + 1/(3*9^k - 27*x*81^k/(9*x*9^k + 1/G(k+1)))))); (continued fraction).
E.g.f.: G(0)/4 where G(k)= 1 - 1/(9^k - 3*x*81^k/(3*x*9^k - (2*k+1)/(1 + 1/(3*9^k - 27*x*81^k/(9*x*9^k + (2*k+2)/G(k+1)))))); (continued fraction). (End)
G.f.: G(0)*x/(2*(1-x)), where G(k) = 1 + 1/(1 - x*(4*k-1)/(x*(4*k+3) - 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 26 2013
a(n+1) = Sum_{k = 0..n} A238801(n,k)*2^k. - Philippe Deléham, Mar 07 2014
a(n) = (-1)^(n-1)*Sum_{k=0..n-1} A135278(n-1,k)*(-4)^k = (-1)^(n-1)*Sum_{k=0..n-1} (-3)^k. Equals (-1)^(n-1)*Phi(n,-3), where Phi is the cyclotomic polynomial when n is an odd prime. (For n > 0.) - Tom Copeland, Apr 14 2014
a(n) = 2*A006342(n-1) - n mod 2 if n > 0, a(0)=0. - Yuchun Ji, Nov 30 2018
a(n) = 2*A033113(n-2) + n mod 2 if n > 0, a(0)=0. - Yuchun Ji, Aug 16 2019
a(2*k) = 2*A002452(k), a(2*k+1) = A066443(k). - Yuchun Ji, Aug 14 2019
a(n+1) = 2*Sum_{k=0..n} a(k) if n odd, and 1 + 2*Sum_{k=0..n} a(k) if n even. - Kengbo Lu, May 30 2020
a(n) = F(n) + Sum_{k=1..(n-1)} a(k)*L(n-k), for F(n) and L(n) the Fibonacci and Lucas numbers. - Kengbo Lu and Greg Dresden, Jun 05 2020
From Kengbo Lu, Jun 11 2020: (Start)
a(n) = A002605(n) + Sum_{k = 1..n-2} a(k)*A002605(n-k-1).
a(n) = A006130(n-1) + Sum_{k = 1..n-1} a(k)*A006130(n-k-1). (End)
a(2n) = Sum_{i>=0, j>=0} binomial(n-j-1,i)*binomial(n-i-1,j)* 2^(2n-2i-2j-1)* 3^(i+j). - Kengbo Lu, Jul 02 2020
a(n) = 3*a(n-1) - (-1)^n. - Dimitri Papadopoulos, Nov 28 2023
G.f.: x/((1 + x)*(1 - 3*x)) = Sum_{n >= 0} x^(n+1) * Product_{k = 1..n} (k + 3*x + 1)(1 + k*x) (a telescoping series). Cf. A007482. - Peter Bala, May 08 2024
From Peter Bala, Jun 29 2025: (Start)
For n >= 1, a(n+1) = 2^n * hypergeom([1/2 - (1/2)*n, -(1/2)*n], [-n], -3).
G.f. A(x) = x*exp(Sum_{n >= 1} a(2*n)/a(n)*x^n/n) = x + 2*x^2 + 7*x^3 + 20*x^4 + ....
sqrt(A(x)/x) is the g.f. of A002426.
The following series telescope:
Sum_{n >= 1} (-3)^n/(a(n)*a(n+1)) = -1; Sum_{n >= 1} (-3)^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = -1/98.
In general, for k >= 0, Sum_{n >= 1} (-3)^n/(a(n)*a(n+1)*...*a(n+2*k+1)) = -1/((a(1)*a(2)*...*a(2*k+1))*a(2*k+1)).
Sum_{n >= 1} 3^n/(a(n)*a(n+1)*a(n+2)) = 1/4; Sum_{n >= 1} 3^n/(a(n)*a(n+1)*a(n+2)* a(n+3)*a(n+4)) = 1/5600.
In general, for k >= 1, Sum_{n >= 1} 3^n/(a(n)*a(n+1)*...*a(n+2*k)) = 1/((a(1)*a(2)*...*a(2*k))*a(2*k)). (End)

Extensions

More terms from Emeric Deutsch, Apr 01 2004
Edited by Ralf Stephan, Aug 30 2004

A122983 a(n) = (2 + (-1)^n + 3^n)/4.

Original entry on oeis.org

1, 1, 3, 7, 21, 61, 183, 547, 1641, 4921, 14763, 44287, 132861, 398581, 1195743, 3587227, 10761681, 32285041, 96855123, 290565367, 871696101, 2615088301, 7845264903, 23535794707, 70607384121, 211822152361, 635466457083
Offset: 0

Views

Author

Paul Barry, Sep 22 2006

Keywords

Comments

Old definition was: "Binomial transform of aeration of A081294".
Binomial transform is A063376.
A122983 = (1,1,3,7,1,1,3,7,...) mod 10. - M. F. Hasler, Feb 25 2008
Equals row sums of triangle A158301. - Gary W. Adamson, Mar 15 2009
a(n) = the number of ternary sequences of length n where the numbers of (0's, 1's) are both even. A015518 covers the (odd, even) and (even, odd) cases, and A081251 covers (odd, odd). - Toby Gottfried, Apr 18 2010
This sequence also describes the number of moves of the k-th disk solving (non-optimally) the [RED ; NEUTRAL ; BLUE] pre-colored Magnetic Tower of Hanoi (MToH) puzzle. The sequence A183119 is the partial sums of the sequence in question (obviously describing the total number of moves associated with the specific solution algorithm). For other MToH-related sequences, Cf. A183111 - A183125.
Let B=[1,sqrt(2),0; sqrt(2),1,sqrt(2); 0,sqrt(2),1] be a 3 X 3 matrix. Then a(n)=[B^n](1,1), n=0,1,2,.... - _L. Edson Jeffery, Dec 21 2011
Also the domination number of the n-Hanoi graph. - Eric W. Weisstein, Jun 16 2017
Also the matching number of the n-Sierpinski gasket graph. - Eric W. Weisstein, Jun 17 2017
Let M = [1,1,1,0; 1,1,0,1; 1,0,1,1; 0,1,1,1], a 4 X 4 matrix. Then a(n) is the upper left entry in M^n. - Philippe Deléham, Aug 23 2020
Also the lower matching number (=independent domination number) of the n-Hanoi graph. - Eric W. Weisstein, Aug 01 2023

Crossrefs

Cf. a(j+1) = A137822(2^j) and these are the record values of A137822.
Cf. A054879 (bisection), A066443 (bisection). Row sums of A158303.

Programs

Formula

From Paul Barry, Jun 14 2007: (Start)
G.f.: (1-2*x-x^2)/((1-x)*(1+x)*(1-3*x));
a(n) = 3^n/4+(-1)^n/4+1/2;
E.g.f.: cosh(x)^2*exp(x). (End)
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3); a(0)=1, a(1)=1, a(2)=3. - Harvey P. Dale, Sep 03 2013
E.g.f.: Q(0)/2, where Q(k) = 1 + 3^k/( 2 - 2*(-1)^k/( 3^k + (-1)^k - 2*x*3^k/( 2*x + (k+1)*(-1)^k/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Dec 22 2013
a(2*n) = 3*a(2*n-1); a(2*n+1) = 3*a(2*n) - 2. - Philippe Deléham, Aug 23 2020

Extensions

Extended and corrected (existing Maple code) by M. F. Hasler, Feb 25 2008
Description changed to formula by Eric W. Weisstein, Jun 16 2017

A033113 Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,0.

Original entry on oeis.org

1, 3, 10, 30, 91, 273, 820, 2460, 7381, 22143, 66430, 199290, 597871, 1793613, 5380840, 16142520, 48427561, 145282683, 435848050, 1307544150, 3922632451, 11767897353, 35303692060, 105911076180, 317733228541, 953199685623
Offset: 1

Views

Author

Keywords

Comments

Written in base 3, this yields A056830. - M. F. Hasler, Oct 05 2018

Crossrefs

Programs

  • Magma
    [Round(3^(n+1)/8): n in [1..30]]; // Vincenzo Librandi, Jun 25 2011
  • Maple
    a[0]:=0: a[1]:=1: for n from 2 to 50 do a[n]:=2*a[n-1]+3*a[n-2]+1 od: seq(a[n], n=1..33);# Zerinvary Lajos, Dec 14 2008
    g:=x*(1/(1-3*x)/(1-x))/(1+x): gser:=series(g, x=0, 43): seq(coeff(gser, x, n), n=1..30);# Zerinvary Lajos, Jan 11 2009
    A033113 := proc(n) (9*3^(n-1)-(-1)^n-2)/8 ; end proc: # R. J. Mathar, Jan 08 2011
  • Mathematica
    Join[{a=1,b=3},Table[c=2*b+3*a+1;a=b;b=c,{n,60}]] (* Vladimir Joseph Stephan Orlovsky, Feb 01 2011 *)
    Module[{nn=30,d},d=PadRight[{},nn,{1,0}];Table[FromDigits[Take[d,n],3],{n,nn}]] (* or *) LinearRecurrence[{3,1,-3},{1,3,10},30] (* Harvey P. Dale, May 24 2014 *)
  • PARI
    a(n)=3^n*3\8 \\ Simplified by M. F. Hasler, Oct 06 2018
    
  • PARI
    A033113(n)=3^(n+1)>>3 \\ M. F. Hasler, Oct 05 2018
    

Formula

a(n) = A039300(n)-1.
a(n)+a(n+1) = A003462(n+1).
a(n) = 3*a(n-1) + a(n-2) -3*a(n-3). - R. J. Mathar, Jun 28 2010
From Paul Barry, Nov 12 2003: (Start)
G.f.: x/((1-x)*(1+x)*(1-3*x)).
a(n) = 2*a(n-1) + 3*a(n-2) + 1.
Partial sums of A015518. (End)
E.g.f.: (1/2)*exp(x)*(sinh(x))^2. - Paul Barry, Mar 12 2003
a(n) = Sum_{k=0..floor(n/2)} C(n+2, 2k+2)*4^k. - Paul Barry, Aug 24 2003
a(n) = Sum_{k=0..floor(n/2)} 3^(n-2*k); a(n) = Sum_{k=0..n} Sum_{j=0..k} (-1)^(j+k)*3^j. - Paul Barry, Nov 12 2003
Convolution of A000244 and A059841 (3^n and periodic{1, 0}). a(n) = Sum_{k=0..n} (1 + (-1)^(n-k))*3^k/2. - Paul Barry, Jul 19 2004
a(n) = round(3^(n+1)/8) = floor((3^(n+1)-1)/8) = ceiling((3^(n+1)-3)/8) = round((3^(n+1)-3)/8). a(n) = a(n-2) + 3^(n-1), n > 2. - Mircea Merca, Dec 27 2010
a(n) = floor((3^(n+1))/4) / 2 = A081251(n)/2, n >= 1. - Wolfdieter Lang, Apr 13 2012

A081250 Numbers k such that A081249(m)/m^2 has a local minimum for m = k.

Original entry on oeis.org

1, 3, 11, 33, 101, 303, 911, 2733, 8201, 24603, 73811, 221433, 664301, 1992903, 5978711, 17936133, 53808401, 161425203, 484275611, 1452826833, 4358480501, 13075441503, 39226324511, 117678973533, 353036920601, 1059110761803
Offset: 0

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Comments

The limit of the local minima, lim_{n->infinity} A081249(n)/n^2 = 1/10. For local maxima cf. A081251.

Examples

			11 is a term since A081249(10)/10^2 = 11/100 = 0.110, A081249(11)/11^2 = 13/121 = 0.107, A081249(12)/12^2 = 16/144 = 0.111.
		

Crossrefs

Programs

  • GAP
    List([0..30], n-> (5*3^n +(-1)^n -2)/4); # G. C. Greubel, Jul 14 2019
  • Magma
    [Floor(3^n*5/4): n in [0..30]]; // Vincenzo Librandi, Jun 10 2011
    
  • Maple
    a[0]:=1:a[1]:=3:for n from 2 to 50 do a[n]:=2*a[n-1]+3*a[n-2]+2 od: seq(a[n], n=0..30); # Zerinvary Lajos, Apr 28 2008
  • Mathematica
    Floor[5*3^Range[0, 30]/4] (* Wesley Ivan Hurt, Mar 30 2017 *)
  • PARI
    vector(30, n, n--; (5*3^n +(-1)^n -2)/4) \\ G. C. Greubel, Jul 14 2019
    
  • Sage
    [(5*3^n +(-1)^n -2)/4 for n in (0..30)] # G. C. Greubel, Jul 14 2019
    

Formula

a(n) = floor(3^n*5/4).
G.f.: x*(1+x^2)/((1-x)*(1+x)*(1-3*x)).
a(n) = 3*a(n-1) + 1*a(n-2) - 3*a(n-3).
a(n) = (5*3^n + (-1)^n - 2)/4. - Paul Barry, May 19 2003
a(n) = a(n-2) + 10*3^(n-2) for n > 1.
a(n+2) - a(n) = A005052(n).
a(2*n) = Sum_{j=1..n+1} A062107(2*j).
a(2*n+1) = Sum_{j=1..n+1} A062107(2*j+1).
With a leading 0, this is a(n) = (5*3^n - 6 + 4*0^n - 3*(-1)^n)/12, the binomial transform of A084183. - Paul Barry, May 19 2003
Convolution of 3^n and {1, 0, 2, 0, 2, 0, ...}. a(n) = Sum_{k=0..n} ((1 + (-1)^k) - 0^k)*3^(n-k) = Sum_{k=0..n} ((1 + (-1)^(n-k)) - 0^(n-k))3^k. - Paul Barry, Jul 19 2004
a(n) = 2*a(n-1) + 3*a(n-2) + 2, a(0)=1, a(1)=3. - Zerinvary Lajos, Apr 28 2008

Extensions

Offset changed from 1 to 0 by Vincenzo Librandi, Jun 10 2011

A081134 Distance to nearest power of 3.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7
Offset: 1

Views

Author

Klaus Brockhaus, Mar 08 2003

Keywords

Examples

			a(7) = 2 since 9 is closest power of 3 to 7 and 9 - 7 = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (h-> min(n-h, 3*h-n))(3^ilog[3](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 28 2021
  • Mathematica
    Flatten[Table[Join[Range[0,3^n],Range[3^n-1,1,-1]],{n,0,4}]] (* Harvey P. Dale, Dec 31 2013 *)
  • PARI
    a(n) = my (p=#digits(n,3)); return (min(n-3^(p-1), 3^p-n)) \\ Rémy Sigrist, Mar 24 2018
    
  • Python
    def A081134(n):
        kmin, kmax = 0,1
        while 3**kmax <= n:
            kmax *= 2
        while True:
            kmid = (kmax+kmin)//2
            if 3**kmid > n:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return min(n-3**kmin, 3*3**kmin-n) # Chai Wah Wu, Mar 31 2021

Formula

a(n) = min(n-3^floor(log(n)/log(3)), 3*3^floor(log(n)/log(3))-n).
From Peter Bala, Sep 30 2022: (Start)
a(n) = n - A006166(n); a(n) = 2*n - A003605(n).
a(1) = 0, a(2) = 1, a(3) = 0; thereafter, a(3*n) = 3*a(n), a(3*n+1) = 2*a(n) + a(n+1) and a(3*n+2) = a(n) + 2*a(n+1). (End)

A081249 Partial sums of A081134.

Original entry on oeis.org

0, 1, 1, 2, 4, 7, 9, 10, 10, 11, 13, 16, 20, 25, 31, 38, 46, 55, 63, 70, 76, 81, 85, 88, 90, 91, 91, 92, 94, 97, 101, 106, 112, 119, 127, 136, 146, 157, 169, 182, 196, 211, 227, 244, 262, 281, 301, 322, 344, 367, 391, 416, 442, 469, 495, 520, 544, 567, 589, 610, 630
Offset: 1

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Examples

			First seven terms of A081134 are 0,1,0,1,2,3,2, so a(7) = 9.
		

Programs

  • Mathematica
    Accumulate[Flatten[Table[Join[Range[0,3^n],Range[3^n-1,1,-1]],{n,0,4}]]] (* Harvey P. Dale, Sep 21 2016 *)
  • PARI
    {s=0; for(n=1,62,p=3^floor(0.1^25+log(n)/log(3)); print1(s=s+min(n-p,3*p-n),","))}

Formula

a(n) = sum{j=1..n, A081134(j)}.

A360036 Expansion of e.g.f. x*exp(x)*(sinh(x))^2.

Original entry on oeis.org

0, 0, 0, 6, 24, 100, 360, 1274, 4368, 14760, 49200, 162382, 531432, 1727180, 5580120, 17936130, 57395616, 182948560, 581130720, 1840247318, 5811307320, 18305618100, 57531942600, 180441092746, 564859072944, 1765184603000, 5507375961360, 17157594341214, 53379182394888
Offset: 0

Views

Author

Enrique Navarrete, Jan 22 2023

Keywords

Comments

a(n) is the number of ordered set partitions of an n-set into 3 sets such that the first and second sets have an odd number of elements and an element is selected from the third.

Examples

			The first 4 cases are shown below for a(4)=24 (where the element selected from the third set is in parenthesis):
{1}, {2}, {(3), 4}
{1}, {2}, {3, (4)}
{2}, {1}, {(3), 4}
{2}, {1}, {3, (4)}.
		

Crossrefs

Programs

  • Mathematica
    With[{nn=30},CoefficientList[Series[x Exp[x]Sinh[x]^2,{x,0,nn}],x] Range[0,nn]!] (* or *) LinearRecurrence[{6,-7,-12,17,6,-9},{0,0,0,6,24,100},30] (* Harvey P. Dale, Aug 17 2025 *)

Formula

a(n) = n*A081251(n-2) for n >= 3.
a(n) = n*(3^(n-1) + (-1)^(n-1) - 2)/4.
G.f.: 2*x^3*(3 - 6*x - x^2)/((1 - x)^2*(1 + x)^2*(1 - 3*x)^2). - Stefano Spezia, Jan 23 2023

A174395 The number of different 4-colorings for the vertices of all triangulated planar polygons on a base with n vertices if the colors of two adjacent boundary vertices are fixed.

Original entry on oeis.org

0, 2, 10, 40, 140, 462, 1470, 4580, 14080, 42922, 130130, 393120, 1184820, 3565382, 10717990, 32197660, 96680360, 290215842, 870997050, 2613690200, 7842468700, 23530202302, 70596199310, 211799782740, 635421717840, 1906309892762, 5719019156770, 17157236427280
Offset: 3

Views

Author

Patrick Labarque, Mar 18 2010, Mar 21 2010

Keywords

Comments

1st: The number of different vertex colorings with 4 or 3 colors for n vertices is: (3^(n-1)-2-(-1)^n)/4.
2nd: The number of 3-colorings is: (2^n -3-(-1)^n)/3.
The above sequence is the difference between the first and the second one.

Examples

			n=3 then a(3)=0 as there are no 4-colorings for the only triangle.
n=4 then a(4)=2 as there are six good colorings less four 3-colorings for the two triangulated quadrilaterals (4-gons).
n=5 then a(5)=10 as there are twenty good colorings less ten 3-colorings for the five triangulated pentagons.
		

Crossrefs

Equals A081251 (2,6,20...) minus A026644 (2,4,10...)

Programs

  • Magma
    [(3^n - 2^(n+2) + 6 + (-1)^n) / 12: n in [3..30]]; // Vincenzo Librandi, Sep 23 2013
  • Mathematica
    CoefficientList[Series[-2 x/((x - 1) (x + 1) (2 x - 1) (3 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 23 2013 *)
    LinearRecurrence[{5,-5,-5,6},{0,2,10,40},30] (* Harvey P. Dale, Aug 29 2015 *)
  • PARI
    Vec(-2*x^4/((x-1)*(x+1)*(2*x-1)*(3*x-1))  + O(x^100)) \\ Colin Barker, Sep 22 2013
    

Formula

a(n) = (3^n - 2^(n+2) + 6 + (-1)^n) / 12.
a(n) = 5*a(n-1)-5*a(n-2)-5*a(n-3)+6*a(n-4). G.f.: -2*x^4 / ((x-1)*(x+1)*(2*x-1)*(3*x-1)). - Colin Barker, Sep 22 2013

Extensions

More terms from Colin Barker, Sep 22 2013

A178222 Partial sums of floor(3^n/4).

Original entry on oeis.org

0, 2, 8, 28, 88, 270, 816, 2456, 7376, 22138, 66424, 199284, 597864, 1793606, 5380832, 16142512, 48427552, 145282674, 435848040, 1307544140, 3922632440, 11767897342, 35303692048, 105911076168, 317733228528
Offset: 1

Views

Author

Mircea Merca, Dec 26 2010

Keywords

Comments

Partial sums of A081251(n-1).

Examples

			a(3) = 0 + 2 + 6 = 8.
		

Crossrefs

Cf. A081251.

Programs

  • Magma
    [Floor((3*3^n-4*n-3)/8): n in [1..30]]; // Vincenzo Librandi, Jun 23 2011
  • Maple
    seq (round ((3*3^n-4*n-3)/8), n=1..25);
  • Mathematica
    Accumulate[Floor[3^Range[30]/4]] (* Harvey P. Dale, Nov 04 2011 *)
    CoefficientList[Series[2 x/((1 + x) (1 - 3 x) (1 - x)^2), {x, 0, 50}], x] (* Vincenzo Librandi, Mar 26 2014 *)

Formula

a(n) = round((3*3^n - 4*n - 4)/8).
a(n) = floor((3*3^n - 4*n - 3)/8).
a(n) = ceiling((3*3^n - 4*n - 5)/8).
a(n) = round((3*3^n - 4*n - 3)/8).
a(n) = a(n-2) + 3^(n-1) - 1, n > 2.
From Bruno Berselli, Jan 14 2011: (Start)
a(n) = (3*3^n - 4*n - 4 + (-1)^n)/8.
G.f.: 2*x^2/((1+x)*(1-3*x)*(1-x)^2). (End)
Showing 1-9 of 9 results.