cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A048725 a(n) = Xmult(n,5) or rule90(n,1).

Original entry on oeis.org

0, 5, 10, 15, 20, 17, 30, 27, 40, 45, 34, 39, 60, 57, 54, 51, 80, 85, 90, 95, 68, 65, 78, 75, 120, 125, 114, 119, 108, 105, 102, 99, 160, 165, 170, 175, 180, 177, 190, 187, 136, 141, 130, 135, 156, 153, 150, 147, 240, 245, 250, 255, 228, 225, 238, 235, 216, 221, 210
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

The orbit of 1 under iteration of this function is the Sierpinski gasket A038183. It is called "rule 90" because the 8 bits of 90 = 01011010 in binary give bit k of the result as function of the value in {0,...,7} made out of bits k,k+1,k+2 of the input (i.e., floor(input / 2^k) mod 8). - M. F. Hasler, Oct 09 2017

Examples

			   n (in binary) | 4n [binary] | n XOR 4n [binary] | [decimal] = a(n)
          0      |        0    |           0       |        0
          1      |      100    |         101       |        5
         10      |     1000    |        1010       |       10
         11      |     1100    |        1111       |       15
        100      |    10000    |       10100       |       20
        101      |    10100    |       10001       |       17
   etc.
		

Crossrefs

Cf. A038183.
Cf. A353167 (terms sorted).

Programs

Formula

a(n) = n XOR n*2 XOR (n XOR n*2)*2 = A048724(A048724(n)). - Reinhard Zumkeller, Nov 12 2004
a(n) = n XOR (4n). - M. F. Hasler, Oct 09 2017

A355487 Bitwise XOR of the base-4 digits of n.

Original entry on oeis.org

0, 1, 2, 3, 1, 0, 3, 2, 2, 3, 0, 1, 3, 2, 1, 0, 1, 0, 3, 2, 0, 1, 2, 3, 3, 2, 1, 0, 2, 3, 0, 1, 2, 3, 0, 1, 3, 2, 1, 0, 0, 1, 2, 3, 1, 0, 3, 2, 3, 2, 1, 0, 2, 3, 0, 1, 1, 0, 3, 2, 0, 1, 2, 3, 1, 0, 3, 2, 0, 1, 2, 3, 3, 2, 1, 0, 2, 3, 0, 1, 0, 1, 2, 3, 1, 0, 3
Offset: 0

Views

Author

Kevin Ryde, Jul 04 2022

Keywords

Comments

Equivalently, the parity of the odd position 1-bits of n and the parity of the even position 1-bits of n, combined as a(n) = 2*A269723(n) + A341389(n).
In GF(2)[x] polynomials encoded as bits of an integer (least significant bit for the constant term), a(n) is remainder n mod x^2 + 1.

Examples

			n=35 has base-4 digits 203 so a(35) = 2 XOR 0 XOR 3 = 1.
		

Crossrefs

Cf. A030373 (base 4 digits), A003987 (XOR).
Cf. A353167 (indices of 0's).
Other digit operations: A053737 (sum), A309954 (product).

Programs

  • Mathematica
    a[n_] := BitXor @@ IntegerDigits[n, 4]; Array[a, 100, 0] (* Amiram Eldar, Jul 05 2022 *)
  • PARI
    a(n) = if(n==0,0, fold(bitxor,digits(n,4)));
    
  • Python
    from operator import xor
    from functools import reduce
    from sympy.ntheory import digits
    def a(n): return reduce(xor, digits(n, 4)[1:])
    print([a(n) for n in range(87)]) # Michael S. Branicky, Jul 05 2022

Formula

Fixed point of the morphism 0 -> 0,1; 1 -> 2,3; 2 -> 1,0; 3 -> 3,2 starting from 0.
Showing 1-2 of 2 results.