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

A038573 a(n) = 2^A000120(n) - 1.

Original entry on oeis.org

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, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 3, 7, 7, 15, 7, 15, 15, 31, 7, 15, 15, 31, 15, 31, 31, 63, 1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 3, 7, 7, 15, 7, 15, 15, 31
Offset: 0

Views

Author

Keywords

Comments

Essentially the same sequence as A001316, which has much more information, and also A159913. - N. J. A. Sloane, Jun 05 2009
Smallest number with same number of 1's in its binary expansion as n.
Fixed point of the morphism 0 -> 01, 1 -> 13, 3 -> 37, ... = k -> k, 2k+1, ... starting from a(0) = 0; 1 -> 01 -> 0113 -> 01131337 -> 011313371337377(15) -> ..., . - Robert G. Wilson v, Jan 24 2006
From Gary W. Adamson, Jun 04 2009: (Start)
As an infinite string, 2^n terms per row starting with "1": (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;...)
Row sums of that triangle = A027649: (1, 4, 14, 46, 454, ...); where the next row sum = current term of A027649 + next term in finite difference row of A027649, i.e., (1, 3, 10, 32, 100, 308, ...) = A053581. (End)
From Omar E. Pol, Jan 24 2016: (Start)
Partial sums give A267700.
a(n) is also the number of cells turned ON at n-th generation of the cellular automaton of A267700 in a 90-degree sector on the square grid.
a(n) is also the number of Y-toothpicks added at n-th generation of the structure of A267700 in a 120-degree sector on the triangular grid. (End)
Row sums of A090971. - Nikolaos Pantelidis, Nov 23 2022

Examples

			9 = 1001 -> 0011 -> 3, so a(9)=3.
From _Gary W. Adamson_, Jun 04 2009: (Start)
Triangle read by rows:
  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;
  ...
Row sums: (1, 4, 14, 46, ...) = A027649 = last row terms + new set of terms such that row 3 = (1, 3, 3, 7,) + (3, 7, 7, 15) = 14 + 32 = A027649(2) + A053581(3). (End)
The rows of this triangle converge to A159913. - _N. J. A. Sloane_, Jun 05 2009
G.f. = x + x^2 + 3*x^3 + x^4 + 3*x^5 + 3*x^6 + 7*x^7 + x^8 + 3*x^9 + 3*x^10 + 7*x^11 + ... - _Michael Somos_, Jul 24 2023
		

Crossrefs

This is Guy Steele's sequence GS(3, 6) (see A135416).
Write n in b-ary, sort digits into increasing order: this sequence (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), A319657 (b=9), A004185 (b=10).
Column k=0 of A340666.

