cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A100833 Smallest positive palindrome-free and squarefree sequence.

Original entry on oeis.org

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
Offset: 1

Views

Author

John W. Layman, Jan 07 2005

Keywords

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.

Crossrefs

Cf. A007814.

Programs

  • 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

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)