1,1

a(a(n))=n: a self-inverse permutation of natural numbers.

Paul Tek, Table of n, a(n) for n = 1..10000

Index entries for sequences that are permutations of the natural numbers

Index entries for sequences related to binary expansion of n

(Haskell)

import Data.List (delete)

a094510 n = a094510_list !! (n-1)

a094510_list = f 1 [1..] where

f x zs = g zs where

g (y:ys) = if y /= x && a000120 y == wt

then y : f (x + 1) (delete y zs) else g ys

wt = a000120 x

-- Reinhard Zumkeller, Nov 23 2014

Cf. A094511, A007088, A000120.

Sequence in context: A059274 A082635 A166623 * A023677 A108599 A108590

Adjacent sequences: A094507 A094508 A094509 * A094511 A094512 A094513

nonn

Reinhard Zumkeller, May 06 2004

approved