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-10 of 17 results. Next

A141325 a(n) = A000045(n) + A131531(n+3).

Original entry on oeis.org

1, 1, 1, 1, 3, 5, 9, 13, 21, 33, 55, 89, 145, 233, 377, 609, 987, 1597, 2585, 4181, 6765, 10945, 17711, 28657, 46369, 75025, 121393, 196417, 317811, 514229, 832041, 1346269, 2178309, 3524577, 5702887, 9227465, 14930353, 24157817, 39088169
Offset: 0

Views

Author

Paul Curtz, Aug 03 2008

Keywords

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x^2+x^4)/((1+x^3)*(1-x-x^2)) )); // G. C. Greubel, Jun 11 2019
    
  • Mathematica
    LinearRecurrence[{1,1,-1,1,1}, {1,1,1,1,3}, 40] (* Jean-François Alcover, Aug 16 2017 *)
    Table[Fibonacci@ n + Boole[Mod[n, 3] == 0] - 2 Boole[Mod[n, 6] == 3], {n, 0, 40}] (* Michael De Vlieger, Aug 16 2017 *)
  • PARI
    my(x='x+O('x^40)); Vec((1-x^2+x^4)/((1+x^3)*(1-x-x^2))) \\ G. C. Greubel, Jun 11 2019
    
  • Sage
    ((1-x^2+x^4)/((1+x^3)*(1-x-x^2))).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 11 2019

Formula

G.f.: (1-x^2+x^4)/((1+x)*(1-x+x^2)*(1-x-x^2)). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 12 2009

Extensions

Definition corrected by R. J. Mathar, Sep 16 2009
More terms from R. J. Mathar, Sep 27 2009

A167613 Array T(n,k) read by antidiagonals: the k-th term of the n-th difference of A131531.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 0, -1, -2, -3, 0, 0, 1, 3, 6, -1, -1, -1, -2, -5, -11, 0, 1, 2, 3, 5, 10, 21, 0, 0, -1, -3, -6, -11, -21, -42, 1, 1, 1, 2, 5, 11, 22, 43, 85, 0, -1, -2, -3, -5, -10, -21, -43, -86, -171, 0, 0, 1, 3, 6, 11, 21, 42, 85, 171, 342, -1, -1, -1, -2, -5, -11, -22, -43, -85, -170, -341, -683, 0, 1, 2, 3, 5, 10, 21, 43, 86, 171, 341, 682, 1365
Offset: 0

Views

Author

Paul Curtz, Nov 07 2009

Keywords

Comments

The array contains A131708(0) in diagonal 0, then -A024495(0..1) in diagonal 1, then A024493(0..2) in diagonal 2, then -A131708(0..3), then A024495(0..4), then -A024493(0..5).

Examples

			The table starts in row n=0 with columns k >= 0 as:
0, 0, 1, 0, 0, -1, 0, 0, 1, 0, 0, -1, 0, 0, 1, 0, 0, -1, 0, 0, 1, 0, 0 A131531
0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1 A092220
1, -2, 1, -1, 2, -1, 1, -2, 1, -1, 2, -1, 1, -2, 1, -1, 2, -1, 1, -2 A131556
-3, 3, -2, 3, -3, 2, -3, 3, -2, 3, -3, 2, -3, 3, -2, 3, -3, 2, -3 A164359
6, -5, 5, -6, 5, -5, 6, -5, 5, -6, 5, -5, 6, -5, 5, -6, 5, -5, 6, -5
-11, 10, -11, 11, -10, 11, -11, 10, -11, 11, -10, 11, -11, 10, -11
21, -21, 22, -21, 21, -22, 21, -21, 22, -21, 21, -22, 21, -21, 22
		

Crossrefs

Cf. A167617 (antidiagonal sums).

Programs

  • Maple
    A131531 := proc(n) op((n mod 6)+1,[0,0,1,0,0,-1]) ; end proc:
    A167613 := proc(n,k) option remember; if n= 0 then A131531(k); else procname(n-1,k+1)-procname(n-1,k) ; end if;end proc: # R. J. Mathar, Dec 17 2010
  • Mathematica
    nmax = 13;
    A131531 = Table[{0, 0, 1, 0, 0, -1}, {nmax}] // Flatten;
    T[n_] := T[n] = Differences[A131531, n];
    T[n_, k_] := T[n][[k]];
    Table[T[n-k, k], {n, 1, nmax}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 20 2023 *)

