OFFSET
1,2
COMMENTS
This sequence is a self-inverse permutation of the natural numbers.
This sequence has strong connections with A334727.
LINKS
FORMULA
EXAMPLE
For n = 198:
- 198 = 11^1 * 7^0 * 5^0 * 3^2 * 2^1,
- the corresponding XOR-triangle is:
1 0 0 2 1
1 0 2 3
1 2 1
3 3
0
- so a(n) = 11^1 * 7^1 * 5^1 * 3^3 * 2^0 = 10395.
PROG
(PARI) a(n) = {
my (f=factor(n),
m=if (#f~==0, 0, primepi(f[#f~, 1])),
x=vector(m, k, valuation(n, prime(m+1-k))),
v=1);
forstep (i=m, 1, -1,
v*=prime(i)^x[1];
x=vector(#x-1, k, bitxor(x[k], x[k+1]));
);
v
}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 21 2020
STATUS
approved