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-1 of 1 results.

A293664 For n >= 0, let E_n be the set of exponents in expression of 2*n as a sum of distinct powers of 2 (2*n = Sum_{e in E_n} 2^e); a(n) = number of distinct values taken by the expression Sum_{e in E_n} s(e)*2^e when s runs over all functions from the positive numbers to the set { +1, -1 }.

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 4, 7, 2, 4, 4, 8, 4, 7, 8, 11, 2, 4, 4, 8, 4, 8, 7, 12, 4, 7, 8, 13, 8, 12, 13, 16, 2, 4, 4, 8, 4, 8, 8, 13, 4, 8, 7, 14, 8, 13, 14, 17, 4, 7, 8, 13, 8, 14, 13, 18, 8, 12, 14, 19, 15, 18, 19, 22, 2, 4, 4, 8, 4, 8, 8, 14, 4, 8, 8, 15, 7, 12
Offset: 0

Views

Author

Rémy Sigrist, Oct 14 2017

Keywords

Comments

More informally, any number n encodes a finite sets of positive numbers, say { e_1, e_2, ..., e_h }, and a(n) gives the number of distinct values of the form +- e_1 +- e_2 ... +- e_h.
The set of exponents in expression for n as a sum of distinct powers of 2 corresponds to the n-th row of A133457.
A number n belongs to A293576 iff a(n) is odd.
a(n) <= 2^A000120(n) for any n >= 0.

Examples

			For n = 15:
- E_15 = { 1, 2, 3, 4 },
- the possible "plus-minus" sums are:
  +4 +3 +2 +1 =  10   (1st value)
  +4 +3 +2 -1 =   8   (2nd value)
  +4 +3 -2 +1 =   6   (3rd value)
  +4 +3 -2 -1 =   4   (4th value)
  +4 -3 +2 +1 =   4   (already seen)
  +4 -3 +2 -1 =   2   (5th value)
  +4 -3 -2 +1 =   0   (6th value)
  +4 -3 -2 -1 =  -2   (7th value)
  -4 +3 +2 +1 =   2   (already seen)
  -4 +3 +2 -1 =   0   (already seen)
  -4 +3 -2 +1 =  -2   (already seen)
  -4 +3 -2 -1 =  -4   (8th value)
  -4 -3 +2 +1 =  -4   (already seen)
  -4 -3 +2 -1 =  -6   (9th value)
  -4 -3 -2 +1 =  -8   (10th value)
  -4 -3 -2 -1 = -10   (11th value)
- hence, a(15) = 11.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=Set(0)); my (b = Vecrev(binary(n))); for (i=1, #b, if (b[i], v = setunion(Set(vector(#v, k, v[k]-i)), Set(vector(#v, k, v[k]+i))););); return (#v); }
Showing 1-1 of 1 results.