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

A077957 Powers of 2 alternating with zeros.

Original entry on oeis.org

1, 0, 2, 0, 4, 0, 8, 0, 16, 0, 32, 0, 64, 0, 128, 0, 256, 0, 512, 0, 1024, 0, 2048, 0, 4096, 0, 8192, 0, 16384, 0, 32768, 0, 65536, 0, 131072, 0, 262144, 0, 524288, 0, 1048576, 0, 2097152, 0, 4194304, 0, 8388608, 0, 16777216, 0, 33554432, 0, 67108864, 0, 134217728, 0, 268435456
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Normally sequences like this are not included, since with the alternating 0's deleted it is already in the database.
Inverse binomial transform of A001333. - Paul Barry, Feb 25 2003
"Sloping binary representation" of powers of 2 (A000079), slope=-1 (see A037095 and A102370). - Philippe Deléham, Jan 04 2008
0,1,0,2,0,4,0,8,0,16,... is the inverse binomial transform of A000129 (Pell numbers). - Philippe Deléham, Oct 28 2008
Number of maximal self-avoiding walks from the NW to SW corners of a 3 X n grid.
Row sums of the triangle in A204293. - Reinhard Zumkeller, Jan 14 2012
Pisano period lengths: 1, 1, 4, 1, 8, 4, 6, 1, 12, 8, 20, 4, 24, 6, 8, 1, 16, 12, 36, 8, ... . - R. J. Mathar, Aug 10 2012
This sequence occurs in the length L(n) = sqrt(2)^n of Lévy's C-curve at the n-th iteration step. Therefore, L(n) is the Q(sqrt(2)) integer a(n) + a(n-1)*sqrt(2), with a(-1) = 0. For a variant of this C-curve see A251732 and A251733. - Wolfdieter Lang, Dec 08 2014
a(n) counts walks (closed) on the graph G(1-vertex,2-loop,2-loop). Equivalently the middle entry (2,2) of A^n where the adjacency matrix of digraph is A=(0,1,0;1,0,1;0,1,0). - David Neil McGrath, Dec 19 2014
a(n-2) is the number of compositions of n into even parts. For example, there are 4 compositions of 6 into even parts: (6), (222), (42), and (24). - David Neil McGrath, Dec 19 2014
Also the number of alternately constant compositions of n + 2, ranked by A351010. The alternately strict version gives A000213. The unordered version is A035363, ranked by A000290, strict A035457. - Gus Wiseman, Feb 19 2022
a(n) counts degree n fixed points of GF(2)[x]'s automorphisms. Proof: given a field k, k[x]'s automorphisms are determined by k's automorphisms and invertible affine maps x -> ax + b. GF(2) is rigid and has only one unit so its only nontrivial automorphism is x -> x + 1. For n = 0 we have 1 fixed point, the constant polynomial 1. (Taking the convention that 0 is not a degree 0 polynomial.) For n = 1 we have 0 fixed points as x -> x + 1 -> x are the only degree 1 polynomials. Note that if f(x) is a fixed point, then f(x) + 1 is also a fixed point. Given f(x) a degree n fixed point, we can assume WLOG x | f(x). Applying the automorphism, we then have x + 1 | f(x). Now note that f(x) / (x^2 + x) must be a fixed point, so any fixed point of degree n must either be of the form g(x) * (x^2 + x) or g(x) * (x^2 + x) + 1 for a unique degree n - 2 fixed point g(x). Therefore we have the recurrence relation a(n) = 2 * a(n - 2) as desired. - Keith J. Bauer, Mar 19 2024

Crossrefs

Column k=3 of A219946. - Alois P. Heinz, Dec 01 2012
Cf. A016116 (powers repeated).

Programs

  • GAP
    Flat(List([0..30],n->[2^n,0])); # Muniru A Asiru, Aug 05 2018
  • Haskell
    a077957 = sum . a204293_row  -- Reinhard Zumkeller, Jan 14 2012
    
  • Magma
    &cat [[2^n,0]: n in [0..20]]; // Vincenzo Librandi, Apr 03 2018
    
  • Maple
    seq(op([2^n,0]),n=0..100); # Robert Israel, Dec 23 2014
  • Mathematica
    a077957[n_] := Riffle[Table[2^i, {i, 0, n - 1}], Table[0, {n}]]; a077957[29] (* Michael De Vlieger, Dec 22 2014 *)
    CoefficientList[Series[1/(1 - 2*x^2), {x,0,50}], x] (* G. C. Greubel, Apr 12 2017 *)
    LinearRecurrence[{0, 2}, {1, 0}, 54] (* Robert G. Wilson v, Jul 23 2018 *)
    Riffle[2^Range[0,30],0,{2,-1,2}] (* Harvey P. Dale, Jan 06 2022 *)
  • PARI
    a(n)=if(n<0||n%2, 0, 2^(n/2))
    
  • Sage
    def A077957():
        x, y = -1, 1
        while True:
            yield -x
            x, y = x + y, x - y
    a = A077957(); [next(a) for i in range(40)]  # Peter Luschny, Jul 11 2013
    

