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.

A293576 Numbers n such that the set of exponents in expression for 2*n as a sum of distinct powers of 2 can be partitioned into two parts with equal sums.

This page as a plain text file.
%I A293576 #9 Oct 22 2017 15:22:09
%S A293576 0,7,13,15,22,25,27,30,39,42,45,47,49,51,54,59,60,62,75,76,82,85,87,
%T A293576 90,93,95,97,99,102,107,108,110,117,119,120,122,125,127,141,143,147,
%U A293576 148,153,155,158,162,165,167,170,173,175,179,180,185,187,188,190,193
%N A293576 Numbers n such that the set of exponents in expression for 2*n as a sum of distinct powers of 2 can be partitioned into two parts with equal sums.
%C A293576 More informally, this sequence encodes finite sets of positive numbers, say { e_1, e_2, ..., e_h }, such that +- e_1 +- e_2 ... +- e_h = 0 has a solution.
%C A293576 The set of exponents in expression for n as a sum of distinct powers of 2 corresponds to the n-th row of A133457.
%C A293576 No term can have a Hamming weight of 1 or 2.
%C A293576 If x and y belong to this sequence and x AND y = 0 (where AND stands for the bitwise and-operator), then x + y belongs to this sequence.
%C A293576 If k has an odd Hamming weight, then there are only a finite number of terms with the same odd part as k (see A000265 for the odd part of a number).
%C A293576 The number 2^k-1 belongs to this sequence iff A063865(k) > 0.
%C A293576 If k has Hamming weight > 1, then k + 2^(A029931(k)-1) belongs to this sequence.
%H A293576 Alois P. Heinz, <a href="/A293576/b293576.txt">Table of n, a(n) for n = 1..20000</a>
%e A293576 2*42 = 2^6 + 2^4 + 2^2 and 6 = 4 + 2, hence 42 appears in the sequence.
%e A293576 2*11 = 2^4 + 2^2 + 2^1 and { 1, 2, 4 } cannot be partitioned into two parts with equals sums, hence 11 does not appear in the sequence.
%p A293576 b:= proc(n, t) option remember; `if`(n=0, is(t=0),
%p A293576       (i-> b(n-2^i, t-i) or b(n-2^i, t+i))(ilog2(n)))
%p A293576     end:
%p A293576 a:= proc(n) option remember; local k; for k from 1+
%p A293576      `if`(n=1, -1, a(n-1)) while not b(2*k, 0) do od; k
%p A293576     end:
%p A293576 seq(a(n), n=1..100);  # _Alois P. Heinz_, Oct 22 2017
%o A293576 (PARI) is(n) = { my (v=Set(0)); my (b = Vecrev(binary(n))); for (i=1, #b, if (b[i], v = set union(Set(vector(#v, k, v[k]-i)), Set(vector(#v, k, v[k]+i))););); return (set search(v,0)); }
%Y A293576 Cf. A000120, A000265, A029931, A133457, A293664.
%K A293576 nonn,base
%O A293576 1,2
%A A293576 _Rémy Sigrist_, Oct 12 2017