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

A374356 a(n) is the greatest fibbinary number f <= n such that n - f is also a fibbinary number whose binary expansion has no common 1's with that of f (where fibbinary numbers correspond to A003714).

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 4, 5, 8, 9, 10, 10, 8, 9, 10, 10, 16, 17, 18, 18, 20, 21, 20, 21, 16, 17, 18, 18, 20, 21, 20, 21, 32, 33, 34, 34, 36, 37, 36, 37, 40, 41, 42, 42, 40, 41, 42, 42, 32, 33, 34, 34, 36, 37, 36, 37, 40, 41, 42, 42, 40, 41, 42, 42, 64, 65, 66, 66
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

To compute a(n): replace every other bit with zero (starting with the second bit) in each run of consecutive 1's in the binary expansion of n.
From Gus Wiseman, Jul 11 2025: (Start)
This is the greatest binary rank of a sparse subset of the binary indices of n, where:
1. The binary indices of a nonnegative integer are the positions of 1 in its reversed binary expansion.
2. A set is sparse iff 1 is not a first difference.
3. The binary rank of a set {S_1,S_2,...} is Sum_i 2^(S_i-1).
(End)

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      10         10
   3     2      11         10
   4     4     100        100
   5     5     101        101
   6     4     110        100
   7     5     111        101
   8     8    1000       1000
   9     9    1001       1001
  10    10    1010       1010
  11    10    1011       1010
  12     8    1100       1000
  13     9    1101       1001
  14    10    1110       1010
  15    10    1111       1010
  16    16   10000      10000
		

Crossrefs

The union is A003714 (Fibbinary numbers).
For prime instead of binary indices we have A385216.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A166469 counts sparse submultisets of prime indices, maximal A385215.
A245564 counts sparse subsets of binary indices, maximal case A384883.
A319630 ranks sparse submultisets of prime indices, complement A104210.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    fbi[q_]:=If[q=={},0,Total[2^q]/2];
    Table[Max@@fbi/@Select[Subsets[bpe[n]],FreeQ[Differences[#],1]&],{n,0,100}] (* Gus Wiseman, Jul 11 2025 *)
  • PARI
    a(n) = { my (v = 0, e, x, y, b); while (n, x = y = 0; e = valuation(n, 2); for (k = 0, oo, if (bittest(n, e+k), n -= b = 2^(e+k); [x, y] = [y + b, x], v += x; break;););); return (v); }

Formula

a(n) = A374354(n, A277561(n)-1).
a(n) = n - A374355(n).
a(n) <= n with equality iff n is a fibbinary number.

A374354 Irregular table T(n, k), n >= 0, 0 <= k < A277561(n), read by rows; the n-th row lists the fibbinary numbers f <= n such that n - f is also a fibbinary number whose binary expansion has no common 1's with that of f (where fibbinary numbers correspond to A003714).

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 2, 0, 4, 0, 1, 4, 5, 2, 4, 2, 5, 0, 8, 0, 1, 8, 9, 0, 2, 8, 10, 1, 2, 9, 10, 4, 8, 4, 5, 8, 9, 4, 10, 5, 10, 0, 16, 0, 1, 16, 17, 0, 2, 16, 18, 1, 2, 17, 18, 0, 4, 16, 20, 0, 1, 4, 5, 16, 17, 20, 21, 2, 4, 18, 20, 2, 5, 18, 21, 8, 16, 8, 9, 16, 17
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

In other words, we partition n into pairs of fibbinary numbers whose binary expansions have no common 1's and list the corresponding fibbinary numbers to get the n-th row.

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  -----------
   0  0
   1  0, 1
   2  0, 2
   3  1, 2
   4  0, 4
   5  0, 1, 4, 5
   6  2, 4
   7  2, 5
   8  0, 8
   9  0, 1, 8, 9
  10  0, 2, 8, 10
  11  1, 2, 9, 10
  12  4, 8
  13  4, 5, 8, 9
  14  4, 10
  15  5, 10
  16  0, 16
		

Crossrefs

See A295989 and A374361 for similar sequences.

Programs

  • PARI
    row(n) = { my (r = [0], e, x, y, b); while (n, x = y = 0; e = valuation(n, 2); for (k = 0, oo, if (bittest(n, e+k), n -= b = 2^(e+k); [x, y] = [y + b, x], r = concat([v + y | v <- r], [v + x | v <- r]); break;););); return (r); }

Formula

T(n, 0) = 0 iff n is a fibbinary number.
T(n, k) + T(n, A277561(n)-1-k) = n.
T(n, 0) = A374355(n).
T(n, A277561(n)-1) = A374356(n).
Sum_{k = 0..A277561(n)-1} T(n, k) = n * 2^A037800(n).

A374395 a(n) is the first term in the n-th row of A374394.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 2, 0, 1, 3, 3, 4, 0, 2, 2, 5, 6, 5, 7, 7, 0, 1, 3, 3, 4, 8, 10, 10, 8, 9, 11, 11, 12, 0, 2, 2, 5, 6, 5, 7, 7, 13, 14, 16, 16, 17, 13, 15, 15, 18, 19, 18, 20, 20, 0, 1, 3, 3, 4, 8, 10, 10, 8, 9, 11, 11, 12, 21, 23, 23, 26, 27, 26, 28, 28, 21
Offset: 0

Views

Author

Rémy Sigrist, Jul 10 2024

Keywords

Comments

a(n) is the least number z >= 0 such that the Zeckendorf representations of z and n-z have no common Fibonacci numbers and when combined together correspond to the lazy Fibonacci representation of n.

Crossrefs

Programs

  • PARI
    \\ See Links section.

Formula

a(n) = A022290(A374355(1+A003754(n)), k).
a(n) = n - A374396(n).

A377415 a(n) = n - A377414(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 2, 2, 0, 1, 0, 1, 4, 5, 4, 5, 0, 0, 2, 2, 0, 0, 2, 2, 8, 8, 10, 10, 8, 8, 10, 10, 0, 1, 0, 1, 4, 5, 4, 5, 0, 1, 0, 1, 4, 5, 4, 5, 16, 17, 16, 17, 20, 21, 20, 21, 16, 17, 16, 17, 20, 21, 20, 21, 0, 0, 2, 2, 0, 0, 2, 2, 8, 8, 10, 10, 8, 8, 10
Offset: 0

Views

Author

Rémy Sigrist, Oct 27 2024

Keywords

Comments

For any n > 0 with binary expansion (b_1 = 1, b_2, ..., b_k), the binary expansion of a(n) is (c_1, ..., c_k) where c_i = b_i when i is even, c_i = 0 when i is odd.

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     0       1          0
   2     0      10          0
   3     1      11          1
   4     0     100          0
   5     0     101          0
   6     2     110         10
   7     2     111         10
   8     0    1000          0
   9     1    1001          1
  10     0    1010          0
  11     1    1011          1
  12     4    1100        100
  13     5    1101        101
  14     4    1110        100
  15     5    1111        101
		

Crossrefs

See A063694, A063695 and A374355 for similar sequences.

Programs

  • PARI
    a(n) = { my (v = 0, x = exponent(n), y); while (n, n -= 2^y = exponent(n); if (x%2 != y%2, v += 2^y;);); return (v); }

Formula

a(n) = 0 iff n belongs to A126684.
a(a(n)) = 0.
a(2*n) = 2*a(n).
Showing 1-4 of 4 results.