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 11 results. Next

A161924 Permutation of natural numbers: sequence A126441 without zeros.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 6, 11, 15, 16, 17, 10, 19, 13, 23, 31, 32, 33, 18, 35, 12, 21, 14, 39, 27, 47, 63, 64, 65, 34, 67, 20, 37, 22, 71, 25, 43, 29, 79, 55, 95, 127, 128, 129, 66, 131, 36, 69, 38, 135, 24, 41, 26, 75, 45, 30, 143, 51, 87, 59, 159, 111, 191, 255, 256
Offset: 1

Views

Author

Alford Arnold, Jun 23 2009

Keywords

Comments

Values appear in the order determined by A004760(n+1)and A062383(n).
The graph of this sequence looks very elegant.

Examples

			The table begins:
1.2.4..8.16.32.64.128.256.512.1024
..3.5..9.17.33.65.129.257.513.1025
.......6.10.18.34..66.130.258..514
....7.11.19.35.67.131.259.515.1027
............12.20..36..68.132..260
.........13.21.37..69.133.261..517
............14.22..38..70.134..262
......15.23.39.71.135.263.519.1031
...................24..40..72..136
...............25..41..73.137..265
...................26..42..74..138
............27.43..75.139.267..523
.......................28..44...76
...............29..45..77.141..269
...................30..46..78..142
.........31.47.79.143.271.527.1039
...........................48...80
.......................49..81..145
...........................50...82
...................51..83.147..275
This can be viewed as an irregular table, where row r (>= 1) has A000041(r) elements, that is, as 1; 2,3; 4,5,7; 8,9,6,11,15; 16,17,10,19,13,23,31; etc. A125106 illustrates how each number is mapped to a partition.
		

Crossrefs

Inverse: A166276. a(n) = A126441(A166274(n)). See A161919 for the version with each row sorted into ascending order.
A161511(a(n)) = A036042(n).

Programs

  • Mathematica
    columns = 9; row[n_] := n - 2^Floor[Log2[n]]; col[0] = 0; col[n_] := If[EvenQ[n], col[n/2] + DigitCount[n/2, 2, 1], col[(n - 1)/2] + 1]; Clear[T]; T[, ] = 0; Do[T[row[k], col[k]] = k, {k, 1, 2^columns}]; Table[DeleteCases[Table[T[n - 1, k], {n, 1, 2^(k - 1)}], 0], {k, 1, columns}] // Flatten (* Jean-François Alcover, Sep 09 2017 *)

Extensions

Edited and extended by Antti Karttunen, Oct 12 2009

A140691 Suppress the zeros in A126441 and resort the natural numbers as illustrated in sequence A136101.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 15, 6, 16, 17, 19, 23, 31, 10, 13, 32, 33, 35, 39, 47, 63, 18, 21, 27, 12, 14, 64, 65, 67, 71, 79, 95, 127, 34, 37, 43, 55, 20, 25, 22, 29, 128, 129, 131, 135, 143, 159, 191, 255, 66, 69, 75, 87, 111, 36, 41, 51, 38, 45, 59, 24, 26, 30, 256, 257, 259
Offset: 1

Views

Author

Alford Arnold, May 23 2008

Keywords

Comments

Table A138138 (a shell model) is another sequence illustrating row patterns for numeric partitions.

Examples

			A136101(11) is 36 and is 2*2*3*3 corresponding to the partition 2+2 which maps to 6 in A136101 so A140691(11) is 6.
		

Crossrefs

A166274 Positions of nonzero terms in A126441.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 20, 22, 30, 31, 32, 33, 34, 35, 36, 37, 38, 42, 46, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 74, 76, 78, 86, 94, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 140, 141, 142, 146, 150, 154, 158, 174
Offset: 1

Views

Author

Antti Karttunen, Oct 12 2009

Keywords

Comments

Here we assume that the starting offset of A126441 is 0, i.e., A126441(0)=1, A126441(1)=2, etc.

Crossrefs

Complement: A166275. See A161924.

A140760 Irregular table of natural numbers (read by columns) which can be mapped to the source partitions described in A053445 and A126441.

Original entry on oeis.org