Formula

T(0,k) = A131531(k). T(n,k) = T(n-1,k+1) - T(n-1,k), n > 0.
T(n,n) = A001045(n). T(n,n+1) = -A001045(n). T(n,n+2) = A078008(n).
T(n,0) = -T(n,3) = (-1)^(n+1)*A024495(n).
T(n,1) = (-1)^(n+1)*A131708(n).
T(n,2) = (-1)^n*A024493(n).
T(n,k+6) = T(n,k).
a(n) = A131708(0), -A024495(0,1), A024493(0,1,2), -A131708(0,1,2,3), A024495(0,1,2,3,4), -A024493(0,1,2,3,4,5).

A113405 Expansion of x^3/(1 - 2*x + x^3 - 2*x^4) = x^3/( (1-2*x)*(1+x)*(1-x+x^2) ).

Original entry on oeis.org

0, 0, 0, 1, 2, 4, 7, 14, 28, 57, 114, 228, 455, 910, 1820, 3641, 7282, 14564, 29127, 58254, 116508, 233017, 466034, 932068, 1864135, 3728270, 7456540, 14913081, 29826162, 59652324, 119304647, 238609294, 477218588, 954437177, 1908874354, 3817748708
Offset: 0

Views

Author

Paul Barry, Oct 28 2005

Keywords

Comments

A transform of the Jacobsthal numbers. A059633 is the equivalent transform of the Fibonacci numbers.
Paul Curtz, Aug 05 2007, observes that the inverse binomial transform of 0,0,0,1,2,4,7,14,28,57,114,228,455,910,1820,... gives the same sequence up to signs. That is, the extended sequence is an eigensequence for the inverse binomial transform (an autosequence).
The round() function enables the closed (non-recurrence) formula to take a very simple form: see Formula section. This can be generalized without loss of simplicity to a(n) = round(b^n/c), where b and c are very small, incommensurate integers (c may also be an integer fraction). Particular choices of small integers for b and c produce a number of well-known sequences which are usually defined by a recurrence - see Cross Reference. - Ross Drewe, Sep 03 2009

Crossrefs

From Ross Drewe, Sep 03 2009: (Start)
Other sequences a(n) = round(b^n / c), where b and c are very small integers:
A001045 b = 2; c = 3
A007910 b = 2; c = 5
A016029 b = 2; c = 5/3
A077947 b = 2; c = 7
abs(A078043) b = 2; c = 7/3
A007051 b = 3; c = 2
A015518 b = 3; c = 4
A034478 b = 5; c = 2
A003463 b = 5; c = 4
A015531 b = 5; c = 6
(End)

