OFFSET
1,2
EXAMPLE
a(3) = 7 since 3 XOR (3+1) = 3 XOR 4 = 7.
a(4) = 12 since 7 XOR (7+3+1) = 7 XOR 11 = 12.
a(5) = 27 since 12 XOR (12+7+3+1) = 12 XOR 23 = 27.
The binary expansions of a(n) form a triangle (listed with ones place in leftmost column):
1,
1,1,
1,1,1,
0,0,1,1,
1,1,0,1,1,
1,0,0,1,0,1,
0,1,0,0,1,1,1,
1,1,1,1,1,1,0,1,
1,1,0,0,1,1,0,0,1,
0,0,1,1,0,0,0,1,1,1,
1,1,1,0,0,0,1,1,1,0,1,
1,0,1,0,1,0,1,1,1,0,0,1,...
PROG
(PARI) a(n)=if(n==1, 1, if(n==2, 3, bitxor(a(n-1), sum(k=1, n-1, a(k)))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Oct 26 2004
STATUS
approved