OFFSET
0,2
COMMENTS
LINKS
Tilman Piesk, Table of n, a(n) for n = 0..1023
Tilman Piesk, Negated binary Walsh matrix of size 256
Tilman Piesk, The antidiagonals shown in a triangular matrix
Wikipedia, Walsh matrix
EXAMPLE
Top left corner of the negated binary Walsh matrix:
1 1 1 1 1 1 1 1
1 0 1 0 1 0 1 0
1 1 0 0 1 1 0 0
1 0 0 1 1 0 0 1
1 1 1 1 0 0 0 0
1 0 1 0 0 1 0 1
1 1 0 0 0 0 1 1
1 0 0 1 0 1 1 0
The antidiagonals in binary and decimal are:
1 = 1
11 = 3
101 = 5
1111 = 15
10001 = 17
110011 = 51
1011101 = 93
11111111 = 255
PROG
(PARI)
N=2^5; /* a power of 2 */
parity(x)= {
my(s=1);
while ( (x>>s), x=bitxor(x, x>>s); s+=s; );
return( bitand(x, 1) );
}
W = matrix(N, N, i, j, if(parity(bitand(i-1, j-1)), 0, 1); );
a(n) = sum(k=0, n, 2^k * W[n-k+1, k+1] );
vector(N, n, a(n-1))
/* Joerg Arndt, Mar 27 2013 */
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tilman Piesk, Oct 18 2011
STATUS
approved