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.

Previous Showing 11-20 of 22 results. Next

A336137 Number of set partitions of the binary indices of n with equal block-sums.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 3, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1
Offset: 0

Views

Author

Gus Wiseman, Jul 12 2020

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The a(n) set partitions for n = 7, 59, 119, 367, 127:
  {123}    {12456}      {123567}      {1234679}    {1234567}
  {12}{3}  {126}{45}    {1236}{57}    {12346}{79}  {1247}{356}
           {15}{24}{6}  {156}{237}    {1249}{367}  {1256}{347}
                        {17}{26}{35}  {1267}{349}  {1346}{257}
                                      {169}{2347}  {167}{2345}
                                                   {16}{25}{34}{7}
The binary indices of 382 are {2,3,4,5,6,7,9}, with equal block-sum set partitions:
  {{2,7},{3,6},{4,5},{9}}
  {{2,4,6},{3,9},{5,7}}
  {{2,7,9},{3,4,5,6}}
  {{2,3,4,9},{5,6,7}}
  {{2,3,6,7},{4,5,9}}
  {{2,4,5,7},{3,6,9}}
  {{2,3,4,5,6,7,9}}
so a(382) = 7.
		

Crossrefs

These set partitions are counted by A035470.
The version for twice-partitions is A279787.
The version for partitions of partitions is A305551.
The version for factorizations is A321455.
The version for normal multiset partitions is A326518.
The version for distinct block-sums is A336138.
Set partitions of binary indices are A050315.
Normal multiset partitions with equal lengths are A317583.
Normal multiset partitions with equal averages are A326520.
Multiset partitions with equal block-sums are ranked by A326534.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    Table[Length[Select[sps[bpe[n]],SameQ@@Total/@#&]],{n,0,100}]

A325102 Number of ordered pairs of positive integers up to n with no binary carries.

Original entry on oeis.org

0, 0, 2, 2, 8, 10, 12, 12, 26, 32, 38, 40, 46, 48, 50, 50, 80, 94, 108, 114, 128, 134, 140, 142, 156, 162, 168, 170, 176, 178, 180, 180, 242, 272, 302, 316, 346, 360, 374, 380, 410, 424, 438, 444, 458, 464, 470, 472, 502, 516, 530, 536, 550, 556, 562, 564, 578
Offset: 0

Views

Author

Gus Wiseman, Mar 28 2019

Keywords

Comments

A binary carry of two positive integers is an overlap of the positions of 1's in their reversed binary expansion.

Examples

			The a(2) = 2 through a(6) = 12 pairs:
  (1,2)  (1,2)  (1,2)  (1,2)  (1,2)  (1,2)
  (2,1)  (2,1)  (1,4)  (1,4)  (1,4)  (1,4)
                (2,1)  (2,1)  (1,6)  (1,6)
                (2,4)  (2,4)  (2,1)  (2,1)
                (3,4)  (2,5)  (2,4)  (2,4)
                (4,1)  (3,4)  (2,5)  (2,5)
                (4,2)  (4,1)  (3,4)  (3,4)
                (4,3)  (4,2)  (4,1)  (4,1)
                       (4,3)  (4,2)  (4,2)
                       (5,2)  (4,3)  (4,3)
                              (5,2)  (5,2)
                              (6,1)  (6,1)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Tuples[Range[n],2],Intersection[Position[Reverse[IntegerDigits[#[[1]],2]],1],Position[Reverse[IntegerDigits[#[[2]],2]],1]]=={}&]],{n,0,30}]

Formula

a(n) = 2 * A325103(n).

A325123 Number of divisible pairs of positive integers up to n with no binary carries.

Original entry on oeis.org

0, 0, 1, 1, 3, 3, 4, 4, 7, 7, 9, 9, 12, 12, 13, 13, 17, 17, 19, 19, 22, 22, 23, 23, 28, 28, 29, 29, 31, 31, 32, 32, 37, 37, 39, 39, 44, 44, 45, 45, 50, 50, 52, 52, 54, 54, 55, 55, 62, 62, 64, 64, 66, 66, 68, 68, 72, 72, 73, 73, 76, 76, 77, 77, 83, 83, 85, 85
Offset: 0

Views

Author

Gus Wiseman, Mar 29 2019

Keywords

Comments

Two positive integers are divisible if the first divides the second, and they have a binary carry if the positions of 1's in their reversed binary expansion overlap.
a(2k+1) = a(2k), since an odd number and any divisor will overlap in the last digit. Additionally, a(2k+2) > a(2k+1) because the pair {1,2k+2} is always valid. Therefore, every term appears exactly twice. - Charlie Neder, Apr 02 2019

Examples

			The a(2) = 1 through a(11) = 9 pairs:
  {1,2}  {1,2}  {1,2}  {1,2}  {1,2}  {1,2}  {1,2}  {1,2}  {1,2}   {1,2}
                {1,4}  {1,4}  {1,4}  {1,4}  {1,4}  {1,4}  {1,4}   {1,4}
                {2,4}  {2,4}  {1,6}  {1,6}  {1,6}  {1,6}  {1,6}   {1,6}
                              {2,4}  {2,4}  {1,8}  {1,8}  {1,8}   {1,8}
                                            {2,4}  {2,4}  {2,4}   {2,4}
                                            {2,8}  {2,8}  {2,8}   {2,8}
                                            {4,8}  {4,8}  {4,8}   {4,8}
                                                          {1,10}  {1,10}
                                                          {5,10}  {5,10}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Tuples[Range[n],2],Divisible@@Reverse[#]&&Intersection[Position[Reverse[IntegerDigits[#[[1]],2]],1],Position[Reverse[IntegerDigits[#[[2]],2]],1]]=={}&]],{n,0,20}]

A325099 Number of binary carry-connected strict integer partitions of n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 1, 4, 5, 8, 6, 11, 11, 15, 13, 18, 20, 30, 29, 43, 49, 68, 66, 84, 94, 125, 131, 165, 184, 237, 251, 291, 315, 383, 408, 486, 536, 663, 714, 832, 912, 1104, 1195, 1405, 1554, 1877, 2046, 2348, 2559, 2998, 3256, 3730, 4084, 4793, 5230, 5938
Offset: 0

Views

Author

Gus Wiseman, Mar 28 2019

Keywords

Comments

A binary carry of two positive integers is an overlap of the positions of 1's in their reversed binary expansion. An integer partition is binary carry-connected if the graph whose vertices are the parts and whose edges are binary carries is connected.

Examples

			The a(1) = 1 through a(11) = 6 strict partitions (A = 10, B = 11):
  (1)  (2)  (3)  (4)   (5)   (6)    (7)  (8)   (9)    (A)    (B)
                 (31)  (32)  (51)        (53)  (54)   (64)   (65)
                             (321)       (62)  (63)   (73)   (74)
                                         (71)  (72)   (91)   (632)
                                               (531)  (532)  (731)
                                                      (541)  (5321)
                                                      (631)
                                                      (721)
		

Crossrefs

Programs

  • Mathematica
    binpos[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    csm[s_]:=With[{c=Select[Tuples[Range[Length[s]],2],And[OrderedQ[#],UnsameQ@@#,Length[Intersection@@s[[#]]]>0]&]},If[c=={},s,csm[Sort[Append[Delete[s,List/@c[[1]]],Union@@s[[c[[1]]]]]]]]];
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&Length[csm[binpos/@#]]<=1&]],{n,0,30}]

A325100 Heinz numbers of strict integer partitions with no binary carries.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 14, 17, 19, 21, 23, 26, 29, 31, 33, 35, 37, 38, 41, 42, 43, 47, 53, 57, 58, 59, 61, 67, 69, 71, 73, 74, 79, 83, 86, 89, 95, 97, 101, 103, 106, 107, 109, 111, 113, 114, 122, 123, 127, 131, 133, 137, 139, 142, 149, 151, 157, 158, 159
Offset: 1

Views

Author

Gus Wiseman, Mar 28 2019

Keywords

Comments

A binary carry of two positive integers is an overlap of the positions of 1's in their reversed binary expansion.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1) * ... * prime(y_k), so these are squarefree numbers whose prime indices have no carries. A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with their prime indices begins:
   1: {}
   2: {1}
   3: {2}
   5: {3}
   6: {1,2}
   7: {4}
  11: {5}
  13: {6}
  14: {1,4}
  17: {7}
  19: {8}
  21: {2,4}
  23: {9}
  26: {1,6}
  29: {10}
  31: {11}
  33: {2,5}
  35: {3,4}
  37: {12}
  38: {1,8}
  41: {13}
  42: {1,2,4}
		

Crossrefs

Programs

  • Mathematica
    binpos[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    stableQ[u_,Q_]:=!Apply[Or,Outer[#1=!=#2&&Q[#1,#2]&,u,u,1],{0,1}];
    Select[Range[100],SquareFreeQ[#]&&stableQ[PrimePi/@First/@FactorInteger[#],Intersection[binpos[#1],binpos[#2]]!={}&]&]

A325124 Number of divisible pairs of positive integers up to n with at least one binary carry.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 10, 12, 13, 16, 18, 20, 23, 25, 28, 32, 33, 35, 39, 41, 44, 48, 51, 53, 56, 59, 62, 66, 70, 72, 79, 81, 82, 86, 88, 92, 96, 98, 101, 105, 108, 110, 116, 118, 122, 128, 131, 133, 136, 139, 143, 147, 151, 153, 159, 163, 167, 171, 174, 176, 185
Offset: 0

Views

Author

Gus Wiseman, Mar 29 2019

Keywords

Comments

Two positive integers are divisible if the first divides the second, and they have a binary carry if the positions of 1's in their reversed binary expansion overlap.

Examples

			The a(1) = 1 through a(8) = 13 pairs:
  (1,1)  (1,1)  (1,1)  (1,1)  (1,1)  (1,1)  (1,1)  (1,1)
         (2,2)  (1,3)  (1,3)  (1,3)  (1,3)  (1,3)  (1,3)
                (2,2)  (2,2)  (1,5)  (1,5)  (1,5)  (1,5)
                (3,3)  (3,3)  (2,2)  (2,2)  (1,7)  (1,7)
                       (4,4)  (3,3)  (2,6)  (2,2)  (2,2)
                              (4,4)  (3,3)  (2,6)  (2,6)
                              (5,5)  (3,6)  (3,3)  (3,3)
                                     (4,4)  (3,6)  (3,6)
                                     (5,5)  (4,4)  (4,4)
                                     (6,6)  (5,5)  (5,5)
                                            (6,6)  (6,6)
                                            (7,7)  (7,7)
                                                   (8,8)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Tuples[Range[n],2],Divisible@@Reverse[#]&&Intersection[Position[Reverse[IntegerDigits[#[[1]],2]],1],Position[Reverse[IntegerDigits[#[[2]],2]],1]]!={}&]],{n,0,20}]

Formula

a(n) = A307230(n) + n.

A088512 Number of partitions of n into two parts whose xor-sum is n.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 3, 0, 1, 1, 3, 1, 3, 3, 7, 0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 3, 7, 3, 7, 7, 15, 0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 3, 7, 3, 7, 7, 15, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 3, 7, 3, 7, 7, 15, 1, 3, 3, 7
Offset: 0

Views

Author

Naohiro Nomoto, Nov 14 2003

Keywords

Examples

			G.f. = x^3 + x^5 + x^6 + 3*x^7 + x^9 + x^10 + 3*x^11 + x^12 + 3*x^13 + 3*x^14 + ...
From _Emmanuele Villa_, Nov 19 2016: (Start)
For n = 47, the highest power of 2 less than n is 32, so a(47) = A001316(47-32) - 1 = A001316(15) - 1 = 16 - 1 = 15.
For n = 63, the highest power of 2 less than n is 32, so a(63) = A001316(63-32) - 1 = A001316(31) - 1 = 32 - 1 = 31. (End)
		

Crossrefs

Cf. A050315.

Programs

  • Mathematica
    Table[2^DigitCount[# - 2^(Floor@ Log2@ # - Boole@ IntegerQ@ Log2@ #) - 1 + Boole[# == 1]/2, 2, 1] - 1 &[n + 1], {n, 0, 72}] (* Michael De Vlieger, Nov 18 2016 *)
    a[ n_] := Which[ n < 3, 0, EvenQ[n], a @ Quotient[n, 2], True, a[ Quotient[n, 2]] 2 + 1]; (* Michael Somos, Dec 04 2016 *)
  • PARI
    a(n) = sum(m=1, n\2, bitxor(m,n-m)==n); \\ Michel Marcus, Dec 03 2016
    
  • PARI
    {a(n) = if( n<3, 0, n%2, a(n\2)*2 + 1, a(n\2))}; /* Michael Somos, Dec 04 2016 */

Formula

a(0) = 0, a(n) = A001316(n-m)-1, where m is the highest power of 2 less than n. - Emmanuele Villa, Nov 19 2016
a(2*n) = a(n), a(2*n + 1) = 2*a(n) + 1. - Michael Somos, Dec 04 2016

A307431 Number T(n,k) of partitions of n into parts whose bitwise OR equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 1, 0, 4, 0, 2, 0, 1, 1, 5, 0, 2, 2, 0, 1, 0, 7, 0, 2, 0, 5, 0, 1, 1, 8, 1, 2, 2, 6, 1, 0, 1, 0, 11, 0, 4, 0, 12, 0, 2, 0, 1, 1, 12, 0, 5, 4, 15, 0, 2, 2, 0, 1, 0, 15, 0, 5, 0, 28, 0, 2, 0, 5, 0, 1, 1, 17, 1, 5, 5, 35, 0, 2, 2, 6, 2
Offset: 0

Views

Author

Alois P. Heinz, Apr 08 2019

Keywords

Examples

			T(6,1) = 1: 111111.
T(6,2) = 1: 222.
T(6,3) = 5: 11112, 1122, 1113, 123, 33.
T(6,5) = 2: 114, 15.
T(6,6) = 2: 24, 6.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1, 1;
  0, 1, 0,  2;
  0, 1, 1,  2, 1;
  0, 1, 0,  4, 0, 2;
  0, 1, 1,  5, 0, 2, 2;
  0, 1, 0,  7, 0, 2, 0,  5;
  0, 1, 1,  8, 1, 2, 2,  6, 1;
  0, 1, 0, 11, 0, 4, 0, 12, 0, 2;
  0, 1, 1, 12, 0, 5, 4, 15, 0, 2, 2;
  ...
		

Crossrefs

Columns k=0-1 give: A000007, A057427.
Row sums give: A000041.
Main diagonal gives A050315.
Cf. A050314 (the same for XOR), A307432 (the same for AND).

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, x^k, `if`(i<1, 0,
          b(n, i-1, k)+b(n-i, min(n-i, i), Bits[Or](i, k))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..14);

A307505 Number T(n,k) of partitions of n into distinct parts whose bitwise XOR equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Apr 11 2019

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  0, 1;
  0, 0, 1;
  0, 0, 0, 2;
  0, 0, 1, 0, 1;
  0, 1, 0, 0, 0, 2;
  1, 0, 0, 0, 1, 0, 2;
  0, 0, 0, 0, 0, 0, 0, 5;
  0, 0, 0, 0, 1, 0, 4, 0, 1;
  0, 1, 0, 0, 0, 4, 0, 1, 0, 2;
  1, 0, 1, 0, 5, 0, 0, 0, 1, 0, 2;
  ...
		

Crossrefs

Bisection (even part) of column k=0 gives A307506.
Row sums give A000009.
Main diagonal gives A050315.
Cf. A050314.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n=0, x^k, `if`(i<1, 0,
          b(n, i-1, k)+b(n-i, min(n-i, i-1), Bits[Xor](i, k))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..14);

Formula

T(n,k) = 0 if n+k is odd.

A336140 Number of ways to choose a set partition of the parts of a strict integer composition of n.

Original entry on oeis.org

1, 1, 1, 5, 5, 9, 39, 43, 73, 107, 497, 531, 951, 1345, 2125, 8789, 9929, 16953, 24723, 38347, 52717, 219131, 240461, 419715, 600075, 938689, 1278409, 1928453, 6853853, 7815657, 13205247, 19051291, 29325121, 40353995, 60084905, 80722899, 277280079, 312239953
Offset: 0

Views

Author

Gus Wiseman, Jul 16 2020

Keywords

Comments

A strict composition of n is a finite sequence of distinct positive integers summing to n.

Crossrefs

Set partitions are A000110.
Strict compositions are A032020.
Set partitions of binary indices are A050315.
Set partitions of strict partitions are A294617.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(i*(i+1)/2 b(n$2, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jul 30 2020
  • Mathematica
    Table[Sum[BellB[Length[ctn]],{ctn,Join@@Permutations/@Select[ IntegerPartitions[n],UnsameQ@@#&]}],{n,0,10}]
    (* Second program: *)
    b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n, 0, If[n == 0,
         BellB[p]*p!, b[n, i-1, p] + b[n-i, Min[n-i, i-1], p+1]]];
    a[n_] := b[n, n, 0];
    a /@ Range[0, 40] (* Jean-François Alcover, May 21 2021, after Alois P. Heinz *)

Formula

a(n) = Sum_{k = 0..n} A000110(k) * A072574(n,k) = Sum_{k = 0..n} k! * A000110(k) * A008289(n,k).
Previous Showing 11-20 of 22 results. Next