OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..97
EXAMPLE
MAPLE
N:= 20: # for terms before the first term >= 2^(N+1)
W:= Vector(2^(N+1), datatype=integer[4]):
for d from 2 to N by 2 do
for t from 2^(d-1) to 2^d-1 do
if convert(convert(t, base, 2), `+`) = d/2 then
J:= [seq(i, i=t..2^(N+1), t)];
W[J]:= W[J] +~ 1;
fi od od:
M:= max(W);
V:= Array(0..M); count:= 0:
for i from 1 to 2^(N+1) do
if V[W[i]] = 0 then V[W[i]]:= i; count:= count+1 fi
od:
L:= convert(V, list):
if not member(0, L, 'm') then m:= M+2 fi:
L[1..m-1]; # Robert Israel, Sep 27 2023
MATHEMATICA
digBalQ[n_] := Module[{d = IntegerDigits[n, 2], m}, EvenQ @ (m = Length[d]) && Count[d, 1] == m/2]; f[n_] := DivisorSum[n, 1 &, digBalQ[#] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[40, 10^7] (* Amiram Eldar, Sep 26 2022 *)
PROG
(Magma) bal:=func<n|Multiplicity(Intseq(n, 2), 1) eq Multiplicity(Intseq(n, 2), 0)>; a:=[]; for n in [0..38] do k:=1; while #[d:d in Divisors(k)|bal(d)] ne n do k:=k+1; end while; Append(~a, k); end for; a;
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Marius A. Burtea, Sep 20 2022
EXTENSIONS
Corrected by Robert Israel, Sep 27 2023
STATUS
approved