login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A120710 A GF(2) polynomial analog of triangular numbers. 1
0, 0, 0, 2, 0, 4, 8, 14, 0, 8, 16, 26, 32, 44, 56, 54, 0, 16, 32, 50, 64, 84, 104, 126, 128, 152, 176, 170, 224, 252, 216, 198, 0, 32, 64, 98, 128, 164, 200, 238, 256, 296, 336, 378, 416, 396, 504, 470, 512, 560, 608, 594, 704, 756, 680, 670, 896, 952, 1008 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

The k-th bit in a(n) is one just if there are an odd number of pairs of distinct one bits i#j in n such that i+j=k. GF(2) polynomial ("XOR numbral") multiplication can be implemented as A048720(i,j) = A000695(i AND j) XOR a(i AND j) XOR a(i IOR j) XOR a(i AND NOT j) XOR a(NOT i AND j), analogously to ordinary multiplication (A003991) ij = tri(i+j)-tri(i)-tri(j) via triangular numbers (A000217).

REFERENCES

Posting by Richard C. Schroeppel to math-fun mailing list, Jun 26 2006.

LINKS

Rémy Sigrist, Table of n, a(n) for n = 0..8192

FORMULA

a(0)=0; a(n + 2^k) = a(n) XOR (n * 2^k), 0<=n<2^k.

EXAMPLE

a(15)=54 because 15=2^0+2^1+2^2+2^3, the four one-bits giving six distinct pairs 01 02 03 12 13 23, which sum to 1 2 3 3 4 5, of which 1 2 4 and 5 occur oddly, yielding 2^1+2^2+2^4+2^5=54.

PROG

(PARI) a(n) = { if (n==0, return (0), my (k=#binary(n)-1, m=n-2^k); return (bitxor(m*2^k, a(m)))) } \\ Rémy Sigrist, Feb 08 2020

CROSSREFS

Cf. A048720, A000695, A003991, A000217.

Sequence in context: A354042 A325416 A120554 * A115780 A101189 A295321

Adjacent sequences:  A120707 A120708 A120709 * A120711 A120712 A120713

KEYWORD

base,easy,nonn

AUTHOR

Marc LeBrun, Jun 28 2006

EXTENSIONS

Data corrected by Rémy Sigrist, Feb 08 2020

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 17 19:51 EDT 2022. Contains 353778 sequences. (Running on oeis4.)