login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Permutation of natural numbers: a(1) = 1, a(A080147(n)) = 1+(2*a(n)), a(A080148(n)) = 2*a(n).
3

%I #7 Feb 03 2016 17:02:24

%S 1,2,3,4,6,5,7,8,12,9,10,13,11,14,16,15,24,17,18,20,25,26,22,19,21,27,

%T 28,32,23,29,30,48,33,34,31,36,49,40,50,35,52,37,44,41,51,38,42,54,56,

%U 53,45,64,39,46,43,58,55,60,57,65,96,47,66,68,59,61,62,97,72,67,69,98,80,63,100,70,73,99,81,101,104,71,74

%N Permutation of natural numbers: a(1) = 1, a(A080147(n)) = 1+(2*a(n)), a(A080148(n)) = 2*a(n).

%H Antti Karttunen, <a href="/A267105/b267105.txt">Table of n, a(n) for n = 1..10001</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F a(1) = 1; and for n > 1, if prime(n) mod 4 = 1, then a(n) = 1 + 2*a(A267097(n)), otherwise a(n) = 2*a(A267098(n)).

%o (Scheme, with memoization-macro definec)

%o (definec (A267105 n) (cond ((<= n 1) n) ((= 1 (modulo (A000040 n) 4)) (+ 1 (* 2 (A267105 (A267097 n))))) (else (* 2 (A267105 (A267098 n))))))

%Y Inverse: A267106.

%Y Cf. A000040, A002144, A002145, A080147, A080148, A267097, A267098.

%Y Cf. also A267107.

%K nonn

%O 1,2

%A _Antti Karttunen_, Feb 01 2016