OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
F:= proc(d) local m;
sort([seq(g(convert(m, base, 2)), m=2^d .. 2^(d+1)-1)])
end proc:
g:= proc(L1) local i, k0, k3, nL, Res, L, Lp, Lpp;
L:= map(`+`, L1[1..-2], 1);
nL:= nops(L);
Res:= NULL;
for k3 from 0 to nL do
Lp:= [op(L[1..k3]), 3, op(L[k3+1..nL])];
for k0 from 0 to nL do
Lpp:= [op(Lp[1..k0]), 0, op(Lp[k0+1..nL+1])];
Res:= Res, add(Lpp[i]*4^(i-1), i=1..nL+2);
od od;
end proc:
seq(op(F(d)), d=0..4); # Robert Israel, Jul 10 2019
PROG
(Python)
from sympy.ntheory import count_digits
def ok(n): c = count_digits(n, 4); return c[0] == c[3] == 1
print([k for k in range(311) if ok(k)]) # Michael S. Branicky, Dec 19 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved