OFFSET
1,2
EXAMPLE
Let a'(n) be the reverse of a(n). E.g., if a(n) = 10100, then a'(n) = 00101. Let hamm(b,c) denote the Hamming distance between b and c. Let concat designate concatenation of arguments.
a(1):=1.
a(2) is the concatenation of a(1) and hamm(a(1),a'(1)). a'(1) = 1. So hamm(a(1),a'(1)) = hamm('1','1') = 0. So a(2) = concat('1','0') = 10.
a(3) is the concatenation of a(2) and hamm(a(2),a'(2)). hamm(a(2),a'(2)) = hamm('10','01') = 2 or 10 in base 2. So a(3) = concat('10','10') = 1010.
a(4) is the concatenation of a(3) and hamm(a(3),a'(3)). hamm(a(3),a'(3)) = hamm('1010','0101') = 4 or 100 in base 2. So a(3) = concat('1010','100') = 10100.
MAPLE
A274069aux := proc(n)
option remember;
if n = 1 then
[1];
else
d := procname(n-1) ;
dreve := ListTools[Reverse](d) ;
ham := 0 ;
for i from 1 to nops(d) do
if op(i, d) <> op(i, dreve) then
ham := ham+1 ;
end if;
end do:
if ham = 0 then
[op(d), 0] ;
else
ListTools[Reverse](convert(ham, base, 2)) ;
[op(d), op(%) ] ;
end if ;
end if;
end proc:
A274069 := proc(n)
digcatL(A274069aux(n)) ;
end proc:
seq(A274069(n), n=1..30) ; # R. J. Mathar, May 08 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Meir-Simchah Panzer, Jun 09 2016
EXTENSIONS
Edited by Meir-Simchah Panzer, Jun 12 2018
More terms from R. J. Mathar, May 08 2019.
STATUS
approved