OFFSET
0,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191
Eric Weisstein's World of Mathematics, Rule 126
S. Wolfram, A New Kind of Science
FORMULA
EXAMPLE
a(4) = (4 XOR 2*4) OR (4 XOR 4*4) = 12 OR 20 = 28. - Indranil Ghosh, Apr 02 2017
MATHEMATICA
Table[BitOr[BitXor[n, 2n], BitXor[n, 4n]], {n, 0, 100}] (* Indranil Ghosh, Apr 02 2017 *)
PROG
(PARI) for(n=0, 100, print1(bitor(bitxor(n, 2*n), bitxor(n, 4*n)), ", ")) \\ Indranil Ghosh, Apr 02 2017
(Python) print([(n^(2*n))|(n^(4*n)) for n in range(101)]) # Indranil Ghosh, Apr 02 2017
(C)
#include <stdio.h>
int main()
{
int n;
for(n=0; n<=100; n++){
printf("%d, ", (n^(2*n))|(n^(4*n)));
}
return 0;
} /* Indranil Ghosh, Apr 02 2017 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 22 2016
STATUS
approved