Formula

G.f.: 1/(1-2*x^2).
E.g.f.: cosh(x*sqrt(2)).
a(n) = (1 - n mod 2) * 2^floor(n/2).
a(n) = sqrt(2)^n*(1+(-1)^n)/2. - Paul Barry, May 13 2003
a(n) = 2*a(n-2) with a(0)=1, a(1)=0. - Jim Singh, Jul 12 2018

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

Original entry on oeis.org

1, 1, -1, -5, -7, 1, 23, 43, 17, -95, -241, -197, 329, 1249, 1511, -725, -5983, -9791, -1633, 26107, 57113, 35905, -99529, -306773, -314959, 290401, 1525679, 2180155, -216727, -6973919, -13297657, -5673557, 28545857, 74112385, 62587199, -97162757, -382087111, -472685951
Offset: 0

Views

Author

Simone Severini, Oct 23 2003

Keywords

Comments

Type 2 generalized Gaussian Fibonacci integers.
Binomial transform of A077966. - Philippe Deléham, Dec 02 2008
The real component of Q^n, where Q is the quaternion 1 + 0*i + 1*j + 1*k. - Stanislav Sykora, Jun 11 2012
If entries are multiplied by 2*(-1)^n, which gives 2, -2, -2, 10, -14, -2, 46, -86, 34, 190, -482, 394, ..., we obtain the Lucas V(-2,3) sequence. - R. J. Mathar, Jan 08 2013
The real component of (1 + sqrt(-2))^n. - Giovanni Resta, Apr 01 2014
It is an open question whether or not this sequence satisfies Benford's law [Berger-Hill, 2017; Arno Berger, email, Jan 06 2017]. - N. J. A. Sloane, Feb 08 2017
Given an alternated cubic honeycomb with a planar dissection along a plane from edge to opposite edge of the containing cube. The sequence (1 + sqrt(-2))^n contains a real component representing distance along the edge of the tetrahedron/octahedron and an imaginary component representing the orthogonal distance along the sqrt(2) axis in a tetrahedron/octahedron, this generates a unique cevian (line from the apical vertex to a vertex on the triangular tiling composing the opposite face) in this plane with length (sqrt(3))^n. - Jason Pruski, Sep 04 2017, Jan 08 2018
From Peter Bala, Apr 01 2018: (Start)
This sequence is the Lucas sequence V(n,2,3). The companion Lucas sequence U(n,2,3) is A088137.
Define a binary operation o on rational numbers by x o y = (x + y)/(1 - 2*x*y). This is a commutative and associative operation with identity 0. Then 1 o 1 o ... o 1 (n terms) = A088137(n)/a(n). Cf. A025172 and A127357. (End)

Examples

			G.f. = 1 + x - x^2 - 5*x^3 - 7*x^4 + x^5 + 23*x6 + 43*x^7 + 17*x^8 - 95*x^9 + ...
		

References

  • Arno Berger and Theodore P. Hill. An Introduction to Benford's Law. Princeton University Press, 2015.
  • S. Severini, A note on two integer sequences arising from the 3-dimensional hypercube, Technical Report, Department of Computer Science, University of Bristol, Bristol, UK (October 2003).

Crossrefs

