|
|
A100833
|
|
Smallest positive palindrome-free and squarefree sequence.
|
|
2
|
|
|
1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 5, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 6, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 5, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 7, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 5, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 6, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 5, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 8, 1, 2, 3, 1, 2, 4, 1, 2, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
FORMULA
|
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:
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|