OFFSET
1,2
COMMENTS
Has become periodic with period {1010101101,1010100110}.
MAPLE
# Apply map to base-10 number
F:=proc(n) local t1, t2, t2b, n1, n1b, n0, n0b, t3, t4;
t1:=convert(n, base, 2);
t2:=nops(t1);
t2b:=convert(t2, base, 2);
n1:=add(t1[i], i=1..t2);
n1b:=convert(n1, base, 2);
n0:=t2-n1;
n0b:=convert(n0, base, 2);
t3:=[
seq(t2b[nops(t2b)+1-i], i=1..nops(t2b)),
seq(n0b[nops(n0b)+1-i], i=1..nops(n0b)),
seq(n1b[nops(n1b)+1-i], i=1..nops(n1b))
];
t4:="";
for i from 1 to nops(t3) do t4:=cat(t4, t3[i]); od:
parse(t4);
end;
# Apply map to binary number
G:=proc(n) local t2, t2b, n1, n1b, n0, n0b, t3, t4; global digsum;
t2:=length(n);
t2b:=convert(t2, base, 2);
n1:=digsum(n);
n1b:=convert(n1, base, 2);
n0:=t2-n1;
n0b:=convert(n0, base, 2);
t3:=[
seq(t2b[nops(t2b)+1-i], i=1..nops(t2b)),
seq(n0b[nops(n0b)+1-i], i=1..nops(n0b)),
seq(n1b[nops(n1b)+1-i], i=1..nops(n1b))
];
t4:="";
for i from 1 to nops(t3) do t4:=cat(t4, t3[i]); od:
parse(t4);
end;
# Then do 1, F(1), G(F(1)), G(%), G(%), ... .
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Oct 16 2010
STATUS
approved