OFFSET
1,2
COMMENTS
Depending on the binary length of n, the center of the XOR-triangle for n consists of a single cell or a 2 X 2 X 2 triangle pointing upwards or downwards.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, Triangle illustrating the initial terms (central 0's are rendered in yellow)
EXAMPLE
The XOR-triangles for a(8) = 30 and a(18) = 72 are as follows:
. 1 1 1 1 0 1 0 0 1 0 0 0
. ---------
. 0 \ 0 0 / 1 1 0 1 1 0 0
. \ / / \
. 0 \ 0 / 1 1 1 / 0 \ 1 0
. \ / -----
. 0 1 0 1 1 1
.
. 1 1 0 0
.
. 1 0
.
. 1
PROG
(PARI) is(n) = {
my (h=#binary(n)-1, l=0, m);
while (abs(h-l)>1, n=bitxor(m=n, n\2); h-=2; l++);
if (h>l, bittest(n, h)==0 && bittest(n, l)==0,
h<l, bittest(n, h)==0 && bittest(n, l)==0 && bittest(m, l)==0,
bittest(n, h)==0
)
}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 16 2020
STATUS
approved