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

A342639 Square array T(n, k), n, k >= 0, read by antidiagonals; T(n, k) = g(f(n) + f(k)) where g maps the complement, say s, of a finite set of nonnegative integers to the value Sum_{e >= 0 not in s} 2^e, f is the inverse of g, and "+" denotes the Minkowski sum.

Original entry on oeis.org

0, 1, 1, 0, 3, 0, 3, 1, 1, 3, 0, 7, 2, 7, 0, 1, 1, 3, 3, 1, 1, 0, 3, 0, 15, 0, 3, 0, 7, 1, 5, 3, 3, 5, 1, 7, 0, 15, 2, 7, 0, 7, 2, 15, 0, 1, 1, 7, 3, 1, 1, 3, 7, 1, 1, 0, 3, 0, 31, 4, 11, 4, 31, 0, 3, 0, 3, 1, 1, 3, 7, 5, 5, 7, 3, 1, 1, 3, 0, 7, 2, 7, 0, 15, 6, 15, 0, 7, 2, 7, 0
Offset: 0

Views

Author

Rémy Sigrist, Mar 17 2021

Keywords

Comments

In other words:
- we consider the set S of sets s of nonnegative integers whose complement is finite,
- the function g encodes the "missing integers" in binary:
g(A001477 \ {1, 4}) = 2^1 + 2^4 = 18
- the function f is the inverse of g:
f(42) = f(2^1 + 2^3 + 2^5) = A001477 \ {1, 3, 5},
- the Minkowski sum of two sets, say U and V, is the set of sums u+v where u belongs to U and v belongs to V,
- the Minkowski sum is stable over S,
- and T provides an encoding for this operation.
This sequence has connections with A067138; here we consider complements of finite sets of nonnegative integers, there finite sets of nonnegative integers.

Examples

			Array T(n, k) begins:
  n\k|   0   1   2   3   4   5   6    7   8   9  10  11  12  13  14   15
  ---+------------------------------------------------------------------
    0|   0   1   0   3   0   1   0    7   0   1   0   3   0   1   0   15
    1|   1   3   1   7   1   3   1   15   1   3   1   7   1   3   1   31
    2|   0   1   2   3   0   5   2    7   0   1   2  11   0   5   2   15
    3|   3   7   3  15   3   7   3   31   3   7   3  15   3   7   3   63
    4|   0   1   0   3   0   1   4    7   0   1   0   3   0   9   4   15
    5|   1   3   5   7   1  11   5   15   1   3   5  23   1  11   5   31
    6|   0   1   2   3   4   5   6    7   0   9   2  11   4  13   6   15
    7|   7  15   7  31   7  15   7   63   7  15   7  31   7  15   7  127
    8|   0   1   0   3   0   1   0    7   0   1   0   3   0   1   8   15
    9|   1   3   1   7   1   3   9   15   1   3   1   7   1  19   9   31
   10|   0   1   2   3   0   5   2    7   0   1  10  11   0   5  10   15
   11|   3   7  11  15   3  23  11   31   3   7  11  47   3  23  11   63
   12|   0   1   0   3   0   1   4    7   0   1   0   3   8   9  12   15
   13|   1   3   5   7   9  11  13   15   1  19   5  23   9  27  13   31
   14|   0   1   2   3   4   5   6    7   8   9  10  11  12  13  14   15
   15|  15  31  15  63  15  31  15  127  15  31  15  63  15  31  15  255
		

Crossrefs