Programs

  • Magma
    [Round(2^n/9): n in [0..40]]; // Vincenzo Librandi, Aug 11 2011
    
  • Maple
    A010892 := proc(n) op((n mod 6)+1,[1,1,0,-1,-1,0]) ; end proc:
    A113405 := proc(n) (2^n-(-1)^n)/9 -A010892(n-1)/3; end proc: # R. J. Mathar, Dec 17 2010
  • Mathematica
    CoefficientList[Series[x^3/(1-2x+x^3-2x^4),{x,0,40}],x] (* or *) LinearRecurrence[{2,0,-1,2},{0,0,0,1},40] (* Harvey P. Dale, Apr 30 2011 *)
  • PARI
    a(n)=2^n\/9 \\ Charles R Greathouse IV, Jun 05 2011
    
  • Python
    def A113405(n): return ((1<Chai Wah Wu, Apr 17 2025

Formula

a(n) = 2a(n-1) - a(n-3) + 2a(n-4).
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k,k)*A001045(k).
a(n) = Sum_{k=0..n} binomial((n+k)/2,k)*A001045((n-k)/2)*(1+(-1)^(n-k))/2.
a(3n) = A015565(n), a(3n+1) = 2*A015565(n), a(3n+2) = 4*A015565(n). - Paul Curtz, Nov 30 2007
From Paul Curtz, Dec 16 2007: (Start)
a(n+1) - 2a(n) = A131531(n).
a(n) + a(n+3) = 2^n. (End)
a(n) = round(2^n/9). - Ross Drewe, Sep 03 2009
9*a(n) = 2^n + (-1)^n - 3*A010892(n). - R. J. Mathar, Mar 24 2018

Extensions

Edited by N. J. A. Sloane, Dec 13 2007

A088911 Period 6: repeat [1, 1, 1, 0, 0, 0].

Original entry on oeis.org

1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Oct 22 2003

Keywords

Comments

For periodic sequences having a period of 2*k and composed of k ones followed by k zeros we have a(n) = floor(((n+k) mod 2*k)/k). Sequences of this form are A000035(n+1) (k=1), A133872(n) (k=2), this sequence (k=3), A131078(n) (k=4), and A112713(n-1) (k=5). - Gary Detlefs, May 17 2011

Crossrefs

Programs

  • Magma
    &cat [[1, 1, 1, 0, 0, 0]^^30]; // Wesley Ivan Hurt, Jul 05 2016
    
  • Maple
    seq(op([1, 1, 1, 0, 0, 0]), n=0..40); # Wesley Ivan Hurt, Jul 05 2016
  • Mathematica
    CoefficientList[Series[(1 + x + x^2)/(1 - x^6), {x, 0, 50}], x]
    Flatten[Table[{1,1,1,0,0,0},{20}]] (* Harvey P. Dale, Jul 17 2011 *)
  • PARI
    a(n)=n%6<3 \\ Jaume Oliver Lafont, Mar 17 2009
    
  • Python
    def A088911(n): return int(n % 6 < 3) # Chai Wah Wu, May 25 2022

Formula

G.f.: (1+x+x^2)/(1-x^6) = 1/((1-x)*(1+x)*(1-x+x^2)).
a(n) = a(n-6) for n>=6, a(0)=a(1)=a(2)=1, a(3)=a(4)=a(5)=0.
a(n) = ((-1)^floor((5*n + 2)/3) + 1)/2 = ( (-1)^floor(n/3) + 1 )/2. [Simplified by Bruno Berselli, Jul 09 2013]
a(n) = Sum_{k=0..floor(n/2)} U(n-2k, 1/2). - Paul Barry, Nov 15 2003
From Paul Barry, Mar 14 2004: (Start)
Partial sums of expansion of 1/(1+x^3), see A131531.
a(n) = 2*sin(Pi*n/3 + Pi/6)/3 + cos(Pi*n)/6 + 1/2. (End)
a(n) = floor(((n+3) mod 6)/3).
a(n) = floor((5*n-1)/3) mod 2. - Gary Detlefs, May 17 2011
a(n) = 1/2 + cos(Pi*n/3)/3 + sin(Pi*n/3)/sqrt(3) + (-1)^n/6. - R. J. Mathar, Oct 08 2011
a(n) = floor(((n+2)^2)/3) mod 2. - Wesley Ivan Hurt, Jun 29 2013
a(n) = A079979(n) + A079979(n-1) + A079979(n-2). - R. J. Mathar, Jul 10 2015
a(n) = a(n-1) - a(n-3) + a(n-4) for n > 3. - Wesley Ivan Hurt, Jul 05 2016
a(n) = 2*floor(n/6) - floor(n/3) + 1. - Ridouane Oudra, Dec 14 2021
E.g.f.: (2*cosh(x) + exp(x/2)*(cos(sqrt(3)*x/2) + sqrt(3)*sin(sqrt(3)*x/2)) + sinh(x))/3. - Stefano Spezia, Aug 04 2025

A130151 Period 6: repeat [1, 1, 1, -1, -1, -1].

Original entry on oeis.org

1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1
Offset: 0

Views

Author

Paul Curtz, Aug 03 2007

Keywords

Examples

			G.f. = 1 + x + x^2 - x^3 - x^4 - x^5 + x^6 + x^7 + x^8 - x^9 - x^10 - x^11 + ...
G.f. = q + q^3 + q^5 - q^7 - q^9 - q^11 + q^13 + q^15 + q^17 - q^19 - q^21 + ...
		

Crossrefs

Programs

Formula

a(n+6) = a(n), a(0)=a(1)=a(2)=-a(3)=-a(4)=-a(5)=1.
a(n) = ((-1)^n * (4 * (cos((2*n + 1)*Pi/3) + cos(n*Pi)) + 1) - 4) / 3. - Federico Acha Neckar (f0383864(AT)hotmail.com), Sep 01 2007
a(n) = (-1)^n * (4 * cos((2*n + 1) * Pi/3) + 1) / 3. - Federico Acha Neckar (f0383864(AT)hotmail.com), Sep 02 2007
G.f.: (1+x+x^2)/((1+x)*(x^2-x+1)). - R. J. Mathar, Nov 14 2007
a(n) = 3*a(n-1) - a(n-3) + 3*a(n-4) for n>3. - Paul Curtz, Nov 22 2007
a(n) = (-1)^floor(n/3). Compare with A057077, A143621 and A143622. Define E(k) = Sum_{n >= 0} a(n)*n^k/n! for k = 0,1,2,... . Then E(k) is an integral linear combination of E(0), E(1) and E(2) (a Dobinski-type relation). Precisely, E(k) = A143628(k)*E(0) + A143629(k)*E(1) + A143630(k)*E(2). - Peter Bala, Aug 28 2008
Euler transform of length 6 sequence [1, 0, -2, 0, 0, 1]. - Michael Somos, Feb 26 2011
a(n) = b(2*n + 1) where b(n) is multiplicative with b(2^e) = 0^e, b(3^e) = -(-1)^e if e>0, b(p^e) = 1 if p == 1 (mod 4), b(p^e) = (-1)^e if p == 3 (mod 4) and p>3. - Michael Somos, Feb 26 2011
a(n + 3) = a(-1 - n) = -a(n) for all n in Z. - Michael Somos, Feb 26 2011
a(n) = (-1)^n * A257075(n) for all n in Z. - Michael Somos, Apr 15 2015
G.f.: 1 / (1 - x / (1 + 2*x^2 / (1 + x / (1 + x / (1 - x))))). - Michael Somos, Apr 15 2015
From Wesley Ivan Hurt, Jul 05 2016: (Start)
a(n) + a(n-3) = 0 for n>2.
a(n) = (cos(n*Pi) + 2*cos(n*Pi/3) + 2*sqrt(3)*sin(n*Pi/3)) / 3. (End)
a(n)*a(n-4) = a(n-1)*a(n-3) for all n in Z. - Michael Somos, Feb 25 2020

A092220 Expansion of x*(1-x)/ ((1+x)*(1-x+x^2)) in powers of x.

Original entry on oeis.org

0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1, 1, 0, 1, -1, 0, -1
Offset: 0

Views

Author

Paul Barry, Feb 25 2004

Keywords

Comments

Period 6: repeat [0, 1, -1, 0, -1, 1]. - Joerg Arndt, Aug 28 2024
Transform of the Jacobsthal numbers A001045 under the Riordan array A102587. - Paul Barry, Jul 14 2005
The BINOMIAL transform generates (-1)^(n+1)*A024495(n+1). - R. J. Mathar, Apr 07 2008

Examples

			G.f. = x - x^2 - x^4 + x^5 + x^7 - x^8 - x^10 + x^11 + x^13 - x^14 - x^16 + x^17 + ...
		

Crossrefs

Programs

  • Maple
    seq(2*sin(Pi*n^2/3)/sqrt(3), n=0..100); # Ridouane Oudra, Oct 30 2024
  • Mathematica
    a[ n_] := {1, -1, 0, -1, 1, 0}[[Mod[n, 6, 1]]]; (* Michael Somos, Aug 25 2014 *)
    LinearRecurrence[{0,0,-1},{0,1,-1},120] (* or *) PadRight[{},120,{0,1,-1,0,-1,1}] (* Harvey P. Dale, Mar 30 2016 *)
  • PARI
    {a(n) = [0, 1, -1, 0, -1, 1][n%6 + 1]}; /* Michael Somos, Apr 10 2011 */

Formula

a(n) = 2*cos(Pi*n/3)/3 - 2(-1)^n/3.
Multiplicative with a(2^e) = -1, a(3^e) = 0, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005
From Michael Somos, Apr 10 2011: (Start)
Euler transform of length 6 sequence [-1, 0, -1, 0, 0, 1].
Moebius transform is length 6 sequence [1, -2, -1, 0, 0, 2].
G.f.: x * (1 - x) * (1 - x^3) / (1 - x^6).
a(n) = a(-n), a(n + 3) = -a(n), a(3*n) = 0, for all n in Z. (End)
a(n) = 3*a(n-1) - a(n-3) + 3*a(n-4). - Paul Curtz, Dec 10 2007
a(n) = ( (-1)^floor((n+1)/3) - (-1)^n )/2. - Bruno Berselli, Jul 09 2013
a(n) = S(n-1,-1), n >= 0, with Chebyshev's S-polynomials evaluated at -1 (see A049310). - Wolfdieter Lang, Sep 06 2013
a(n) = A131531(n+2) - A131531(n+1) . - R. J. Mathar, Nov 28 2019
a(n) = A128834(n^2). - Ridouane Oudra, Oct 30 2024
E.g.f.: 2*(exp(x/2)*cos(sqrt(3)*x/2) - cosh(x) + sinh(x))/3. - Stefano Spezia, Oct 31 2024
Dirichlet g.f.: zeta(s) * (1 - 1/2^(s-1)) * (1 - 1/3^s). - Amiram Eldar, Jun 09 2025

A052702 Expansion of (1/2)*(1/x^2 - 1/x)*(1-x-sqrt(1-2*x+x^2-4*x^3)) - x.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 6, 13, 26, 52, 108, 226, 472, 993, 2106, 4485, 9586, 20576, 44332, 95814, 207688, 451438, 983736, 2148618, 4702976, 10314672, 22664452, 49887084, 109985772, 242854669, 537004218, 1189032613, 2636096922, 5851266616, 13002628132, 28925389870, 64412505472, 143576017410
Offset: 0

Views

Author

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

Keywords

Comments

From Paul Barry, May 24 2009: (Start)
Hankel transform of A052702 is A160705. Hankel transform of A052702(n+1) is A160706.
Hankel transform of A052702(n+2) is -A131531(n+1). Hankel transform of A052702(n+3) is A160706(n+5).
Hankel transform of A052702(n+4) is A160705(n+5). (End)
For n > 1, number of Dyck (n-1)-paths with each descent length one greater or one less than the preceding ascent length. - David Scambler, May 11 2012

Crossrefs

Cf. A023431.

Programs

  • Maple
    spec := [S,{B=Prod(C,Z),S=Prod(B,B),C=Union(S,B,Z)},unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
  • Mathematica
    a[n_] := Sum[Binomial[n-k-2, 2k-1] CatalanNumber[k], {k, 0, n-2}];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 11 2022, after Paul Barry *)
  • PARI
    x='x+O('x^66);
    s='a0+(1-2*x+x^2-2*x^3-(1-x)*sqrt(1-2*x+x^2-4*x^3))/(2*x^2);
    v=Vec(s);  v[1]-='a0;  v
    /* Joerg Arndt, May 11 2012 */

