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

A266161 Hamming weights of A266089.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 22 2015

Keywords

Crossrefs

Programs

  • Haskell
    a266161 = a000120 . a266089
  • Mathematica
    s[0] = 0; s[n_] := s[n] = Module[{bw = DigitCount[s[n - 1], 2, 1], k = 1}, While[!FreeQ[Array[s, n - 1], k] || Abs[DigitCount[k, 2, 1] - bw] != 1, k++]; k]; DigitCount[Array[s, 100, 0], 2, 1] (* Amiram Eldar, Jul 18 2023 *)

Formula

a(n) = A000120(A266089(n)).
abs(a(n+1) - a(n)) = 1 by definition of A266089.
For n > 0: a(A140253(n)) = n and a(m) < n for m < A140253(n).

A290259 Triangle read by rows: row n (>=1) contains in increasing order the integers for which the binary representation has length n, the first run of 1's has odd length, and all the other runs of 1's have even length.

Original entry on oeis.org

1, 2, 4, 7, 8, 11, 14, 16, 19, 22, 28, 31, 32, 35, 38, 44, 47, 56, 59, 62, 64, 67, 70, 76, 79, 88, 91, 94, 112, 115, 118, 124, 127, 128, 131, 134, 140, 143, 152, 155, 158, 176, 179, 182, 188, 191, 224, 227, 230, 236, 239, 248, 251, 254, 256, 259, 262, 268, 271, 280, 283, 286, 304, 307, 310, 316, 319, 352, 355, 358, 364, 367, 376, 379, 382, 448, 451, 454, 460, 463, 472, 475, 478, 496, 499, 502, 508, 511
Offset: 1

Views

Author

Emeric Deutsch, Sep 12 2017

Keywords

Comments

The viabin numbers of integer partitions having only odd parts. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [7,5]. The southeast border of its Ferrers board yields 11111011 (length is 8), leading to the viabin number 251 (a term in row 8).
Number of entries in row n is the Fibonacci number F(n) = A000045(n).
T(n,k) = A290258(n+1,k) - 2^n.
Last entry in row n = A140253(n).

Examples

			115 is in the sequence; indeed, its binary representation, namely 1110011, has first run of 1's of odd length and the other runs of 1's have even length.
Triangle begins:
   1;
   2;
   4,  7;
   8, 11, 14;
  16, 19, 22, 28, 31;
  32, 35, 38, 44, 47, 56, 59, 62;
  ...
		

Crossrefs

Programs

  • Maple
    A[1] := {1}; A[2] := {2}; for n from 3 to 10 do A[n] := `union`(map(proc (x) 2*x end proc, A[n-1]), map(proc (x) 4*x+3 end proc, A[n-2])) end do; # yields sequence in triangular form
  • Mathematica
    nmax = 10; A[1] = {1}; A[2] = {2}; For[n = 3, n <= nmax, n++, A[n] = Union[2 A[n-1], 4 A[n-2] + 3]]; Table[A[n], {n, 1, nmax}] // Flatten (* Jean-François Alcover, Aug 26 2024, after Maple program *)

Formula

The entries in row n (n>=3) are (i) 2x, where x is in row n-1, and (ii) 4y + 3, where y is in row n-2. The Maple program is based on this.

A155997 Triangle read by rows: T(n, k) = f(n, k) + f(n, n-k), where f(n, k) = binomial(n, k)*(1 + (-1)^k)/2.

Original entry on oeis.org

2, 1, 1, 2, 0, 2, 1, 3, 3, 1, 2, 0, 12, 0, 2, 1, 5, 10, 10, 5, 1, 2, 0, 30, 0, 30, 0, 2, 1, 7, 21, 35, 35, 21, 7, 1, 2, 0, 56, 0, 140, 0, 56, 0, 2, 1, 9, 36, 84, 126, 126, 84, 36, 9, 1, 2, 0, 90, 0, 420, 0, 420, 0, 90, 0, 2, 1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11, 1
Offset: 0

Views

Author

Roger L. Bagula, Feb 01 2009

Keywords

Comments

Row sums are: {2, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,...}

Examples

			Triangle begins as:
  2;
  1, 1;
  2, 0,  2;
  1, 3,  3,  1;
  2, 0, 12,  0,   2;
  1, 5, 10, 10,   5,   1;
  2, 0, 30,  0,  30,   0,   2;
  1, 7, 21, 35,  35,  21,   7,  1;
  2, 0, 56,  0, 140,   0,  56,  0,  2;
  1, 9, 36, 84, 126, 126,  84, 36,  9, 1;
  2, 0, 90,  0, 420,   0, 420,  0, 90, 0, 2;
		