Programs

  • Haskell
    a038573 0 = 0
    a038573 n = (m + 1) * (a038573 n') + m where (n', m) = divMod n 2
    -- Reinhard Zumkeller, Oct 10 2012, Feb 07 2011
    (Python 3.10+)
    def A038573(n): return (1<Chai Wah Wu, Nov 15 2022
  • Maple
    seq(2^convert(convert(n,base,2),`+`)-1, n=0..100); # Robert Israel, Jan 24 2016
  • Mathematica
    Array[ 2^Count[ IntegerDigits[ #, 2 ], 1 ]-1&, 100 ]
    Nest[ Flatten[ # /. a_Integer -> {a, 2a + 1}] &, {0}, 7] (* Robert G. Wilson v, Jan 24 2006 *)
  • PARI
    {a(n) = 2^subst(Pol(binary(n)), x, 1) - 1};
    
  • PARI
    a(n) = 2^hammingweight(n)-1; \\ Michel Marcus, Jan 24 2016
    

Formula

a(2n) = a(n), a(2n+1) = 2*a(n)+1, a(0) = 0. a(n) = A001316(n)-1 = 2^A000120(n) - 1. - Daniele Parisse
a(n) = number of positive integers k < n such that n XOR k = n-k (cf. A115378). - Paul D. Hanna, Jan 21 2006
a(n) = f(n, 1) with f(x, y) = if x = 0 then y - 1 else f(floor(x/2), y*(1 + x mod 2)). - Reinhard Zumkeller, Nov 21 2009
a(n) = (n mod 2 + 1) * a(floor(n/2)) + n mod 2. - Reinhard Zumkeller, Oct 10 2012
a(n) = Sum_{i=1..n} C(n,i) mod 2. - Wesley Ivan Hurt, Nov 17 2017
G.f.: -1/(1 - x) + Product_{k>=0} (1 + 2*x^(2^k)). - Ilya Gutkovskiy, Aug 20 2019
G.f. A(x) = x + x^2*A(x) + (1 + 2*x)*(1 - x^2)*A(x^2). - Michael Somos, Jul 24 2023

Extensions

More terms from Erich Friedman
New definition from N. J. A. Sloane, Mar 01 2008

A267610 Total number of OFF (white) cells after n iterations of the "Rule 182" elementary cellular automaton starting with a single ON (black) cell.

Original entry on oeis.org

0, 0, 2, 2, 4, 6, 12, 12, 14, 16, 22, 24, 30, 36, 50, 50, 52, 54, 60, 62, 68, 74, 88, 90, 96, 102, 116, 122, 136, 150, 180, 180, 182, 184, 190, 192, 198, 204, 218, 220, 226, 232, 246, 252, 266, 280, 310, 312, 318, 324, 338, 344, 358, 372, 402, 408, 422, 436
Offset: 0

Views

Author

Robert Price, Jan 18 2016

Keywords

Comments

From Gus Wiseman, Mar 30 2019: (Start)
It appears that a(n) is also the number of increasing binary-containment pairs of distinct positive integers up to n + 1. A pair of positive integers is a binary containment if the positions of 1's in the reversed binary expansion of the first are a subset of the positions of 1's in the reversed binary expansion of the second. For example, the a(2) = 2 through a(8) = 14 pairs are:
{1,3} {1,3} {1,3} {1,3} {1,3} {1,3} {1,3}
{2,3} {2,3} {1,5} {1,5} {1,5} {1,5} {1,5}
{2,3} {2,3} {1,7} {1,7} {1,7}
{4,5} {2,6} {2,3} {2,3} {1,9}
{4,5} {2,6} {2,6} {2,3}
{4,6} {2,7} {2,7} {2,6}
{3,7} {3,7} {2,7}
{4,5} {4,5} {3,7}
{4,6} {4,6} {4,5}
{4,7} {4,7} {4,6}
{5,7} {5,7} {4,7}
{6,7} {6,7} {5,7}
{6,7}
{8,9}
(End)

References

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

Crossrefs

Programs

  • Mathematica
    rule=182; rows=20; ca=CellularAutomaton[rule,{{1},0},rows-1,{All,All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]],{rows-k+1,rows+k-1}],{k,1,rows}]; (* Truncated list of each row *) nbc=Table[Total[catri[[k]]],{k,1,rows}]; (* Number of Black cells in stage n *) nwc=Table[Length[catri[[k]]]-nbc[[k]],{k,1,rows}]; (* Number of White cells in stage n *) Table[Total[Take[nwc,k]],{k,1,rows}] (* Number of White cells through stage n *)

Formula

Conjecture: a(n) = A267700(n) - n. - Gus Wiseman, Mar 30 2019
G.f.: (1/x)*(A(x)/x - (x+1)/(1-x)^2) where A(x) is the g.f. for A006046 (conjectured). - John Tyler Rascoe, Jul 08 2024

A080572 Number of ordered pairs (i,j), 0 <= i,j < n, for which (i & j) is nonzero, where & is the bitwise AND operator.

Original entry on oeis.org

0, 0, 1, 2, 7, 8, 15, 24, 37, 38, 49, 62, 81, 98, 121, 146, 175, 176, 195, 216, 247, 272, 307, 344, 387, 420, 463, 508, 559, 608, 663, 720, 781, 782, 817, 854, 909, 950, 1009, 1070, 1141, 1190, 1257, 1326, 1405, 1478, 1561, 1646, 1737, 1802, 1885, 1970, 2065, 2154
Offset: 0

Views

Author

Richard Bean, Feb 22 2003

Keywords

Comments

Conjectured to be less than or equal to lcs(n) (see sequence A063437). The value of a(2^n) is that given in Stinson and van Rees and the value of a(2^n-1) is that given in Fu, Fu and Liao. This function gives an easy way to generate these two constructions.
From Gus Wiseman, Mar 30 2019: (Start)
Also the number of ordered pairs of positive integers up to n with at least one binary carry. A binary carry of two positive integers is an overlap of the positions of 1's in their reversed binary expansion. For example, the a(2) = 1 through a(6) = 15 ordered pairs are:
(1,1) (1,1) (1,1) (1,1) (1,1)
(2,2) (1,3) (1,3) (1,3)
(2,2) (2,2) (1,5)
(2,3) (2,3) (2,2)
(3,1) (3,1) (2,3)
(3,2) (3,2) (3,1)
(3,3) (3,3) (3,2)
(4,4) (3,3)
(3,5)
(4,4)
(4,5)
(5,1)
(5,3)
(5,4)
(5,5)
(End)
a(n) is also the number of even elements in the n X n symmetric Pascal matrix. - Stefano Spezia, Nov 14 2022

References

  • C. Fu, H. Fu and W. Liao, A new construction for a critical set in special Latin squares, Proceedings of the Twenty-sixth Southeastern International Conference on Combinatorics, Graph Theory and Computing (Boca Raton, Florida, 1995), Congressus Numerantium, Vol. 110 (1995), pp. 161-166.
  • D. R. Stinson and G. H. J. van Rees, Some large critical sets, Proceedings of the Eleventh Manitoba Conference on Numerical Mathematics and Computing (Winnipeg, Manitoba, 1981), Congressus Numerantium, Vol. 34 (1982), pp. 441-456.

Crossrefs

Programs

  • Maple
    f:=proc(n) option remember; local t;
    if n <= 1 then 0
    elif (n mod 2) =  0 then 3*f(n/2)+(n/2)^2
    else t:=(n-1)/2; f(t)+2*f(t+1)+t^2-1; fi; end;
    [seq(f(n),n=0..100)]; # N. J. A. Sloane, Jul 01 2017
  • Mathematica
    a[0] = a[1] = 0; a[n_] := a[n] = If[EvenQ[n], 3*a[n/2] + n^2/4, 2*a[(n-1)/2 + 1] + a[(n-1)/2] + (1/4)*(n-1)^2 - 1];
    Array[a, 60, 0] (* Jean-François Alcover, Dec 09 2017, from Dover's formula *)
    Table[Length[Select[Tuples[Range[n-1],2],Intersection[Position[Reverse[IntegerDigits[#[[1]],2]],1],Position[Reverse[IntegerDigits[#[[2]],2]],1]]!={}&]],{n,0,20}] (* Gus Wiseman, Mar 30 2019 *)

Formula

a(2^n) = 4^n-3^n = A005061(n); a(2^n+1) = 4^n-3^n+1 = A155609(n); a(2^n-1) = 4^n-3^n-2^(n+1)+3.
a(0)=a(1)=0, a(2n) = 3a(n)+n^2, a(2n+1) = a(n)+2a(n+1)+n^2-1. This was proved by Jeremy Dover. - Ralf Stephan, Dec 08 2004
a(n) = (A325104(n) - n)/2. - Gus Wiseman, Mar 30 2019

A325106 Number of divisible binary-containment pairs of positive integers up to n.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 26, 27, 28, 31, 32, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 53, 56, 57, 58, 61, 63, 64, 65, 66, 67, 70, 71, 72, 77, 77, 78, 79, 80, 81
Offset: 0

Views

Author

Gus Wiseman, Mar 28 2019

Keywords

Comments

A pair of positive integers is divisible if the first divides the second, and is a binary containment if the positions of 1's in the reversed binary expansion of the first are a subset of the positions of 1's in the reversed binary expansion of the second.

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n],{2}],Divisible[#[[2]],#[[1]]]&&SubsetQ[Position[Reverse[IntegerDigits[#[[2]],2]],1],Position[Reverse[IntegerDigits[#1[[1]],2]],1]]&]],{n,0,30}]

Formula

a(n) = A325101(n) - n.

A160720 Number of "ON" cells at n-th stage in 2-dimensional cellular automaton (see Comments for precise definition).

Original entry on oeis.org

0, 1, 5, 9, 21, 25, 37, 49, 77, 81, 93, 105, 133, 145, 173, 201, 261, 265, 277, 289, 317, 329, 357, 385, 445, 457, 485, 513, 573, 601, 661, 721, 845, 849, 861, 873, 901, 913, 941, 969, 1029, 1041, 1069, 1097, 1157, 1185, 1245, 1305, 1429, 1441, 1469, 1497
Offset: 0

Views

Author

Omar E. Pol, May 25 2009

Keywords

Comments

We work on the vertices of the square grid Z^2, and define the neighbors of a cell to be the four closest cells along the diagonals.
We start at stage 0 with all cells in OFF state.
At stage 1, we turn ON a single cell at the origin.
Once a cell is ON it stays ON.
At each subsequent stage, a cell in turned ON if exactly one of its neighboring cells that are no further from the origin is ON.
The "no further from the origin" condition matters for the first time at stage 8, when only A160721(8) = 28 cells are turned ON, and a(8) = 77. In contrast, A147562(8) = 85, A147582(8) = 36.
This CA also arises as the cross-section in the (X,Y)-plane of the CA in A151776.
In other words, a cell is turned ON if exactly one of its vertices touches an exposed vertex of a ON cell of the previous generation. A special rule for this sequence is that every ON cell has only one vertex that should be considered not exposed: its nearest vertex to the center of the structure.
Analog to the "outward" version (A266532) of the Y-toothpick cellular automaton of A160120 on the triangular grid, but here we have ON cells on the square grid. See also the formula section. - Omar E. Pol, Jan 19 2016
This cellular automaton can be interpreted as the outward version of the Ulam-Warburton two-dimensional cellular automaton (see A147562). - Omar E. Pol, Jun 22 2017

Examples

			If we label the generations of cells turned ON by consecutive numbers we get the cell pattern shown below:
9...............9
.8.8.8.8.8.8.8.8.
..7...7...7...7..
.8.6.6.....6.6.8.
....5.......5....
.8.6.4.4.4.4.6.8.
..7...3...3...7..
.8...4.2.2.4...8.
........1........
.8...4.2.2.4...8.
..7...3...3...7..
.8.6.4.4.4.4.6.8.
....5.......5....
.8.6.6.....6.6.8.
..7...7...7...7..
.8.8.8.8.8.8.8.8.
9...............9
		

Crossrefs

Programs

  • Maple
    cellOn := [[0,0]] : bbox := [0,0,0,0]: # llx, lly, urx, ury isOn := proc(x,y,L) local i ; for i in L do if op(1,i) = x and op(2,i) = y then RETURN(true) ; fi; od: RETURN(false) ; end: bb := proc(L) local mamin,i; mamin := [0,0,0,0] ; for i in L do mamin := subsop(1=min(op(1,mamin),op(1,i)),mamin) ; mamin := subsop(2=min(op(2,mamin),op(2,i)),mamin) ; mamin := subsop(3=max(op(1,mamin),op(1,i)),mamin) ; mamin := subsop(4=max(op(2,mamin),op(2,i)),mamin) ; od: mamin ; end: for gen from 2 to 80 do nGen := [] ; print(nops(cellOn)) ; for x from op(1,bbox)-1 to op(3,bbox)+1 do for y from op(2,bbox)-1 to op(4,bbox)+1 do # not yet in list? if not isOn(x,y,cellOn) then
    # loop over 4 neighbors of (x,y) non := 0 ; for dx from -1 to 1 by 2 do for dy from -1 to 1 by 2 do # test of a neighbor nearer to origin if x^2+y^2 >= (x+dx)^2+(y+dy)^2 then if isOn(x+dx,y+dy,cellOn) then non := non+1 ; fi; fi; od: od: # exactly one neighbor on: add to nGen if non = 1 then nGen := [op(nGen), [x,y]] ; fi; fi; od: od: # merge old and new generation cellOn := [op(cellOn),op(nGen)] ; bbox := bb(cellOn) ; od: # R. J. Mathar, Jul 14 2009
  • Mathematica
    A160720[0]=0; A160720[n_]:=Total[With[{m = n - 1}, BitOr @@ (Function[pos, CellularAutomaton[{FromDigits[Boole[#[[2, 2]] == 1 || Count[Flatten[#], 1] == 1 && Count[Extract[#, pos], 1] == 1] & /@ Tuples[{1, 0}, {3, 3}], 2], 2, {1, 1}}, {{{1}}, 0}, {{{m}}, {-m, m}, {-m, m}}]] /@ Partition[{{-1, -1}, {-1, 1}, {1, 1}, {1, -1}}, 2, 1, 1])], 2] (* JungHwan Min, Jan 23 2016 *)
    A160720[0]=0; A160720[n_]:=Total[With[{m = n - 1}, BitOr @@ (CellularAutomaton[{#, 2, {1, 1}}, {{{1}}, 0}, {{{m}}, {-m, m}, {-m, m}}] & /@ {13407603346151304507647333602124270744930157291580986197148043437687863763597662002711256755796972443613438635551055889478487182262900810351549134401372178, 13407603346151304507647333602124270744930157291580986197148043437687863763597777794800494071992396014598447323458909159463152822826940267935557047531012112, 13407603346151304507647333602124270744930157291580986197148043437687863763597777794800494071992396014598447323458909159463152822826940286382301121240563712, 13407603346151304507647333602124270744930157291580986197148043437687863763597662002711256755796972443613438635551055889478487182262900828798293208110923778})], 2] (* JungHwan Min, Jan 23 2016 *)
    A160720[0]=0; A160720[n_]:=Total[With[{m = n - 1}, BitOr @@ (CellularAutomaton[{46, {2, ReplacePart[ArrayPad[{{1}}, 1], # -> 2]}, {1, 1}}, {{{1}}, 0}, {{{m}}, All, All}] & /@ Partition[{{-1, -1}, {-1, 1}, {1, 1}, {1, -1}}, 2, 1, 1])], 2] (* JungHwan Min, Jan 24 2016 *)

Formula

Conjecture: a(n) = 1 + 4*(A266532(n) - 1)/3, n >= 1. - Omar E. Pol, Jan 19 2016. This formula is correct! - N. J. A. Sloane, Jan 23 2016
a(n) = 1 + 4*A267700(n-1) = 1 + 2*(A159912(n) - n), n >= 1. - Omar E. Pol, Jan 24 2016

Extensions

Edited by N. J. A. Sloane, Jun 26 2009
More terms from David Applegate, Jul 03 2009

A325096 Number of maximal subsets of {1...n} with no binary carries.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 5, 5, 7, 9, 10, 12, 13, 14, 15, 15, 20, 25, 27, 32, 34, 36, 37, 42, 44, 46, 47, 49, 50, 51, 52, 52, 67, 82, 87, 102, 107, 112, 114, 129, 134, 139, 141, 146, 148, 150, 151, 166, 171, 176, 178, 183, 185, 187, 188, 193, 195, 197, 198, 200, 201
Offset: 0

Views

Author

Gus Wiseman, Mar 27 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(1) = 1 through a(9) = 7 maximal subsets:
  {1}  {12}  {3}   {34}   {25}   {16}   {7}    {78}    {69}
             {12}  {124}  {34}   {25}   {16}   {168}   {78}
                          {124}  {34}   {25}   {258}   {168}
                                 {124}  {34}   {348}   {249}
                                        {124}  {1248}  {258}
                                                       {348}
                                                       {1248}
		

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}];
    maxim[s_]:=Complement[s,Last/@Select[Tuples[s,2],UnsameQ@@#&&SubsetQ@@#&]];
    Table[Length[maxim[Select[Subsets[Range[n]],stableQ[#,Intersection[binpos[#1],binpos[#2]]!={}&]&]]],{n,0,10}]

Formula

a(2^n - 1) = A000110(n).

Extensions

a(15)-a(61) from Alois P. Heinz, Mar 28 2019

A325103 Number of increasing pairs of positive integers up to n with no binary carries.

Original entry on oeis.org

0, 0, 1, 1, 4, 5, 6, 6, 13, 16, 19, 20, 23, 24, 25, 25, 40, 47, 54, 57, 64, 67, 70, 71, 78, 81, 84, 85, 88, 89, 90, 90, 121, 136, 151, 158, 173, 180, 187, 190, 205, 212, 219, 222, 229, 232, 235, 236, 251, 258, 265, 268, 275, 278, 281, 282, 289, 292, 295, 296
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) = 1 through a(9) = 16 pairs:
  {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}
                {2,4}  {2,4}  {1,6}  {1,6}  {1,6}  {1,6}
                {3,4}  {2,5}  {2,4}  {2,4}  {1,8}  {1,8}
                       {3,4}  {2,5}  {2,5}  {2,4}  {2,4}
                              {3,4}  {3,4}  {2,5}  {2,5}
                                            {2,8}  {2,8}
                                            {3,4}  {2,9}
                                            {3,8}  {3,4}
                                            {4,8}  {3,8}
                                            {5,8}  {4,8}
                                            {6,8}  {4,9}
                                            {7,8}  {5,8}
                                                   {6,8}
                                                   {6,9}
                                                   {7,8}
		

Crossrefs

Programs

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

Formula

a(n) = A325102(n)/2.

A325104 Number of increasing pairs of positive integers up to n with at least one binary carry.

Original entry on oeis.org

0, 0, 0, 2, 2, 5, 9, 15, 15, 20, 26, 35, 43, 54, 66, 80, 80, 89, 99, 114, 126, 143, 161, 182, 198, 219, 241, 266, 290, 317, 345, 375, 375, 392, 410, 437, 457, 486, 516, 551, 575, 608, 642, 681, 717, 758, 800, 845, 877, 918, 960, 1007, 1051, 1100, 1150, 1203
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.
The version for ordered pairs is A080572.

Examples

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

Crossrefs

Programs

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

Formula

a(n) = 2 * A080572(n - 2) + n.

A325098 Number of binary carry-connected integer partitions of n.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 7, 7, 13, 15, 23, 27, 42, 50, 72, 88, 125, 153, 211, 258, 349, 430, 569, 698, 914, 1119, 1444, 1765, 2252, 2745, 3470, 4214, 5276, 6387, 7934, 9568, 11800, 14181, 17379, 20818, 25351, 30264, 36668, 43633, 52589, 62394, 74872, 88576, 105818
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(8) = 13 partitions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (111)  (22)    (32)     (33)      (322)      (44)
                    (31)    (311)    (51)      (331)      (53)
                    (1111)  (11111)  (222)     (511)      (62)
                                     (321)     (3211)     (71)
                                     (3111)    (31111)    (332)
                                     (111111)  (1111111)  (2222)
                                                          (3221)
                                                          (3311)
                                                          (5111)
                                                          (32111)
                                                          (311111)
                                                          (11111111)
		

Crossrefs

Programs

  • Maple
    h:= proc(n, s) local i, m; m:= n;
          for i in s do m:= Bits[Or](m, i) od; {m}
        end:
    g:= (n, s)-> (w-> `if`(w={}, s union {n}, s minus w union
                  h(n, w)))(select(x-> Bits[And](n, x)>0, s)):
    b:= proc(n, i, s) option remember; `if`(n=0, `if`(nops(s)>1, 0, 1),
          `if`(i<1, 0, b(n, i-1, s)+ b(n-i, min(i, n-i), g(i, s))))
        end:
    a:= n-> b(n$2, {}):
    seq(a(n), n=0..50);  # Alois P. Heinz, Mar 29 2019
  • 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],Length[csm[binpos/@#]]<=1&]],{n,0,20}]
    (* Second program: *)
    h[n_, s_] := Module[{i, m = n}, Do[m = BitOr[m, i], {i, s}]; {m}];
    g[n_, s_] := Function[w, If[w == {}, s ~Union~ {n}, (s ~Complement~ w) ~Union~
        h[n, w]]][Select[s, BitAnd[n, #] > 0&]];
    b[n_, i_, s_] := b[n, i, s] = If[n == 0, If[Length[s] > 1, 0, 1],
        If[i < 1, 0, b[n, i - 1, s] + b[n - i, Min[i, n - i], g[i, s]]]];
    a[n_] := b[n, n, {}];
    a /@ Range[0, 50] (* Jean-François Alcover, May 11 2021, after Alois P. Heinz *)

Extensions

a(21)-a(48) from Alois P. Heinz, Mar 29 2019

A325110 Number of strict integer partitions of n with no binary containments.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 5, 2, 3, 2, 6, 3, 6, 7, 15, 8, 10, 6, 13, 6, 10, 12, 23, 13, 16, 16, 26, 21, 30, 37, 60, 43, 52, 42, 60, 42, 50, 54, 81, 59, 60, 66, 80, 74, 86, 108, 145, 119, 125, 126, 144, 134, 140, 170, 208, 189, 193, 221, 248, 253, 292, 323, 435, 392
Offset: 0

Views

Author

Gus Wiseman, Mar 28 2019

Keywords

Comments

A pair of positive integers is a binary containment if the positions of 1's in the reversed binary expansion of the first are a subset of the positions of 1's in the reversed binary expansion of the second.

Examples

			The a(1) = 1 through a(12) = 3 partitions (A = 10, B = 11, C = 12):
  (1)  (2)  (3)   (4)  (5)   (6)   (7)    (8)   (9)   (A)   (B)    (C)
            (21)       (41)  (42)  (43)   (53)  (63)  (82)  (65)   (84)
                                   (52)         (81)        (83)   (93)
                                   (61)                     (92)
                                   (421)                    (A1)
                                                            (821)
		

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}];
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&stableQ[#,SubsetQ[binpos[#1],binpos[#2]]&]&]],{n,0,30}]
Showing 1-10 of 21 results. Next