Formula

Recurrence: {a(1)=0, a(2)=0, a(4)=1, a(3)=0, a(6)=3, a(7)=6, a(5)=2, (-2+4*n)*a(n)+(-7-5*n)*a(n+1)+(8+3*n)*a(n+2)+(-13-3*n)*a(n+3)+(n+6)*a(n+4)}.
From Paul Barry, May 24 2009: (Start)
G.f.: (1-2*x+x^2-2*x^3-(1-x)*sqrt(1-2*x+x^2-4*x^3))/(2*x^2).
a(n+1) = Sum_{k=0..n-1} C(n-k-1,2k-1)*A000108(k). (End)
a(n) = A023431(n-1)-A023431(n-2). - R. J. Mathar, Jan 13 2025

Extensions

More terms from Joerg Arndt, May 11 2012

A081374 Size of "uniform" Hamming covers of distance 1, that is, Hamming covers in which all vectors of equal weight are treated the same, included or excluded from the cover together.

Original entry on oeis.org

1, 2, 2, 5, 10, 22, 43, 86, 170, 341, 682, 1366, 2731, 5462, 10922, 21845, 43690, 87382, 174763, 349526, 699050, 1398101, 2796202, 5592406, 11184811, 22369622, 44739242, 89478485, 178956970, 357913942, 715827883, 1431655766, 2863311530, 5726623061
Offset: 1

