OFFSET
1,2
COMMENTS
a(1)=1 and, for n>1, a(n) is the smallest positive integer such that no subsequence of two or more consecutive terms is a palindrome and no subsequence of 2k consecutive terms, k>=1, consists of two copies of the same subsequence.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
Conjectures from Robert Israel, Jan 17 2019: (Start)
a(n) = 1 if n == 1 (mod 3).
a(n) = 2 if n == 2 (mod 3).
Otherwise a(n) = 3 + A007814(n/3). (End)
MAPLE
B[1]:= 1: B[2]:= 2:
for n from 3 to 200 do
for c from 1 do
if B[n-1]=c or B[n-2]=c then next fi;
Cs:= ListTools:-Reverse(select(t -> B[t]=c, [$ceil(n/2)..n-3]));
good:= true;
for k in Cs do
if andmap(t -> (B[k-t]=B[n-t]), [$1..n-k-1]) then good:= false; break fi
od;
if good then B[n]:= c; break fi;
od;
od:
seq(B[i], i=1..200); # Robert Israel, Jan 17 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Jan 07 2005
STATUS
approved