Programs

  • GAP
    Flat(List([0..12], n-> List([0..n], k-> Binomial(n, k)*(2 + (-1)^k*(1 + (-1)^n))/2 ))); # G. C. Greubel, Dec 01 2019
  • Magma
    [Binomial(n, k)*(2+(-1)^k*(1+(-1)^n))/2: k in [0..n], n in [0..12]]; // G. C. Greubel, Dec 01 2019
    
  • Maple
    seq(seq( binomial(n, k)*(2+(-1)^k*(1+(-1)^n))/2, k=0..n), n=0..12); # G. C. Greubel, Dec 01 2019
  • Mathematica
    f[n_, k_]:= (Binomial[n, k] + (-1)^k*Binomial[n, k])/2; Table[f[n,k]+f[n,n-k], {n,0,10}, {k,0,n}]//Flatten
    Table[Binomial[n, k]*(2+(-1)^k*(1+(-1)^n))/2, {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Dec 01 2019 *)
  • PARI
    T(n,k) = binomial(n, k)*(2 + (-1)^k*(1 + (-1)^n))/2; \\ G. C. Greubel, Dec 01 2019
    
  • Sage
    [[binomial(n, k)*(2+(-1)^k*(1+(-1)^n))/2 for k in (0..n)] for n in (0..12)] # G. C. Greubel, Dec 01 2019
    

Formula

T(n, k) = f(n, k) + f(n, n-k), where f(n, k) = binomial(n, k)*(1 + (-1)^k)/2.
From G. C. Greubel, Dec 01 2019: (Start)
T(n, k) = binomial(n, k)*(2 + (-1)^k*(1 + (-1)^n))/2.
Sum_{k=0..n} T(n,k) = 2^n for n >= 1.
Sum_{k=0..n-1} T(n,k) = (2^(n+1) - 3 - (-1)^n)/2 = A140253(n), n >= 2. (End)

A290191 Binary representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 673", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 10, 111, 1110, 11111, 111110, 1111111, 11111110, 111111111, 1111111110, 11111111111, 111111111110, 1111111111111, 11111111111110, 111111111111111, 1111111111111110, 11111111111111111, 111111111111111110, 1111111111111111111, 11111111111111111110
Offset: 0

Views

Author

Robert Price, Jul 23 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 673; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[i, 2 * i - 1]], 10], {i, 1, stages - 1}]

Formula

Conjecture: a(n) is the binary representation of 2^(n - 1) - 1 - (n mod 2).

A208324 Triangle T(n,k), read by rows, given by (2, -1/2, 1/2, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (4, -2, 0, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 2, 4, 3, 10, 8, 4, 18, 28, 16, 5, 28, 64, 72, 32, 6, 40, 120, 200, 176, 64, 7, 54, 200, 440, 576, 416, 128, 8, 70, 308, 840, 1456, 1568, 960, 256, 9, 88, 448, 1456, 3136, 4480, 4096, 2176, 512, 10, 108, 624, 2352, 6048, 10752, 13056, 10368, 4864
Offset: 0

Views

Author

Philippe Deléham, Feb 25 2012

Keywords

Comments

Row sums are A134931(n).
Diagonal sums are A140253(n).
Compare this sequence with A207627.
Column k is divisible by 2^k.

Examples

			Triangle begins :
1
2, 4
3, 10, 8
4, 18, 28, 16
5, 28, 64, 72, 32
6, 40, 120, 200, 176, 64
7, 54, 200, 440, 576, 416, 128
8, 70, 308, 840, 1456, 1568, 960, 256
9, 88, 448, 1456, 3136, 4480, 4096, 2176, 512
10, 108, 624, 2352, 6048, 10752, 13056, 10368, 4864, 1024
		

Crossrefs

Formula

T(n,0) = n+1.
T(n,1) = 2*T(n,0) + T(n-1,1).
T(n,k) = 2*T(n-1,k-1) + T(n-1,k) for k>1.
T(n,k) = 2*T(n-1,k) + 2*T(n-1,k-1) - T(n-2,k) - 2*T(n-2,k-1) with T(0,0) = 1, T(1,0) = 2, T(1,1) = 4.
G.f.: (1+2*y*x)/(1-2*(1+y)*x+(1+2*y)*x^2).
Showing 1-5 of 5 results.