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

A351005 Number of integer partitions of n into parts that are alternately equal and unequal.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 3, 2, 4, 2, 5, 4, 6, 4, 8, 5, 10, 6, 12, 8, 16, 9, 18, 12, 22, 14, 28, 16, 33, 20, 40, 24, 48, 28, 56, 34, 67, 40, 80, 46, 94, 56, 110, 64, 130, 75, 152, 88, 176, 102, 206, 118, 238, 138, 276, 159, 320, 182, 368, 210, 424, 242, 488, 276, 558
Offset: 0

Views

Author

Gus Wiseman, Jan 31 2022

Keywords

Comments

Also partitions whose multiplicities are all 2's, except possibly for the last, which may be 1.

Examples

			The a(1) = 1 through a(12) = 6 partitions (A..C = 10..12):
  1  2   3  4   5    6     7    8     9    A     B      C
     11     22  221  33    331  44    441  55    443    66
                     2211       332        442   551    552
                                3311       3322  33221  4422
                                           4411         5511
                                                        332211
		

Crossrefs

The even-length ordered version is A003242, ranked by A351010.
The even-length case is A035457.
Without equalities we have A122135, opposite A122129, even-length A122134.
The non-strict version is A351004, opposite A351003, even-length A035363.
The opposite version is A351006, even-length A351007.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,1,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,2,Length[#]-1,2}]&]],{n,0,30}]

A357643 Number of integer compositions of n into parts that are alternately equal and unequal.

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 5, 5, 9, 7, 17, 14, 28, 25, 49, 42, 87, 75, 150, 132, 266, 226, 466, 399, 810, 704, 1421, 1223, 2488, 2143, 4352, 3759, 7621, 6564, 13339, 11495, 23339, 20135, 40852, 35215, 71512, 61639, 125148, 107912, 219040, 188839, 383391, 330515, 670998
Offset: 0

Views

Author

Gus Wiseman, Oct 12 2022

Keywords

Examples

			The a(1) = 1 through a(8) = 9 compositions:
  (1)  (2)   (3)  (4)    (5)    (6)     (7)      (8)
       (11)       (22)   (113)  (33)    (115)    (44)
                  (112)  (221)  (114)   (223)    (116)
                                (1122)  (331)    (224)
                                (2211)  (11221)  (332)
                                                 (1133)
                                                 (3311)
                                                 (22112)
                                                 (112211)
		

Crossrefs

The even-length version is A003242, ranked by A351010, partitions A035457.
Without equal relations we have A016116, equal only A001590 (apparently).
The version for partitions is A351005.
The opposite version is A357644, partitions A351006.
A011782 counts compositions.
A357621 gives half-alternating sum of standard compositions, skew A357623.
A357645 counts compositions by half-alternating sum, skew A357646.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,1,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,2,Length[#]-1,2}]&]],{n,0,15}]
  • PARI
    C_x(N) = {my(x='x+O('x^N), h=(1+sum(k=1,N, (x^k)/(1+x^(2*k))))/(1-sum(k=1,N, (x^(2*k))/(1+x^(2*k))))); Vec(h)}
    C_x(50) \\ John Tyler Rascoe, May 28 2024

Formula

G.f.: (1 + Sum_{k>0} (x^k)/(1 + x^(2*k)))/(1 - Sum_{k>0} (x^(2*k))/(1 + x^(2*k))). - John Tyler Rascoe, May 28 2024

Extensions

More terms from Alois P. Heinz, Oct 12 2022

A357644 Number of integer compositions of n into parts that are alternately unequal and equal.

Original entry on oeis.org

1, 1, 1, 3, 4, 7, 8, 13, 17, 25, 30, 44, 58, 77, 98, 142, 176, 245, 311, 426, 548, 758, 952, 1319, 1682, 2308, 2934, 4059, 5132, 7087, 9008, 12395, 15757, 21728, 27552, 38019, 48272, 66515, 84462, 116467, 147812, 203825, 258772, 356686, 452876, 624399, 792578
Offset: 0

Views

Author

Gus Wiseman, Oct 14 2022

Keywords

Examples

			The a(1) = 1 through a(7) = 13 compositions:
  (1)  (2)  (3)   (4)    (5)    (6)     (7)
            (12)  (13)   (14)   (15)    (16)
            (21)  (31)   (23)   (24)    (25)
                  (211)  (32)   (42)    (34)
                         (41)   (51)    (43)
                         (122)  (411)   (52)
                         (311)  (1221)  (61)
                                (2112)  (133)
                                        (322)
                                        (511)
                                        (2113)
                                        (3112)
                                        (12211)
		

Crossrefs

Without equal relations we have A000213, equal only A027383.
Even-length opposite: A003242, ranked by A351010, partitions A035457.
The version for partitions is A351006.
The opposite version is A357643, partitions A351005.
A011782 counts compositions.
A357621 gives half-alternating sum of standard compositions, skew A357623.
A357645 counts compositions by half-alternating sum, skew A357646.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Table[#[[i]]==#[[i+1]],{i,2,Length[#]-1,2}]&&And@@Table[#[[i]]!=#[[i+1]],{i,1,Length[#]-1,2}]&]],{n,0,10}]

Extensions

More terms from Alois P. Heinz, Oct 19 2022

A351011 Numbers k such that the k-th composition in standard order has even length and alternately equal and unequal parts, i.e., all run-lengths equal to 2.

Original entry on oeis.org

0, 3, 10, 36, 43, 58, 136, 147, 228, 235, 528, 547, 586, 676, 698, 904, 915, 2080, 2115, 2186, 2347, 2362, 2696, 2707, 2788, 2795, 3600, 3619, 3658, 3748, 3770, 8256, 8323, 8458, 8740, 8747, 8762, 9352, 9444, 9451, 10768, 10787, 10826, 11144, 11155, 14368
Offset: 1

Views

Author

Gus Wiseman, Feb 03 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The terms together with their binary expansions and standard compositions begin:
    0:           0  ()
    3:          11  (1,1)
   10:        1010  (2,2)
   36:      100100  (3,3)
   43:      101011  (2,2,1,1)
   58:      111010  (1,1,2,2)
  136:    10001000  (4,4)
  147:    10010011  (3,3,1,1)
  228:    11100100  (1,1,3,3)
  235:    11101011  (1,1,2,2,1,1)
  528:  1000010000  (5,5)
  547:  1000100011  (4,4,1,1)
  586:  1001001010  (3,3,2,2)
  676:  1010100100  (2,2,3,3)
  698:  1010111010  (2,2,1,1,2,2)
  904:  1110001000  (1,1,4,4)
  915:  1110010011  (1,1,3,3,1,1)
		

Crossrefs

The case of twins (binary weight 2) is A000120.
All terms are evil numbers A001969.
These compositions are counted by A003242 interspersed with 0's.
Partitions of this type are counted by A035457, any length A351005.
The Heinz numbers of these compositions are A062503.
Taking singles instead of twins gives A333489, complement A348612.
This is the anti-run case of A351010.
The strict case (distinct twins) is A351009, counted by A077957(n-2).
A011782 counts compositions.
A085207/A085208 represent concatenation of standard compositions.
A345167 ranks alternating compositions, counted by A025047.
A350355 ranks up/down compositions, counted by A025048.
A350356 ranks down/up compositions, counted by A025049.
A351014 counts distinct runs in standard compositions.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],And@@(#==2&)/@Length/@Split[stc[#]]&]

A351593 Number of odd-length integer partitions of n into parts that are alternately equal and strictly decreasing.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 4, 2, 4, 3, 5, 4, 6, 4, 8, 6, 9, 6, 12, 7, 14, 10, 16, 11, 20, 13, 24, 16, 28, 18, 34, 21, 40, 26, 46, 30, 56, 34, 64, 41, 75, 48, 88, 54, 102, 64, 118, 73, 138, 84, 159, 98, 182, 112, 210, 128, 242, 148, 276, 168, 318
Offset: 0

Views

Author

Gus Wiseman, Feb 23 2022

Keywords

Comments

Also odd-length partitions whose run-lengths are all 2's, except for the last, which is 1.

Examples

			The a(1) = 1 through a(15) = 6 partitions (A..F = 10..15):
  1  2  3  4  5    6  7    8    9    A    B      C    D      E    F
              221     331  332  441  442  443    552  553    554  663
                                          551         661    662  771
                                          33221       44221       44331
                                                                  55221
		

Crossrefs

The even-length ordered version is A003242, ranked by A351010.
The opposite version is A053251, even-length A351007, any length A351006.
This is the odd-length case of A351005, even-length A035457.
With only equalities we get:
- opposite any length: A351003
- opposite odd-length: A000009 (except at 0)
- opposite even-length: A351012
- any length: A351004
- odd-length: A351594
- even-length: A035363
Without equalities we get:
- opposite any length: A122129 (apparently)
- opposite odd-length: A122130 (apparently)
- opposite even-length: A351008
- any length: A122135 (apparently)
- odd-length: A351595
- even-length: A122134 (apparently)

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],OddQ[Length[#]]&&And@@Table[If[EvenQ[i],#[[i]]!=#[[i+1]],#[[i]]==#[[i+1]]],{i,Length[#]-1}]&]],{n,0,30}]

A351009 Numbers k such that the k-th composition in standard order is a concatenation of distinct twins (x,x).

Original entry on oeis.org

0, 3, 10, 36, 43, 58, 136, 147, 228, 528, 547, 586, 676, 904, 2080, 2115, 2186, 2347, 2362, 2696, 2707, 2788, 3600, 3658, 3748, 8256, 8323, 8458, 8740, 8747, 8762, 9352, 10768, 10787, 11144, 14368, 14474, 14984, 32896, 33027, 33290, 33828, 33835, 33850, 34963
Offset: 1

Views

Author

Gus Wiseman, Feb 03 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The terms together with their binary expansions and standard compositions begin:
    0:           0  ()
    3:          11  (1,1)
   10:        1010  (2,2)
   36:      100100  (3,3)
   43:      101011  (2,2,1,1)
   58:      111010  (1,1,2,2)
  136:    10001000  (4,4)
  147:    10010011  (3,3,1,1)
  228:    11100100  (1,1,3,3)
  528:  1000010000  (5,5)
  547:  1000100011  (4,4,1,1)
  586:  1001001010  (3,3,2,2)
  676:  1010100100  (2,2,3,3)
  904:  1110001000  (1,1,4,4)
		

Crossrefs

The case of twins (binary weight 2) is A000120.
All terms are evil numbers A001969.
The version for Heinz numbers of partitions is A062503, counted by A035457.
These compositions are counted by A032020 interspersed with 0's.
Taking singles instead of twins gives A349051.
This is the strict (distinct twins) version of A351010 and A351011.
A011782 counts compositions.
A085207 represents concatenation using standard compositions.
A333489 ranks anti-runs, complement A348612.
A345167 ranks alternating compositions, counted by A025047.
A351014 counts distinct runs in standard compositions, see A351015.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]], 1],0]]//Reverse;
    Select[Range[0,1000], UnsameQ@@Split[stc[#]]&&And@@(#==2&)/@Length/@Split[stc[#]]&]
Showing 1-7 of 7 results.