2, 6, 12, 14, 24, 26, 30, 28, 48, 50, 54, 62, 52, 58, 96, 56, 60, 98, 102, 110, 126, 100, 106, 118, 192, 104, 108, 194, 114, 122, 198, 206, 222, 254, 112, 124, 116, 196, 202, 214, 238, 384, 120, 200, 204, 386, 210, 218, 390, 230, 246, 398, 414, 446, 510
Offset: 1

Views

Author

Alford Arnold, May 28 2008

Keywords

Comments

Sequences A000041, A002865 and A053445 count numeric partitions. A125106 maps numeric partitions to the natural numbers and has A000120 elements per row. A126441 has A000041 elements per column and is a tabular arrangement of the natural numbers. A140691 is a rearrangement of table A126441. A140692 extracts the cyclic cases and has A002865 elements per column.
The values for A140760 can also be generated by beginning with A140759 and repeatedly multiplying by two as follows:
2
....6.....12......24.....48.....96
..........14..........28........56
..................26........52....
..................30............60
.........................50.......
.........................54.......
.........................62.......
Note that the number of entries in each column is given by A053445.

Examples

			The values of A140760 can be obtained by selecting the first even number on each applicable row of Table A126441.
Table A126441 begins
1.2.4..8.16.32.64.128.256.512.1024
..3.5..9.17.33.65.129.257.513.1025
.......6.10.18.34..66.130.258..514
....7.11.19.35.67.131.259.515.1027
............12.20..36..68.132..260
.........13.21.37..69.133.261..517
............14.22..38..70.134..262
......15.23.39.71.135.263.519.1031
...................24..40..72..136
...............25..41..73.137..265
...................26..42..74..138
............27.43..75.139.267..523
.......................28..44...76
...............29..45..77.141..269
...................30..46..78..142
.........31.47.79.143.271.527.1039
...........................48...80
.......................49..81..145
...........................50...82
...................51..83.147..275
		

Crossrefs

A166275 Positions of zeros in A126441.

Original entry on oeis.org

5, 11, 12, 13, 19, 21, 23, 24, 25, 26, 27, 28, 29, 39, 40, 41, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 71, 73, 75, 77, 79, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108
Offset: 1

Views

Author

Antti Karttunen, Oct 12 2009

Keywords

Comments

Here we assume that the starting offset of A126441 is 0, i.e. A126441(0)=1, A126441(1)=2, etc.

Crossrefs

Complement: A166274.

A171426 Row sum of column n in A126441 or A161924.

Original entry on oeis.org

1, 5, 16, 49, 129, 341, 833, 2029, 4760, 11068, 25182, 56888, 126661, 280169, 613893, 1337386, 2893793, 6232013, 13352607, 28497552, 60580905, 128368080, 271153740, 571224871, 1200298631, 2516483260, 5264785310, 10993631034, 22915508186, 47688470005
Offset: 1

Views

Author

Alford Arnold, Dec 12 2009

Keywords

Comments

From Emeric Deutsch, Sep 06 2017: (Start)
Row sums of the triangle A161919.
a(n) = sum of the viabin numbers of the partitions of n. 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 [3,1,1] of 5. The southeast border of its Ferrers board yields 10011, leading to the viabin number 19. (End)

Examples

			The values 8,9,6,11,15 map to 1111,211,22,31,4, respectively; so a(4) = 8+9+6+11+15 = 49.
		

Crossrefs

