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-6 of 6 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

A037093 "Sloping binary representation" of Fibonacci numbers, slope = +1.

Original entry on oeis.org

0, 1, 3, 14, 57, 229, 916, 7761, 29567, 117474, 469113, 3973641, 15138352, 60146777, 240187355, 2070207870, 7733090689, 30791909229, 260408711716, 991495872825, 3942106110215, 15739612088946, 133333733918417
Offset: 0

Views

Author

Antti Karttunen, Jan 28 1999

Keywords

Examples

			When Fibonacci numbers are written in binary (see A004685), under each other as:
0000000 (0)
0000001 (1)
0000001 (1)
0000010 (2)
0000011 (3)
0000101 (5)
0001000 (8)
0001101 (13)
0010101 (21)
0100010 (34)
0110111 (55)
1011001 (89)
and one starts collecting their bits from column-0 to SW-direction (from the least to the most significant end), one gets 000... (0), ...00001 (1), ...00011 (3), ...001110 (14), etc. (See A102370 for similar transformation done on nonnegative integers).
		

Crossrefs

Same sequence in octal: A037098. Cf. also: A102370, A000045, A037094-A037095, A036284.

Formula

a(n) := Sum(bit_n(A000045(n+i), i)*(2^i), i=0..inf) [ bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2); ]
In practice, n can be used as an upper limit instead of infinity.

Extensions

Entry revised Dec 29 2007

A037096 Periodic vertical binary vectors computed for powers of 3: a(n) = Sum_{k=0 .. (2^n)-1} (floor((3^k)/(2^n)) mod 2) * 2^k.

Original entry on oeis.org

1, 2, 0, 204, 30840, 3743473440, 400814250895866480, 192435610587299441243182587501623263200, 2911899996313975217187797869354128351340558818020188112521784134070351919360
Offset: 0

Views

Author

Antti Karttunen, Jan 29 1999

Keywords

Comments

This sequence can be also computed with a recurrence that does not explicitly refer to 3^n. See the C program.
Conjecture: For n >= 3, each term a(n), when considered as a GF(2)[X] polynomial, is divisible by the GF(2)[X] polynomial (x + 1) ^ A055010(n-1). If this holds, then for n >= 3, a(n) = A048720(A136386(n), A048723(3,A055010(n-1))).

Examples

			When powers of 3 are written in binary (see A004656), under each other as:
  000000000001 (1)
  000000000011 (3)
  000000001001 (9)
  000000011011 (27)
  000001010001 (81)
  000011110011 (243)
  001011011001 (729)
  100010001011 (2187)
it can be seen that the bits in the n-th column from the right can be arranged in periods of 2^n: 1, 2, 4, 8, ... This sequence is formed from those bits: 1, is binary for 1, thus a(0) = 1. 01, reversed is 10, which is binary for 2, thus a(1) = 2, 0000 is binary for 0, thus a(2)=0, 000110011, reversed is 11001100 = A007088(204), thus a(3) = 204.
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media Inc., (2002), p. 119.

Crossrefs

Cf. A036284, A037095, A037097, A136386 for related sequences.
Cf. also A004642, A265209, A265210 (for 2^n written in base 3).

Programs

  • Maple
    a(n) := sum( 'bit_n(3^i, n)*(2^i)', 'i'=0..(2^(n))-1);
    bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2);

Formula

a(n) = Sum_{k=0 .. A000225(n)} (floor(A000244(k)/(2^n)) mod 2) * 2^k.
Other identities and observations:
For n >= 2, a(n) = A000215(n-1)*A037097(n) = A048720(A037097(n), A048723(3, A000079(n-1))).

Extensions

Entry revised by Antti Karttunen, Dec 29 2007
Name changed and the example corrected by Antti Karttunen, Dec 05 2015

A037094 "Sloping binary representation" of Lucas numbers (A000032), slope = +1.

Original entry on oeis.org

0, 7, 29, 114, 971, 3695, 14684, 58639, 496705, 1892294, 7518347, 30023387, 258775984, 966632223, 3848859285, 32551146626, 123937019667, 492763242871, 1967451434524, 16666715013959, 63494909959113
Offset: 0

Views

Author

Antti Karttunen, Jan 28 1999

Keywords

Examples

			When Lucas numbers (A000032) are written in binary, under each other as:
0000010 (2)
0000001 (1)
0000011 (3)
0000100 (4)
0000111 (7)
0001011 (11)
0010010 (18)
0011101 (29)
0101111 (47)
1001100 (76)
and one starts collecting their bits from column-0 to SW-direction (from the least to the most significant end), one gets 000... (0), ...00111 (7), ...011101 (29), ...001110010 (114), etc. (See A102370 for similar transformation done on nonnegative integers).
		

Crossrefs

Cf. A000032, A037093, A037095, A037099 (same sequence in octal).

Formula

a(n) := Sum(bit_n(A000032(n+i), i)*(2^i), i=0..inf) [ bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2); ]
In practice, 3n (2n?) can be used as an upper limit instead of infinity.

Extensions

Entry revised Dec 29 2007

A133851 Sloping binary representation of powers of 4 (A000302), slope = -1 .

Original entry on oeis.org

1, 0, 0, 4, 0, 0, 16, 0, 0, 64, 0, 0, 256, 0, 0, 1024, 0, 0, 4096, 0, 0, 16384, 0, 0, 65536, 0, 0, 262144, 0, 0, 1048576, 0, 0, 4194304, 0, 0, 16777216, 0, 0, 67108864, 0, 0, 268435456, 0, 0, 1073741824, 0, 0, 4294967296, 0, 0, 17179869184, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Jan 06 2008

Keywords

Examples

			When powers of 4 are written in binary (see A098608), under each other as:
0000000000001 (1)
0000000000100 (4)
0000000010000 (16)
0000001000000 (64)
0000100000000 (256)
0010000000000 (1024)
1000000000000 (4096)
and one collects their bits from the column=0 to NW-direction (from the least to the most significant end), one gets 1 (1), 00 (0), 000 (0), 0100 (4), 00000 (0), 000000 (0), 0010000 (16), etc. (see 0105033 for similar transformation done on nonnegative integers)
		

Crossrefs

Cf. A037095, A077957, A105033, A000302, A098608, A102370(sloping binary numbers).

Formula

a(3n) = A000302(n), a(3n+1) = a(3n+2) = 0. - Alois P. Heinz, Dec 10 2020

A339601 Starting from x_0 = n, iterate by dividing with 3 (discarding any remainder), until zero is reached: x_1 = floor(x_0/3), x_2 = floor(x_1/3), etc. Then a(n) = Sum_{i=0..} (x_i AND 2^i), where AND is bitwise-and.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 09 2020

Keywords

Crossrefs

Cf. also A332497.

Programs

  • Mathematica
    Array[Total@ MapIndexed[BitAnd[2^First[#2 - 1], #1] &, NestWhileList[Floor[#/3] &, #, # > 0 &]] &, 106, 0] (* Michael De Vlieger, Dec 10 2020 *)
  • PARI
    A339601(n) = { my(i=0, s=0); while(n, s += bitand(2^i,n); i++; n \= 3); (s); };
    
  • PARI
    A339601(n) = { my(m=1, s=0); while(n>=m, s += bitand(m,n); m <<= 1; n \= 3); (s); };
Showing 1-6 of 6 results.