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
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
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.
A245564 counts sparse subsets of binary indices, maximal case
A384883.
A319630 ranks sparse submultisets of prime indices, complement
A104210.
Cf.
A000045,
A000071,
A001629,
A006519,
A010049,
A044813,
A119900,
A202023,
A202064,
A268193,
A384890.
-
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 *)
-
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); }
A385215
Number of maximal sparse submultisets of the prime indices of n, where a multiset is sparse iff 1 is not a first difference.
Original entry on oeis.org
1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1
Offset: 1
The sparse submultisets of the prime indices of n = 8 are {{},{1},{1,1},{1,1,1}}, with maximization {{1,1,1}}. So a(8) = 1.
The sparse submultisets of the prime indices of n = 462 are {{},{1},{2},{4},{5},{1,4},{2,4},{1,5},{2,5}}, with maximization {{1,4},{1,5},{2,4},{2,5}}, so a(462) = 4.
The prime indices of n together their a(n) maximal sparse submultisets for n = 1, 6, 210, 462, 30030, 46410:
{} {1,2} {1,2,3,4} {1,2,4,5} {1,2,3,4,5,6} {1,2,3,4,6,7}
------------------------------------------------------------
{} {1} {1,3} {1,4} {2,5} {1,3,6}
{2} {1,4} {1,5} {1,3,5} {1,3,7}
{2,4} {2,4} {1,3,6} {1,4,6}
{2,5} {1,4,6} {1,4,7}
{2,4,6} {2,4,6}
{2,4,7}
This is the maximal case of
A166469.
For binary instead of prime indices we have
A384883, maximal case of
A245564.
The greatest number whose prime indices are one of these submultisets is
A385216.
A034839 counts subsets by number of maximal runs, for strict partitions
A116674.
A384887 counts partitions with equal lengths of gapless runs, distinct
A384884.
-
prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
maxq[els_]:=Select[els,Not[Or@@Table[Divisible[oth,#],{oth,DeleteCases[els,#]}]]&];
Table[Length[maxq[Select[Divisors[n],FreeQ[Differences[prix[#]],1]&]]],{n,30}]
Showing 1-2 of 2 results.
Comments