Programs

  • Maple
    with(combinat): a := proc (n) local ff, partovi: ff := proc (X) local s: s := [1, seq(0, j = 1 .. X[2])]: s := map(convert, s, string): return cat(op(s)) end proc: partovi := proc (P) local X, n, Y, i: X := convert(P, multiset): n := X[-1][1]: Y := map(proc (t) options operator, arrow: t[1] end proc, X): for i to n do if member(i, Y) = false then X := [op(X), [i, 0]] end if end do: X := sort(X, proc (s, t) options operator, arrow: evalb(s[1] < t[1]) end proc): X := map(ff, X); X := cat(op(X)): n := parse(X): n := convert(n, decimal, binary): (1/2)*n end proc: add(partovi(partition(n)[j]), j = 1 .. numbpart(n)) end proc: seq(a(n), n = 1 .. 27); # the subprogram partovi (due to W. Edwin Clark) yields the viabin number of a given partition. # Emeric Deutsch, Sep 06 2017
    # second Maple program:
    b:= proc(n, i, l, r) option remember; `if`(n=0, r, `if`(i>n, 0,
          b(n, i+1, l, r)+b(n-i, i$2, ((x-> 2*x+1)@@(i-l))(2*r))))
        end:
    a:= n-> b(n, 1, 0$2):
    seq(a(n), n=1..30);  # Alois P. Heinz, Mar 01 2021
  • Mathematica
    b[n_, i_, l_, r_] := b[n, i, l, r] = If[n == 0, r, If[i>n, 0,
         b[n, i+1, l, r] + b[n-i, i, i, Nest[2#+1&, 2r, i-l]]]];
    a[n_] := b[n, 1, 0, 0];
    Array[a, 30] (* Jean-François Alcover, Mar 02 2021, after Alois P. Heinz *)

Extensions

Ninth term corrected by Alford Arnold, Jan 22 2010
Offset changed to 1 and a(17)-a(27) from Emeric Deutsch, Sep 06 2017
a(28)-a(30) from Alois P. Heinz, Sep 07 2017

A126442 Triangular array t read by rows: t(0,k) is p(k), the number of partitions of the k-multiset {0,0,...,0} with k zeros. For 0 <= n < k, t(n, k) is the number of partitions of the k-multiset {0, 0, ..., 0, 1, 2, 3, ..., k-n} with n zeros.

Original entry on oeis.org

1, 2, 2, 3, 4, 5, 5, 7, 11, 15, 7, 12, 21, 36, 52, 11, 19, 38, 74, 135, 203, 15, 30, 64, 141, 296, 566, 877, 22, 45, 105, 250, 592, 1315, 2610, 4140, 30, 67, 165, 426, 1098, 2752, 6393, 13082, 21147, 42, 97, 254, 696, 1940, 5317, 13960, 33645, 70631, 115975
Offset: 1

Views

Author

Alford Arnold, Jan 28 2007

Keywords

Comments

First in a series of triangular arrays which comprise subsequences of A096443(n).
The second array begins 9 16 26 29 52 92 47 98 198 371 and when the arrays are aligned as illustrated in triangle A126441 with p(n) values they sum to A035310 which counts unordered multisets.
Let t(n, k) be the number of ways to partition the k-multiset {0,0,...,0,1,2,3,4,...,k-n} with n zeros, 0 <= n < k. Then t(n, k) = sum_i = 0..k j = 0..n S(n, j) C(i, j) p(k - n - i), where S(n, j) are Stirling numbers of the second kind, C(i, j) are the number of compositions of i distinct objects into j parts, and p is the integer partition function.
To see this, partition [n] into j blocks; there are S(n, j) partitions. For such a partition x and for each i, there are C(i, j) ways to distribute i zeros into x, because the blocks of x are all distinct. There are p(k-n-i) ways to partition the remaining k-n-i zeros. Multiplying and summing gives the result. - George Beck, Jan 10 2011
Values are also part of A096443, A129306 and A249620. Columns are also columns of the last one of these irregular triangles. See "Partitions_of_multisets" link. - Tilman Piesk, Nov 09 2014

Examples

			This first array includes only the hook cases. A096443(9,14,16) correspond to partitions [2,2], [3,2] and [2,2,1] so these values do not appear in A126442.
The array begins:
1
2 2
3 4 5
5 7 11 15
7 12 21 36 52
		

Crossrefs

Programs

  • Mathematica
    (* The triangle is flattened to a sequence. *)
    t[n_, k_] := Sum[StirlingS2[n, j] * Binomial[-1 + i + j, i] * PartitionsP[k - n - i], {j, 0, n}, {i, 0, k - n}]; Table[ t[n, k], {k, 10}, {n, 0, k - 1}] // Flatten (* George Beck, Jan 10 2011 *)

Extensions

Definition clarified by George Beck, Jan 11 2011

A055941 a(n) = Sum_{j=0..k-1} (i(j) - j) where n = Sum_{j=0..k-1} 2^i(j).

Original entry on oeis.org

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

Views

Author

Anno Siegel (siegel(AT)zrz.tu-berlin.de), Jul 18 2000

Keywords

Comments

Used to calculate number of subspaces of Zp^n where Zp is field of integers mod p.
Consider a square matrix A and call it special if (0) A is an upper triangular matrix, (1) a nonzero column of A has a 1 on the main diagonal and (2) if a row has a 1 on the main diagonal then this is the only nonzero element in that row.
If the diagonal of a special matrix is given (it can only contain 0's and 1's), many of the fields of A are determined by (0), (1) and (2). The number of fields that can be freely chosen while still satisfying (0), (1) and (2) is a(n), where n is the diagonal, read as a binary number with least significant bit at upper left.
a(n) is also the minimum number of adjacent bit swap operations required to pack all the ones of n to the right. - Philippe Beaudoin, Aug 19 2014
From Rakesh Khanna A, Aug 06 2021: (Start)
a(n) is also the area under the curve formed from the binary representation of n where each 0-bit corresponds to an increase of one unit along the x-axis and each 1-bit corresponds to an increase of one unit along the y-axis.
E.g., n = 20 = 10100_2 and the area under the curve shown below is a(n) = 5.
1 0 1 0 0
\ \ \ \ \ |
\ \ \+----+----+
\ \ | |
\+----+ +
| |
----+----+----+----+
(End)

Examples

			20 = 2^4 + 2^2, thus a(20) = (2-0) + (4-1) = 5.
		

References

  • A. Siegel, Linear Aspects of Boolean Functions, 1999 (unpublished).

Crossrefs

Programs

  • Mathematica
    b[n_] := b[n] = If[n == 0, 0, If[EvenQ[n], b[n/2] + DigitCount[n/2, 2, 1], b[(n - 1)/2] + 1]];
    a[n_] := b[n] - DigitCount[n, 2, 1];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 23 2018 *)
  • PARI
    a(n) = {my(b=binary(n)); nb = 0; for (i=1, #b-1, if (b[i], nb += sum(j=i+1, #b, !b[j]));); nb;} \\ Michel Marcus, Aug 12 2014
    
  • Python
    def A055941(n):
        s = bin(n)[2:]
        return sum(s[i:].count('0') for i,d in enumerate(s,start=1) if d == '1')
    # Chai Wah Wu, Sep 07 2014

Formula

a(n) = Sum (total number of 0-bits to the right of 1-bit) over all 1-bits of n.
a(n) = A161511(n) - A000120(n) = A161920(n+1) - 1 - A029837(n+1).
a(n) = 0 if A241816(n) = n; 1 + a(A241816(n)) otherwise. - Philippe Beaudoin, Aug 19 2014

Extensions

Edited and extended by Antti Karttunen, Oct 12 2009

A161920 a(n) = A161511(A004760(n)).

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 6, 4, 8, 7, 8, 6, 9, 7, 8, 5, 10, 9, 10, 8, 11, 9, 10, 7, 12, 10, 11, 8, 12, 9, 10, 6, 12, 11, 12, 10, 13, 11, 12, 9, 14, 12, 13, 10, 14, 11, 12, 8, 15, 13, 14, 11, 15, 12, 13, 9, 16, 13, 14, 10, 15, 11, 12, 7, 14, 13, 14, 12, 15, 13, 14, 11, 16, 14, 15, 12, 16
Offset: 1

Views

Author

Alford Arnold, Jun 24 2009

Keywords

Comments

a(n) gives the one-based position of the first nonzero term on the row n-1 of A126441.
Sequence A016116 can be used to identify the extracted subsequence by computing the number of terms to alternately extract and skip. [This comment is from the original submitter. I don't understand it. - Antti Karttunen, Oct 12 2009]

Crossrefs

a(n) = A161511(A004760(n)) = 1 + A055941(n-1) + A029837(n).

Programs

  • Python
    def A161920(n):
        a, b = 1+(m:=n-1).bit_length(), 1
        for i, j in enumerate(bin(m)[:1:-1], 1):
            if int(j):
                a += i-b
                b += 1
        return a # Chai Wah Wu, Jul 26 2023

Extensions

Edited and extended by Antti Karttunen, Oct 12 2009

A140759 An irregular table of natural numbers used to generate the values in sequence A140760; which, in turn, can be mapped to the source partitions counted by A053445.

Original entry on oeis.org

2, 6, 14, 26, 30, 50, 54, 62, 58, 98, 102, 110, 126, 106, 118, 194, 114, 122, 198, 206, 222, 254, 202, 214, 238, 386, 210, 218, 390, 230, 246, 398, 414, 446, 510
Offset: 1

Views

Author

Alford Arnold, May 27 2008

Keywords

Crossrefs

Showing 1-10 of 11 results. Next