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.

A293212 Binary XOR of prime divisors of n.

Original entry on oeis.org

2, 3, 2, 5, 1, 7, 2, 3, 7, 11, 1, 13, 5, 6, 2, 17, 1, 19, 7, 4, 9, 23, 1, 5, 15, 3, 5, 29, 4, 31, 2, 8, 19, 2, 1, 37, 17, 14, 7, 41, 6, 43, 9, 6, 21, 47, 1, 7, 7, 18, 15, 53, 1, 14, 5, 16, 31, 59, 4, 61, 29, 4, 2, 8, 10, 67, 19, 20, 0, 71, 1, 73, 39, 6, 17
Offset: 2

Views

Author

Alex Ratushnyak, Feb 04 2018

Keywords

Comments

The sequence of indices of zeros begins: 70, 140, 280, 350, 490, 560, 646, 700, 980, 1120, 1292, 1400, 1750, 1798, 1960, 2145.

Examples

			a(6) = a(24) = 2 XOR 3 = 1.
a(2145) = 3 XOR 5 XOR 11 XOR 13 = 0.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local d, r; r:=0; for d in numtheory
          [factorset](n) do r:= Bits[Xor](r, d) od; r
        end:
    seq(a(n), n=2..100);  # Alois P. Heinz, Mar 09 2018
  • PARI
    a(n) = my(vp = factor(n)[,1]~, k=0); for (i=1, #vp, k = bitxor(k, vp[i])); k; \\ Michel Marcus, Feb 05 2018
    
  • Python
    from functools import reduce
    from operator import xor
    from sympy import primefactors
    def A293212(n): return reduce(xor,primefactors(n)) # Chai Wah Wu, Jun 03 2025

Formula

a(n) = n iff n is a prime.