0,3

This sequence is a self-inverse permutation of the nonnegative integers.

Rémy Sigrist, Table of n, a(n) for n = 0..6560

Index entries for sequences that are permutations of the natural numbers

a(7) = A338241(13) = 7.

(PARI) b(n) = { if (n==0, return (0), my (d=n%3, m=n\3); if (d==0, 3*b(m), d==1, 1-3*b(m), 3*b(m)-1)) }

a(n) = if (n==0, 0, b(2*n-1))

Cf. A338241, A338242.

Sequence in context: A265356 A083164 A094962 * A338246 A084793 A033820

Adjacent sequences: A338240 A338241 A338242 * A338244 A338245 A338246

nonn

Rémy Sigrist, Oct 18 2020

approved