|
|
A099810
|
|
a(n) = a(n-1) XOR (a(n-1) + a(n-2)), with a(1)=1, a(2)=3, where XOR is the binary exclusive OR operation.
|
|
1
|
|
|
1, 3, 7, 13, 25, 63, 103, 193, 489, 835, 1647, 4061, 6545, 12543, 31343, 53505, 105073, 258307, 424567, 790797, 2005641, 3420447, 6748855, 16634209, 26811769, 51377059, 128377535, 219165917, 430383937, 1058044767, 1739056639
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
a(3) = 7 since 3 XOR (3+1) = 3 XOR 4 = 7.
a(4) = 13 since 7 XOR (7+3) = 7 XOR 10 = 13.
a(5) = 25 since 13 XOR (13+7) = 13 XOR 20 = 25.
The binary expansions of a(n) form a triangle (listed with ones place in leftmost column):
1,
1,1,
1,1,1,
1,0,1,1,
1,0,0,1,1,
1,1,1,1,1,1,
1,1,1,0,0,1,1,
1,0,0,0,0,0,1,1,
1,0,0,1,0,1,1,1,1,
1,1,0,0,0,0,1,0,1,1,
1,1,1,1,0,1,1,0,0,1,1,
1,0,1,1,1,0,1,1,1,1,1,1,...
|
|
PROG
|
(PARI) a(n)=if(n==1, 1, if(n==2, 3, bitxor(a(n-1), a(n-1)+a(n-2))))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|