OFFSET
0,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..65537
MATHEMATICA
f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; g[n_] := If[n == 1, 1, Times @@ MapIndexed[ Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]]];
Table[g@ f[BitXor[n, Floor[n/2]], 1, 1], {n, 0, 93}] (* _Michael De Vlieger_, May 09 2017 *)
PROG
(Python)
from sympy import prime, factorint
import math
def A(n): return n - 2**int(math.floor(math.log(n, 2)))
def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
def a005940(n): return b(n - 1)
def P(n):
f = factorint(n)
return sorted([f[i] for i in f])
def a046523(n):
x=1
while True:
if P(n) == P(x): return x
else: x+=1
def a003188(n): return n^int(n/2)
def a243353(n): return a005940(1 + a003188(n))
def a(n): return a046523(a243353(n)) # _Indranil Ghosh_, May 07 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
_Antti Karttunen_, Nov 16 2016
STATUS
approved