|
|
A348080
|
|
A variant of Van Eck's sequence: For n >= 1, if there exists an m < n such that a(m) = a(n), take the largest such m and set a(n+1) = n XOR m; otherwise a(n+1) = 0. Start with a(1)=0.
|
|
2
|
|
|
0, 0, 3, 0, 6, 0, 2, 0, 14, 0, 2, 12, 0, 7, 0, 2, 27, 0, 29, 0, 6, 16, 0, 3, 27, 8, 0, 12, 16, 11, 0, 4, 0, 62, 0, 2, 52, 0, 5, 0, 14, 32, 0, 3, 52, 8, 52, 2, 20, 0, 25, 0, 6, 32, 28, 0, 12, 37, 0, 3, 16, 32, 8, 17, 0, 122, 0, 2, 116, 0, 5, 96, 0, 15, 0, 2, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
XOR denotes the bitwise XOR operator.
This sequence is unbounded, and contains infinitely many 0's.
|
|
LINKS
|
|
|
EXAMPLE
|
The first terms, alongside m, are:
n a(n) m
-- ---- ---
1 0 N/A
2 0 1
3 1 N/A
4 0 2
5 2 N/A
6 0 4
7 2 5
8 2 7
9 1 3
10 6 N/A
|
|
PROG
|
(PARI) { p=vector(123); v=0; for (n=1, 77, print1(v", "); [p[1+v], v]=[n, if (p[1+v], bitxor(n, p[1+v]), 0)]) }
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|