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.

A106409 n XOR (greatest proper divisor of n).

Original entry on oeis.org

0, 3, 2, 6, 4, 5, 6, 12, 10, 15, 10, 10, 12, 9, 10, 24, 16, 27, 18, 30, 18, 29, 22, 20, 28, 23, 18, 18, 28, 17, 30, 48, 42, 51, 36, 54, 36, 53, 42, 60, 40, 63, 42, 58, 34, 57, 46, 40, 54, 43, 34, 46, 52, 45, 60, 36, 42, 39, 58, 34, 60, 33, 42, 96, 76, 99, 66, 102, 82, 101, 70
Offset: 1

Views

Author

Reinhard Zumkeller, May 02 2005

Keywords

Comments

a(n) = n XOR A032742(n);
a(A000040(n)) = A000040(n) - 1 for n>1;
a(2*n) = A048724(n);
a(A022340(n)) = A022340(n) + A032742(A022340(n)).

Programs

  • Maple
    a:= n-> Bits[Xor](n, max(1, (numtheory[divisors](n) minus {n})[])):
    seq(a(n), n=1..100);  # Alois P. Heinz, May 15 2016
  • Mathematica
    a[1] = 0; a[n_] := BitXor[n, Divisors[n][[-2]]]; Array[a, 100] (* Jean-François Alcover, Mar 12 2019 *)
  • PARI
    gpd(n) = if(n==1, 1, n/factor(n)[1, 1]); \\ A032742
    a(n) = bitxor(n, gpd(n)); \\ Michel Marcus, Mar 12 2019