A106409 n XOR (greatest proper divisor of n).
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
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..16383
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
Comments