Programs

  • Magma
    [n le 2 select 1 else 2*Self(n-1) -3*Self(n-2): n in [1..41]]; // G. C. Greubel, Jan 03 2024
    
  • Maple
    Digits:=100; a:=n->round(abs(evalf((3^(n/2))*cos(n*arctan(sqrt(2))))));
    # alternative:
    a:= gfun:-rectoproc({a(n) = 2*a(n-1) - 3*a(n-2),a(0)=1,a(1)=1},a(n),remember):
    map(a, [$0..100]); # Robert Israel, Jun 23 2015
  • Mathematica
    CoefficientList[Series[(1-x)/(1-2*x+3*x^2), {x, 0, 40}], x] (* Vaclav Kotesovec, Apr 01 2014 *)
    a[ n_] := ChebyshevT[ n, 1/Sqrt[3]] Sqrt[3]^n // Simplify; (* Michael Somos, May 15 2015 *)
    LinearRecurrence[{2,-3},{1,1},50] (* Harvey P. Dale, Jul 30 2019 *)
  • PARI
    {a(n) = real( (1 + quadgen(-8))^n )}; /* Michael Somos, Jul 26 2006 */
    
  • PARI
    {a(n) = real( subst( poltchebi(n), 'x, quadgen(12) / 3) * quadgen(12)^n)}; /* Michael Somos, Jul 26 2006 */
    
  • PARI
    a(n)=simplify(polchebyshev(n,,quadgen(12)/3)*quadgen(12)^n) \\ Charles R Greathouse IV, Jun 26 2013
    
  • SageMath
    [sqrt(3)^n*chebyshev_T(n, 1/sqrt(3)) for n in range(41)] # G. C. Greubel, Jan 03 2024

Formula

a(n) = (3^(n/2))*cos(n*arctan(sqrt(2))). - Paul Barry, Oct 23 2003
From Paul Barry, Sep 03 2004: (Start)
a(n) = 2*a(n-1) - 3*a(n-2).
a(n) = (-1)^n*Sum_{m=0..n} binomial(n, m)*Sum_{k=0..n} binomial(m, 2k)2^(m-k).
Binomial transform of 1/(1 + 2*x^2), or (1, 0, -2, 0, 4, 0, -8, 0, 16, ...). (End)
a(n+1) = a(n+2) - 2*A088137(n+1), a(n+1) = A088137(n+2) - A088137(n+1). - Creighton Dement, Oct 28 2004
a(n) = upper left and lower right terms of [1,-2, 1,1]^n. - Gary W. Adamson, Mar 28 2008
a(n) = Sum_{k=0..n} A098158(n,k)*(-2)^(n-k). - Philippe Deléham, Nov 14 2008
a(n) = Sum_{k=0..n} A124182(n,k)*(-3)^(n-k). - Philippe Deléham, Nov 15 2008
G.f.: G(0)/2, where G(k) = 1 + 1/(1 - x*(2*k+1)/(x*(2*k+3) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 25 2013
a(n) = a(-n) * 3^n for all n in Z. - Michael Somos, Aug 25 2014
E.g.f.: (1/2)*(exp((1 - i*sqrt(2))*x) + exp((1 + i*sqrt(2))*x)), where i is the imaginary unit. - Stefano Spezia, Jul 17 2019

Extensions

The explicit formula was given by Paul Barry.
Corrected and extended by N. J. A. Sloane, Aug 01 2004
More terms from Creighton Dement, Jul 31 2004

A100213 Expansion of g.f.: x*(4-7*x+2*x^2-8*x^4+16*x^5-16*x^6)/((1-2*x) * (1-2*x^2) * (1-2*x+2*x^2) * (1+2*x^2)).

Original entry on oeis.org

4, 9, 14, 18, 32, 64, 128, 256, 544, 1104, 2144, 4128, 8192, 16384, 32768, 65536, 131584, 263424, 525824, 1049088, 2097152, 4194304, 8388608, 16777216, 33562624, 67129344, 134242304, 268443648, 536870912, 1073741824, 2147483648, 4294967296, 8590065664
Offset: 1

Views

Author

Creighton Dement, Nov 11 2004

Keywords

Comments

The sequence can be created applying the pos operator (which sums over the positive coefficients) to the n-th power of the Floretion element (.5 'j + .5 'k + .5 j' + .5 k' + 1 'ii' + 1 e).

Examples

			a(5) = 32 because (.5 'j + .5 'k + .5 j' + .5 k' + 1 'ii' + 1 e)^5 = - 2 'j - 2 'k - 2 j' - 2 k' + 6 'ii' + 10 'jj' + 10 'kk' + 6 e,
and the sum of all positive coefficients is 6+10+10+6 = 32.
		

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( x*(4-7*x+2*x^2-8*x^4+16*x^5-16*x^6)/((1-4*x+6*x^2-4*x^3)*(1-4*x^4)) )); // G. C. Greubel, Mar 29 2024
    
  • Mathematica
    Rest[CoefficientList[Series[x(4-7x+2x^2-8x^4+16x^5-16x^6)/((1-2x)(1-2x^2)(1-2x+2x^2)(1+2x^2)),{x,0,40}],x]] (* or *) LinearRecurrence[{4,-6,4,4,-16,24,-16},{4,9,14,18,32,64,128},40] (* Harvey P. Dale, Aug 23 2015 *)
  • Sage
    def A100213_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( x*(4-7*x+2*x^2-8*x^4+16*x^5-16*x^6)/((1-4*x+6*x^2-4*x^3)*(1-4*x^4)) ).list()
    a=A100213_list(51); a[1:] # G. C. Greubel, Mar 29 2024

Formula

a(n) = A100215(n) - A100212(n).
a(n) = (-1)^n*A009116(n+3) + A100216 + A038503(n+1).
Equation above in Floretian Algebra operator speak: (pos) + (neg) = (ves) = (jes) + (les) + (tes)
a(n-1) = A000079(n+1) + (5*A077957(n) + 6*A077957(n-1))/4 + A009545(n)/2 + A009545(n+1) + A077966(n-1) - A077966(n)/4. - R. J. Mathar, May 07 2008
From G. C. Greubel, Mar 29 2024: (Start)
a(n) = (1/16)*( 2^(n+4) - 2*((1+5*i)*(1+i)^n + (1-5*i)*(1-i)^n) + (1 - (-1)^n)*2^((n+1)/2)*(5+i^(n+1)) + (1+(-1)^n)*2^(1+n/2)*(3-2*i^n) ).
a(2*n-1) = 2^(n-3)*( 2^(n+2) + 5 + (-1)^n - 6*cos(n*Pi/2) + 4*sin(n*Pi/2) ), for n >= 1.
a(2*n) = 2^(n-2)*( 2^(n+2) + 3 - 2*(-1)^n - cos(n*Pi/2) + 5*sin(n*Pi/2) ), n >= 1.
E.g.f.: -1 + exp(2*x) + (1/8)*(6*cosh(sqrt(2)*x) + 5*sqrt(2)* sinh(sqrt(2)*x) - (4*cos(sqrt(2)*x) + sqrt(2)*sin(sqrt(2)*x)) - 2*exp(x)*(cos(x) - 5*sin(x)) ). (End)

Extensions

Replaced definition with generating function, changed offset to 1. - R. J. Mathar, Mar 12 2010

A136408 a(n) = 3*a(n-1) - 4*a(n-2) + 6*a(n-3) - 4*a(n-4), with initial terms 1,2,4,7.

Original entry on oeis.org

1, 2, 4, 7, 13, 27, 55, 107, 211, 427, 859, 1707, 3403, 6827, 13675, 27307, 54571, 109227, 218539, 436907, 873643, 1747627, 3495595, 6990507, 13980331, 27962027, 55925419, 111848107, 223693483, 447392427, 894790315, 1789569707, 3579128491
Offset: 0

Views

Author

Paul Curtz, Mar 31 2008

Keywords

Crossrefs

Cf. A077966.

Programs

  • Magma
    [(5*2^n +2 -((n+1) mod 2)*(-2)^Floor((n+1)/2))/6: n in [0..40]]; // G. C. Greubel, Jan 19 2023
    
  • Mathematica
    LinearRecurrence[{3,-4,6,-4},{1,2,4,7},41] (* Harvey P. Dale, Aug 12 2016 *)
  • PARI
    a(n)=(5<Charles R Greathouse IV, Mar 30 2022
    
  • SageMath
    [(5*2^n +2 -((n+1)%2)*(-2)^((n+1)//2))/6 for n in range(41)] # G. C. Greubel, Jan 19 2023

Formula

From R. J. Mathar, Apr 04 2008: (Start)
O.g.f.: (1 - x + 2*x^2 - 3*x^3)/((1-x)*(1-2*x)*(1+2*x^2)).
a(n) = (5*2^n + 2 - A077966(n))/6. (End)

Extensions

More terms from R. J. Mathar, Apr 04 2008

A348910 a(n) is the "real" part of f(n) = Sum_{k>=0, d_k>0} w^(d_k-1) * (-2)^k where Sum_{k>=0} d_k * 4^k is the base-4 representation of n and w = -1/2 + sqrt(-3)/2 is a primitive cube root of unity; sequence A348911 gives "w" parts.

Original entry on oeis.org

0, 1, 0, -1, -2, -1, -2, -3, 0, 1, 0, -1, 2, 3, 2, 1, 4, 5, 4, 3, 2, 3, 2, 1, 4, 5, 4, 3, 6, 7, 6, 5, 0, 1, 0, -1, -2, -1, -2, -3, 0, 1, 0, -1, 2, 3, 2, 1, -4, -3, -4, -5, -6, -5, -6, -7, -4, -3, -4, -5, -2, -1, -2, -3, -8, -7, -8, -9, -10, -9, -10, -11, -8
Offset: 0

Views

Author

Rémy Sigrist, Nov 03 2021

Keywords

Comments

For any Eisenstein integer z = u + v*w (where u and v are integers), we call u the "real" part of z and v the "w" part of z.
The function f defines a bijection from the nonnegative integers to the Eisenstein integers.

Crossrefs

See A334492 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

a(2^k) = A077966(k) for any k >= 0.

A348911 a(n) is the "w" part of f(n) = Sum_{k>=0, d_k>0} w^(d_k-1) * (-2)^k where Sum_{k>=0} d_k * 4^k is the base-4 representation of n and w = -1/2 + sqrt(-3)/2 is a primitive cube root of unity; sequence A348910 gives "real" parts.

Original entry on oeis.org

0, 0, 1, -1, 0, 0, 1, -1, -2, -2, -1, -3, 2, 2, 3, 1, 0, 0, 1, -1, 0, 0, 1, -1, -2, -2, -1, -3, 2, 2, 3, 1, 4, 4, 5, 3, 4, 4, 5, 3, 2, 2, 3, 1, 6, 6, 7, 5, -4, -4, -3, -5, -4, -4, -3, -5, -6, -6, -5, -7, -2, -2, -1, -3, 0, 0, 1, -1, 0, 0, 1, -1, -2, -2, -1, -3
Offset: 0

Views

Author

Rémy Sigrist, Nov 03 2021

Keywords

Comments

For any Eisenstein integer z = u + v*w (where u and v are integers), we call u the "real" part of z and v the "w" part of z.
The function f defines a bijection from the nonnegative integers to the Eisenstein integers.

Crossrefs

See A334493 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

a(2^(k+1)) = A077966(k) for any k >= 0.

A191897 Coefficients of the Z(n,x) polynomials; Z(0,x) = 1, Z(1,x) = x and Z(n,x) = x*Z(n-1,x) - 2*Z(n-2,x), n >= 2.

Original entry on oeis.org

1, 1, 0, 1, 0, -2, 1, 0, -4, 0, 1, 0, -6, 0, 4, 1, 0, -8, 0, 12, 0, 1, 0, -10, 0, 24, 0, -8, 1, 0, -12, 0, 40, 0, -32, 0, 1, 0, -14, 0, 60, 0, -80, 0, 16, 1, 0, -16, 0, 84, 0, -160, 0, 80, 0, 1, 0, -18, 0, 112, 0, -280, 0, 240, 0, -32
Offset: 0

Views

Author

Paul Curtz, Jun 19 2011

Keywords

Comments

The coefficients of the Z(n,x) polynomials by decreasing exponents, see the formulas, define this triangle.

Examples

			The first few rows of the coefficients of the Z(n,x) are
  1;
  1,    0;
  1,    0,   -2;
  1,    0,   -4,    0;
  1,    0,   -6,    0,    4;
  1,    0,   -8,    0,   12,    0;
  1,    0,  -10,    0,   24,    0,   -8;
  1,    0,  -12,    0,   40,    0,  -32,    0;
  1,    0,  -14,    0,   60,    0,  -80,    0,   16;
  1,    0,  -16,    0,   84,    0, -160,    0,   80,    0;
		

Crossrefs

Row sums: A107920(n+1). Main diagonal: A077966(n).
Z(n,x=1) = A107920(n+1), Z(n,x=2) = A009545(n+1),
Z(n,x=3) = A000225(n+1), Z(n,x=4) = A007070(n),
Z(n,x=5) = A107839(n), Z(n,x=6) = A154244(n),
Z(n,x=7) = A186446(n), Z(n,x=8) = A190975(n+1),
Z(n,x=9) = A190979(n+1), Z(n,x=10) = A190869(n+1).
Row sum without sign: A113405(n+1).

Programs

  • Maple
    nmax:=10: Z(0, x):=1 : Z(1, x):=x: for n from 2 to nmax do Z(n, x) := x*Z(n-1, x) - 2*Z(n-2, x) od: for n from 0 to nmax do for k from 0 to n do T(n, k) := coeff(Z(n, x), x, n-k) od: od: seq(seq(T(n, k), k=0..n), n=0..nmax); # Johannes W. Meijer, Jun 27 2011, revised Nov 29 2012
  • Mathematica
    a[n_, k_] := If[OddQ[k], 0, 2^(k/2)*Coefficient[ ChebyshevU[n, x/2], x, n-k]]; Flatten[ Table[ a[n, k], {n, 0, 10}, {k, 0, n}]] (* Jean-François Alcover, Aug 02 2012, from 2nd formula *)

Formula

Z(0,x) = 1, Z(1,x) = x and Z(n,x) = x*Z(n-1,x) - 2*Z(n-2,x), n >= 2.
a(n,k) = A077957(k) * A053119(n,k). - Paul Curtz, Sep 30 2011

Extensions

Edited and information added by Johannes W. Meijer, Jun 27 2011
Showing 1-7 of 7 results.