OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers, similar to A225901.
There are exactly two fixed points: a(0) = 0 and a(1) = 1.
LINKS
EXAMPLE
For n = 42:
- the primorial base expansion of 42 is: (1, 2, 0, 0),
- the corresponding radixes are: (7, 5, 3, 2),
- so the primorial base expansion of a(42) is: (7-1, 5-2, 0, 0) = (6, 3, 0, 0),
- and a(42) = 198.
PROG
(PARI) a(n, s=i->prime(i)) = { my (v=0, f=1, r); for (i=1, oo, if (n==0, return (v), r=s(i); v+=f*((-n)%r); f*=r; n\=r)) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 02 2022
STATUS
approved