Programs

  • PARI
    T(n,k) = { my (v=0); for (x=0, #binary(n)+#binary(k), my (f=0); for (y=0, x, if (!bittest(n,y) && !bittest(k,x-y), f=1; break)); if (!f, v+=2^x)); return (v) }

Formula

T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).
T(n, 0) = A135481(n).
T(n, 1) = A038712(n+1).
T(2^n-1, 2^k-1) = 2^(n+k)-1.
T(n, n) = A342640(n).

A342640 a(n) = A342639(n, n).

Original entry on oeis.org

0, 3, 2, 15, 0, 11, 6, 63, 0, 3, 10, 47, 8, 27, 14, 255, 0, 3, 2, 15, 0, 43, 22, 191, 0, 35, 10, 111, 24, 59, 30, 1023, 0, 3, 2, 15, 0, 11, 38, 63, 0, 3, 42, 175, 8, 91, 46, 767, 0, 3, 2, 143, 32, 43, 54, 447, 32, 99, 42, 239, 56, 123, 62, 4095, 0, 3, 2, 15, 0
Offset: 0

Views

Author

Rémy Sigrist, Mar 17 2021

Keywords

Comments

For any n >= 0:
- let s(n) be the unique finite set of nonnegative integers such that n = Sum_{e in s(n)} 2^e,
- then s(a(n)) corresponds to the set of nonnegative integers that are not the sum of two nonnegative integers not in s(n).

Examples

			The first terms, alongside the corresponding sets, are:
  n   a(n)  s(n)          s(a(n))
  --  ----  ------------  ------------------------
   0     0  {}            {}
   1     3  {0}           {0, 1}
   2     2  {1}           {1}
   3    15  {0, 1}        {0, 1, 2, 3}
   4     0  {2}           {}
   5    11  {0, 2}        {0, 1, 3}
   6     6  {1, 2}        {1, 2}
   7    63  {0, 1, 2}     {0, 1, 2, 3, 4, 5}
   8     0  {3}           {}
   9     3  {0, 3}        {0, 1}
  10    10  {1, 3}        {1, 3}
  11    47  {0, 1, 3}     {0, 1, 2, 3, 5}
  12     8  {2, 3}        {3}
  13    27  {0, 2, 3}     {0, 1, 3, 4}
  14    14  {1, 2, 3}     {1, 2, 3}
  15   255  {0, 1, 2, 3}  {0, 1, 2, 3, 4, 5, 6, 7}
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0); for (x=0, 2*#binary(n), my (f=0); for (y=0, x, if (!bittest(n,y) && !bittest(n,x-y), f=1; break)); if (!f, v+=2^x)); return (v) }

Formula

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

A342641 Numbers k such that A342640(k) = k.

Original entry on oeis.org

0, 2, 6, 10, 14, 22, 30, 38, 42, 46, 54, 62, 78, 94, 110, 126, 142, 150, 158, 170, 174, 182, 190, 206, 222, 238, 254, 286, 310, 318, 350, 382, 414, 438, 446, 478, 510, 542, 558, 574, 606, 622, 638, 670, 682, 686, 702, 734, 750, 766, 798, 830, 862, 894, 926
Offset: 1

Views

Author

Rémy Sigrist, Mar 17 2021

Keywords

Comments

All terms are even.
For any m >= 0:
- let s(m) be the unique finite set of nonnegative integers such that m = Sum_{e in s(m)} 2^e,
- this sequence contains the numbers k such that s(k) is the set of nonnegative integers that are not the sum of two nonnegative integers not in s(k).

Examples

			The first terms, alongside the corresponding sets, are:
  n   a(n)  s(a(n))
  --  ----  ---------------
   1     0  {}
   2     2  {1}
   3     6  {1, 2}
   4    10  {1, 3}
   5    14  {1, 2, 3}
   6    22  {1, 2, 4}
   7    30  {1, 2, 3, 4}
   8    38  {1, 2, 5}
   9    42  {1, 3, 5}
  10    46  {1, 2, 3, 5}
  11    54  {1, 2, 4, 5}
  12    62  {1, 2, 3, 4, 5}
  13    78  {1, 2, 3, 6}
  14    94  {1, 2, 3, 4, 6}
  15   110  {1, 2, 3, 5, 6}
		

Crossrefs

Programs

  • PARI
    is(n) = { my (v=0); for (x=0, 2*#binary(n), my (f=0); for (y=0, x, if (!bittest(n,y) && !bittest(n,x-y), f=1; break)); if (!f, v+=2^x)); return (v==n) }

A342642 Numbers k such that A342640(k) = 0.

Original entry on oeis.org

0, 4, 8, 16, 20, 24, 32, 36, 40, 48, 64, 68, 72, 80, 84, 88, 96, 100, 104, 112, 128, 132, 136, 144, 148, 152, 160, 164, 168, 176, 192, 196, 200, 208, 216, 224, 228, 256, 260, 264, 272, 276, 280, 288, 292, 296, 304, 320, 324, 328, 336, 340, 344, 352, 356, 360
Offset: 1

Views

Author

Rémy Sigrist, Mar 17 2021

Keywords

Comments

For any m >= 0:
- let s(m) be the unique finite set of nonnegative integers such that m = Sum_{e in s(m)} 2^e,
- this sequence contains the numbers k such that every nonnegative integer is the sum of two nonnegative integers not in s(k).
All terms are even.

Examples

			The first terms, alongside the corresponding sets, are:
  n   a(n)  s(a(n))
  --  ----  ---------
   1     0  {}
   2     4  {2}
   3     8  {3}
   4    16  {4}
   5    20  {2, 4}
   6    24  {3, 4}
   7    32  {5}
   8    36  {2, 5}
   9    40  {3, 5}
  10    48  {4, 5}
  11    64  {6}
  12    68  {2, 6}
  13    72  {3, 6}
  14    80  {4, 6}
  15    84  {2, 4, 6}
		

Crossrefs

Programs

  • PARI
    is(n) = { my (v=0); for (x=0, 2*#binary(n), my (f=0); for (y=0, x, if (!bittest(n, y) && !bittest(n, x-y), f=1; break)); if (!f, v+=2^x)); return (v==0) }

A264613 Numbers n such that the Shevelev polynomial {m, n} has a root at m = -1.

Original entry on oeis.org

2, 5, 8, 11, 23, 32, 47, 95, 128, 191, 383, 512, 767, 1535, 2048, 3071, 6143, 8192, 12287, 24575, 32768, 49151, 98303, 131072, 196607, 393215, 524288, 786431, 1572863, 2097152, 3145727, 6291455, 8388608
Offset: 1

Views

Author

N. J. A. Sloane, Nov 28 2015

Keywords

Comments

From Peter J. C. Moses, Dec 12 2015: (Start)
This appears to split into 3 sequences:
b(n) = 3*4^(n-1)-1, n>=1: 2,11,47,191,767,3071,12287,49151,...,
c(n) = 3*2^(2*n-1)-1, n>=1: 5,23,95,383,1535,6143,24575,98303,...,
d(n) = 2^(2*n+1), n>=1: 8,32,128,512,2048,8192,32768,...;
If this is true, then the next few terms of the sequence are 12582911, 25165823, 33554432, 50331647, 100663295, ...
(End)

Crossrefs

Cf. A133457 (positive integer roots of {m,n}), A263848.

Programs

  • Mathematica
    upDown[n_, k_] := upDown[n, k] = Module[{t, m}, t = Flatten[ Reverse[ Position[ Reverse[ IntegerDigits[k, 2]], 1]]]; m = Length[t]; (-1)^m + Sum[upDown[t[[j]], k - 2^(t[[j]] - 1)]*Binomial[n, t[[j]]], {j, 1, m}]];
    Reap[For[k = 2, k <= 2^15, k++, If[(upDown[n, k] /. n -> -1) == 0, Print[k]; Sow[k]]]][[2, 1]] (* Jean-François Alcover, Sep 06 2018 *)

Formula

Conjectured g.f.: (2 + x*(5 + x*(8 + x*(1 + (-2 - 8*x)* x)))) / (1 + x^3*(-5 + 4*x^3)). - Peter J. C. Moses, Dec 12 2015

Extensions

More terms (starting at a(6)) from Peter J. C. Moses, Dec 12 2015

A341288 Square array T(n, k), read by antidiagonals, n, k >= 0; T(n, k) = XOR_{u in B(n), v in B(k)} 2^(u XOR v) where XOR denotes the bitwise XOR operator and B(n) gives the exponents in expression for n as a sum of powers of 2.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 1, 3, 0, 0, 4, 3, 3, 4, 0, 0, 5, 8, 0, 8, 5, 0, 0, 6, 10, 12, 12, 10, 6, 0, 0, 7, 9, 15, 1, 15, 9, 7, 0, 0, 8, 11, 15, 5, 5, 15, 11, 8, 0, 0, 9, 4, 12, 9, 0, 9, 12, 4, 9, 0, 0, 10, 6, 12, 13, 15, 15, 13, 12, 6, 10, 0
Offset: 0

Views

Author

Rémy Sigrist, Feb 08 2021

Keywords

Comments

For any x >= 0, the function n -> T(n, 2^x) is a self-inverse permutation of the nonnegative integers.
The set of nonnegative integers equipped with T forms a commutative monoid; its invertible elements are the odious numbers (A000069).
Hence A000069 equipped with T forms a group.

Examples

			Array T(n, k) begins:
  n\k|  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  ---+---------------------------------------------------------------
    0|  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
    1|  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    2|  0   2   1   3   8  10   9  11   4   6   5   7  12  14  13  15 -> A057300
    3|  0   3   3   0  12  15  15  12  12  15  15  12   0   3   3   0
    4|  0   4   8  12   1   5   9  13   2   6  10  14   3   7  11  15 -> A126006
    5|  0   5  10  15   5   0  15  10  10  15   0   5  15  10   5   0
    6|  0   6   9  15   9  15   0   6   6   0  15   9  15   9   6   0
    7|  0   7  11  12  13  10   6   1  14   9   5   2   3   4   8  15
    8|  0   8   4  12   2  10   6  14   1   9   5  13   3  11   7  15
    9|  0   9   6  15   6  15   0   9   9   0  15   6  15   6   9   0
   10|  0  10   5  15  10   0  15   5   5  15   0  10  15   5  10   0
   11|  0  11   7  12  14   5   9   2  13   6  10   1   3   8   4  15
   12|  0  12  12   0   3  15  15   3   3  15  15   3   0  12  12   0
   13|  0  13  14   3   7  10   9   4  11   6   5   8  12   1   2  15
   14|  0  14  13   3  11   5   6   8   7   9  10   4  12   2   1  15
   15|  0  15  15   0  15   0   0  15  15   0   0  15   0  15  15   0
                                                                     \
                                                                      v
                                                                    A010060
		

Crossrefs

Programs

  • PARI
    B(n) = { my (b=vector(hammingweight(n))); for (k=1, #b, n -= 2^(b[k] = valuation(n, 2))); b }
    T(n,k) = { my (nn=B(n), kk=B(k), v=0); for (i=1, #nn, for (j=1, #kk, v=bitxor(v, 2^bitxor(nn[i], kk[j])))); v }

Formula

T(n, k) = T(k, n) (T is commutative).
T(m, T(n, k)) = T(T(m, n), k) (T is associative).
T(n, 0) = 0 (0 is an absorbing element for T).
T(n, 1) = n (1 is the neutral element for T).
T(n, 2) = A057300(n).
T(n, 4) = A126006(n).
T(n, n) = A010060(n).
A010060(T(n, k)) = A010060(n) * A010060(k).

A263848 Irregular triangle read by rows: row n gives coefficients of basis polynomial {n,k} expressed in terms of binomial coefficients, high order terms first.

Original entry on oeis.org

1, 1, -1, 1, 0, -1, 1, -1, 1, 1, 0, 0, -1, 2, 0, -1, 1, 2, -1, 0, 1, 1, -1, 1, -1, 1, 0, 0, 0, -1, 3, 0, 0, -1, 1, 5, 0, -1, 0, 1, 3, 0, -1, 1, -1, 3, -1, 0, 0, 1, 5, -2, 0, 1, -1, 3, -2, 1, 0, -1, 1, -1, 1, -1, 1, 1, 0, 0, 0, 0, -1, 4, 0, 0, 0, -1, 1, 9, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Nov 15 2015

Keywords

Examples

			Triangle begins:
  1,
  1, -1,
  1,  0, -1,
  1, -1,  1,
  1,  0,  0, -1,
  2,  0, -1,  1,
  2, -1,  0,  1,
  1, -1,  1, -1,
  1,  0,  0,  0, -1,
  3,  0,  0, -1,  1,
  ...
		

Crossrefs

Extensions

More terms from Peter J. C. Moses, Dec 12 2015

A293390 Least m such that the exponents in expression for n as a sum of distinct powers of 2 are pairwise distinct mod m; a(0) = 0 by convention.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 3, 1, 2, 3, 4, 2, 4, 3, 4, 1, 3, 2, 5, 3, 3, 4, 5, 2, 5, 4, 5, 3, 5, 4, 5, 1, 2, 3, 3, 2, 4, 5, 6, 3, 4, 3, 6, 4, 4, 5, 6, 2, 3, 5, 6, 4, 6, 5, 6, 3, 6, 5, 6, 4, 6, 5, 6, 1, 4, 2, 4, 3, 5, 3, 7, 2, 4, 4, 4, 5, 5, 6, 7, 3, 5, 4, 7, 3, 5, 6
Offset: 0

Views

Author

Rémy Sigrist, Oct 08 2017

Keywords

Comments

The set of exponents in expression for n as a sum of distinct powers of 2 corresponds to the n-th row of A133457.
The sum of digits of n in base 2^a(n), say s, can be computed without carry in base 2; the Hamming weight of s equals the Hamming weight of n.
a(n) >= A000120(n) for any n > 0.
Apparently, a(n) = A000120(n) iff n = 0 or n belongs to A100290.
a(n) <= A070939(n) for any n >= 0.
For any sequence s of distinct nonnegative integers (s(n) being defined for n >= 0):
- let D_s be defined for any n > 0 by D_s(n) = a(Sum_{k=0..n-1} 2^s(k)),
- then D_s is the discriminator of s as introduced by Arnold, Benkoski, and McCabe in 1985,
- D_s(1) = 1,
- D_s(n) >= n for any n >= 1,
- D_s(n+1) >= D_s(n) for any n >= 1.

Examples

			For n=42:
- 42 = 2^5 + 2^3 + 2^1,
- 5 mod 1 = 3 mod 1,
- 5 mod 2 = 3 mod 2,
- 5 mod 3, 3 mod 3 and 1 mod 3 are all distinct,
- hence a(42) = 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,D,k;
      L:= convert(n,base,2);
      L:= select(t -> L[t+1]=1, [$0..nops(L)-1]);
      if nops(L) = 1 then return 1 fi;
      D:= {seq(seq(L[j]-L[i],i=1..j-1),j=2..nops(L))};
      D:= `union`(seq(numtheory:-divisors(i),i=D));
      min({$2..max(D)+1} minus D)
    end proc:
    0, seq(f(i),i=1..100); # Robert Israel, Oct 08 2017
  • Mathematica
    {0}~Join~Table[Function[r, SelectFirst[Range@ 10, Length@ Union@ Mod[r, #] == Length@ r &]][Join @@ Position[#, 1] - 1 &@ Reverse@ IntegerDigits[n, 2]], {n, 86}] (* Michael De Vlieger, Oct 08 2017 *)
  • PARI
    a(n) = if (n, my (d=Vecrev(binary(n)), x = []); for (i=1, #d, if (d[i], x = concat(x, i-1))); for (m=1, oo, if (#Set(vector(#x, i, x[i]%m))==#x, return (m))), return (0))

Formula

a(2*n) = a(n) for any n >= 0.
a(2^k-1) = k for any k >= 0.
a(n) = 1 iff n = 2^k for some k >= 0.
a(n) = 2 iff n belongs to A173195.
a(Sum_{k=1..n} 2^(k^2)) = A016726(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000069(k)) = A062383(n) for any n >= 1.
a(Sum_{k=0..n} 2^(2^k)) = A270097(n) for any n >= 0.
a(Sum_{k=1..n} 2^A000045(k+1)) = A270151(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000041(k)) = A270176(n) for any n >= 1.
a(A076793(n)) = A272633(n) for any n >= 0.
a(Sum_{k=1..n} 2^A001969(k)) = A272881(n) for any n >= 1.
a(Sum_{k=1..n} 2^A005823(k)) = A272882(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000215(k-1)) = A273037(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000108(k)) = A273041(n) for any n >= 1.
a(Sum_{k=1..n} 2^A001566(k)) = A273043(n) for any n >= 1.
a(Sum_{k=1..n} 2^A003095(k)) = A273044(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000058(k-1)) = A273056(n) for any n >= 1.
a(Sum_{k=1..n} 2^A002808(k)) = A273062(n) for any n >= 1.
a(Sum_{k=1..n} 2^(k!)) = A273064(n) for any n >= 1.
a(Sum_{k=1..n} 2^(k^k)) = A273068(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000110(k)) = A273237(n) for any n >= 1.
a(Sum_{k=1..n} 2^A001147(k)) = A273377(n) for any n >= 1.

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.

Original entry on oeis.org

0, 7, 13, 15, 22, 25, 27, 30, 39, 42, 45, 47, 49, 51, 54, 59, 60, 62, 75, 76, 82, 85, 87, 90, 93, 95, 97, 99, 102, 107, 108, 110, 117, 119, 120, 122, 125, 127, 141, 143, 147, 148, 153, 155, 158, 162, 165, 167, 170, 173, 175, 179, 180, 185, 187, 188, 190, 193
Offset: 1

Views

Author

Rémy Sigrist, Oct 12 2017

Keywords

Comments

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.
The set of exponents in expression for n as a sum of distinct powers of 2 corresponds to the n-th row of A133457.
No term can have a Hamming weight of 1 or 2.
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.
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).
The number 2^k-1 belongs to this sequence iff A063865(k) > 0.
If k has Hamming weight > 1, then k + 2^(A029931(k)-1) belongs to this sequence.

Examples

			2*42 = 2^6 + 2^4 + 2^2 and 6 = 4 + 2, hence 42 appears in the sequence.
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.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, is(t=0),
          (i-> b(n-2^i, t-i) or b(n-2^i, t+i))(ilog2(n)))
        end:
    a:= proc(n) option remember; local k; for k from 1+
         `if`(n=1, -1, a(n-1)) while not b(2*k, 0) do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 22 2017
  • 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)); }

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); }
Previous Showing 11-20 of 33 results. Next