[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A306299 Number of binary carry-connected subsets of [n] containing n (for n > 0). 2

%I #29 May 10 2020 08:38:17

%S 1,1,1,4,1,12,28,64,1,212,452,960,1972,4032,8128,16384,1,64284,129260,

%T 259904,520636,1043264,2087744,4177920,8381836,16768832,33541952,

%U 67092480,134201152,268419072,536854528,1073741824,1,4294569380,8589336404,17179068096

%N Number of binary carry-connected subsets of [n] containing n (for n > 0).

%C Two integers are binary carry-connected if their bitwise AND is not zero.

%C For n = 0 the carry-connected subset is the empty set.

%H Alois P. Heinz, <a href="/A306299/b306299.txt">Table of n, a(n) for n = 0..1024</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Bitwise operation">Bitwise operation</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>

%F a(n) = A325105(n) - A325105(n-1) for n > 0, a(0) = 1.

%F a(n) = 1 <=> n in { A131577 }.

%F a(n) mod 4 = 0 <=> not (n in { A131577 }).

%p h:= proc(n, s) local i, m; m:= n;

%p for i in s do m:= Bits[Or](m, i) od; {m}

%p end:

%p g:= (n, s)-> (w-> `if`(w={}, s union {n}, s minus w union

%p h(n, w)))(select(x-> Bits[And](n, x)>0, s)):

%p b:= proc(n, s) option remember; `if`(n=0,

%p `if`(nops(s)>1, 0, 1), b(n-1, s)+b(n-1, g(n, s)))

%p end:

%p a:= n-> `if`(n=0, 1, b(n-1, {n})):

%p seq(a(n), n=0..42);

%t h[n_, s_] := Module[{i, m = n}, Do[m = BitOr[m, i], {i, s}]; {m}];

%t g[n_, s_] := Function[w, If[w == {}, s ~Union~ {n}, s ~Complement~ w ~Union~ h[n, w]]][Select[s, BitAnd[n, #] > 0&]];

%t b[n_, s_] := b[n, s] = If[n == 0, If[Length[s] > 1, 0, 1], b[n - 1, s] + b[n - 1, g[n, s]]];

%t a[n_] := If[n == 0, 1, b[n - 1, {n}]];

%t a /@ Range[0, 42] (* _Jean-François Alcover_, May 10 2020, after Maple *)

%Y Partial differences of A325105.

%Y Cf. A131577.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Mar 31 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 29 21:13 EDT 2024. Contains 375518 sequences. (Running on oeis4.)