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.

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.