Views

Author

David Applegate, Aug 22 2003

Keywords

Comments

Motivation: consideration of the "hats" problem (which boils down to normal hamming covering codes) in the case when the people are indistinguishable or unlabeled.
From Paul Curtz, May 26 2011: (Start)
If we add a(0)=1 in front and build the table of a(n) and iterated differences in further rows we get:
1, 1, 2, 2, 5, 10,
0, 1, 0, 3, 5, 12,
1, -1, 3, 2, 7, 9,
-2, 4, -1, 5, 2, 13,
6, -5, 6, -3, 11, 6
-11, 11, -9, 14, -5, 21.
The first column is the inverse binomial transform, which is 1,0 followed by (-1)^n*A083322(n-1), n>=2.
The main diagonal in the table above is A001045, the adjacent upper diagonals are A078008, A048573 and A062092. (End)

Crossrefs

Cf. A083322.

Programs

  • Magma
    I:=[1,2,2,5]; [n le 4 select I[n] else 2*Self(n-1)-Self(n-3)+2*Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jul 08 2016
  • Maple
    hatwork := proc(n,i,covered) local val, val2; options remember;
    # computes the minimum cover of the i-bit through n-bit words.
    # if covered is true the i-bit words are already covered (by the (i-1)-bit words)
    if (i>n or (i = n and covered)) then 0; elif (i = n and not covered) then 1; else
    # one choice is to include the i-bit words in the cover
    val := hatwork(n, i+1, true) + binomial(n,i);
    # the other choice is not to include the i-bit words in the cover
    if (covered) then val2 := hatwork (n, i+1, false); if (val2 < val) then val := val2; fi; else
    # if the i-bit words were not covered by (i-1), they must be covered by the (i+1)-bit words
    if (i <= n) then val2 := hatwork (n, i+2, true) + binomial(n,i+1); if (val2 < val) then val := val2; fi; fi; fi; val; fi; end proc;
    A081374 := proc (n) hatwork(n, 0, false); end proc;
  • Mathematica
    LinearRecurrence[{2,0,-1,2},{1,2,2,5},40] (* Harvey P. Dale, Feb 11 2015 *)

Formula

If (n mod 6 = 5) then sum(binomial(n, 3*i+1), i=0..n/3); elif (n mod 6 = 2) then sum(binomial(n, 3*i), i=0..n/3)+1; else sum(binomial(n, 3*i), i=0..n/3); fi;
G.f.: x*(2*x^3-2*x^2+1)/( (1-2*x)*(1+x)*(1-x+x^2) ).
a(n)=2*a(n-1)-a(n-3)+2*a(n-4).
From Paul Curtz, May 26 2011: (Start)
a(n+1) - 2*a(n) has period length 6: repeat 0, -2, 1, 0, 2, -1 (see A080425).
a(n) - A083322(n-1) = A010892(n-1) has period length 6.
a(n) + a(n+3) = 3*2^n = A007283(n).
a(n+6)-a(n) = 21*2^n = A175805(n).
a(n) - A131708(n) = -A131531(n). (End)

A173432 NW-SE diagonal sums of Riordan array A112468.

Original entry on oeis.org

1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0
Offset: 1

Views

Author

Mark Dols, Feb 18 2010

Keywords

Comments

Matches Fibonacci-sequence, such that F(n) + a(n) and F(n) - a(n) = always even.
Periodic sequence with period: [1,1,2,1,1,0]. - Philippe Deléham, Oct 11 2011

Crossrefs

Programs

  • Magma
    [2*Ceiling(n/6)-2*Floor(n/6)+Floor(n/3)-Ceiling(n/3) : n in [1..100]]; // Wesley Ivan Hurt, Sep 27 2014
  • Maple
    A173432:=n->2*ceil(n/6)-2*floor(n/6)+floor(n/3)-ceil(n/3): seq(A173432(n), n=1..100); # Wesley Ivan Hurt, Sep 27 2014
  • Mathematica
    Table[2 Ceiling[n/6] - 2 Floor[n/6] + Floor[n/3] - Ceiling[n/3], {n, 50}] (* Wesley Ivan Hurt, Sep 27 2014 *)
  • PARI
    Vec(-x*(x^2+1) / ((x-1)*(x+1)*(x^2-x+1)) + O(x^100)) \\ Colin Barker, Sep 26 2014
    

Formula

a(n) = 1 + A131531(n) with inverse binomial transform: 1, 0, 1, -3, 6, -11, 21, .., a signed variant of A024495. - R. J. Mathar, Mar 04 2010
a(2n+1) = a(2n)-a(2n-1)+2, a(2n) = a(2n-1)-a(2n-2) with a(1) = a(2)=1. - Philippe Deléham, Oct 11 2011
a(n) = a(n-1)-a(n-3)+a(n-4). - Colin Barker, Sep 26 2014
G.f.: -x*(x^2+1) / ((x-1)*(x+1)*(x^2-x+1)). - Colin Barker, Sep 26 2014
a(n) = 2*ceiling(n/6)-2*floor(n/6)+floor(n/3)-ceiling(n/3). - Wesley Ivan Hurt, Sep 27 2014
a(n) = A001045(n) - A111927(n). - Paul Curtz, Dec 16 2020

Extensions

Corrected and extended by Philippe Deléham, Oct 11 2011

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

Original entry on oeis.org

0, 0, 2, 3, 6, 10, 21, 42, 86, 171, 342, 682, 1365, 2730, 5462, 10923, 21846, 43690, 87381, 174762, 349526, 699051, 1398102, 2796202, 5592405, 11184810, 22369622, 44739243, 89478486, 178956970, 357913941, 715827882, 1431655766, 2863311531, 5726623062, 11453246122
Offset: 0

Views

Author

Paul Curtz, May 17 2014

Keywords

Comments

Generally, a(n) is an autosequence if its inverse binomial transform is (-1)^n*a(n). It is of the first kind if the main diagonal is 0's and the first two upper diagonals (just above the main one) are the same. It is of the second kind if the main diagonal is equal to the first upper diagonal multiplied by 2. If the first upper diagonal is an autosequence, the sequence is a super autosequence. Example: A113405. The first upper diagonal is A001045(n). Another super autosequence: 0, 0, 0 followed by A059633(n). The first upper diagonal is A000045(n).
Difference table of a(n):
0, 0, 2, 3, 6, 10, 21, 42, ...
0, 2, 1, 3, 4, 11, 21, 44, ...
2, -1, 2, 1, 7, 10, 23, 41, ...
-3, 3, -1, 6, 3, 13, 18, 45, ... .
This is an autosequence of the second kind. The main diagonal is 2*A001045(n) = A078008(n). More precisely it is a super autosequence, companion of A113405(n).
a(n+1) mod 10 = period 12: repeat 0, 2, 3, 6, 0, 1, 2, 6, 1, 2, 2, 5.
It is shifted A081374(n+1) mod 10 =
period 12: repeat 1, 2, 2, 5, 0, 2, 3, 6, 0, 1, 2, 6.
a(n) mod 9 = period 18:
repeat 0, 0, 2, 3, 6, 1, 3, 6, 5, 0, 0, 7, 6, 3, 8, 6, 3, 4 = c(n).
c(n) + c(n+9) = 0, 0, 9, 9, 9, 9, 9, 9, 9.

Examples

			G.f. = 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 21*x^6 + 42*x^7 + 86*x^8 + ...
		

Crossrefs

Cf. A000032, 1/(n+1), A164555/A027642 (all autosequences of 2nd kind). A007283, A175805.

Programs

  • Mathematica
    a[n_] := (m = Mod[n, 6]; 1/3*(2^n + (-1)^n + 1/120*(m-6)*(m+1)*(m^3-29*m+40))); Table[a[n], {n, 0, 35}] (* Jean-François Alcover, May 19 2014, a non-recursive formula, after Mathematica's RSolve *)
    LinearRecurrence[{2, 0, -1, 2}, {0, 0, 2, 3},50] (* G. C. Greubel, Feb 21 2017 *)
  • PARI
    concat([0,0], Vec(x^2*(x-2)/((x+1)*(2*x-1)*(x^2-x+1)) + O(x^100))) \\ Colin Barker, May 18 2014

Formula

a(n+3) = 3*2^n - a(n), a(0)=a(1)=0, a(2)=2.
a(n) = 2*A113405(n+1) - A113405(n).
a(n+1) = 2*a(n) + period 6: repeat 0, 2, -1, 0, -2, 1. a(0)=0.
a(n) = 2^n - A081374(n+1).
a(n+3) = a(n+1) + A130755(n).
G.f.: x^2*(x-2) / ((x+1)*(2*x-1)*(x^2-x+1)). - Colin Barker, May 18 2014
a(n) = A024495(n) + A131531(n).
a(n+6) = a(n) + 21*2^n, a(0)=a(1)=0, a(2)=2, a(3)=3, a(4)=6, a(5)=10.
a(n) = A001045(n) - A092220(n).
a(n+12) = a(n) + 1365*2^n. First 12 values in the Data. (A024495(n+12) = A024495(n) + 1365*2^n).
a(3n) = A132805(n) = 3*A015565(n).
a(3n+1) = A132804(n) = 6*A015565(n).
a(3n+2) = A132397(n) = 2*A082311(n).
a(n) = 1/3*((-1)^n - 2*cos((n*Pi)/3) + 2^n). - Alexander R. Povolotsky, Jun 02 2014

Extensions

More terms from Colin Barker, May 18 2014
Showing 1-10 of 17 results. Next