OFFSET
0,3
COMMENTS
REFERENCES
Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 23.
FORMULA
EXAMPLE
The first terms, alongside the binary expansion of n split into chunks of length a(n), are:
n a(n) bin(n)
-- ---- ------
0 1 0
1 1 1
2 2 10
3 1 1|1
4 3 100
5 2 10|1
6 3 110
7 1 1|1|1
8 4 1000
9 3 100|1
10 2 10|10
11 3 101|1
12 4 1100
13 3 110|1
14 4 1110
15 1 1|1|1|1
PROG
(PARI) a(n) = { my (b = if (n, binary(n), [0])); for (p = 1, oo, if (b[1..#b-p] == b[1+p..#b], return (p); ); ); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 31 2023
STATUS
approved