login
A267105
Permutation of natural numbers: a(1) = 1, a(A080147(n)) = 1+(2*a(n)), a(A080148(n)) = 2*a(n).
3
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, 28, 32, 23, 29, 30, 48, 33, 34, 31, 36, 49, 40, 50, 35, 52, 37, 44, 41, 51, 38, 42, 54, 56, 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
OFFSET
1,2
FORMULA
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)).
PROG
(Scheme, with memoization-macro definec)
(definec (A267105 n) (cond ((<= n 1) n) ((= 1 (modulo (A000040 n) 4)) (+ 1 (* 2 (A267105 (A267097 n))))) (else (* 2 (A267105 (A267098 n))))))
CROSSREFS
Inverse: A267106.
Cf. also A267107.
Sequence in context: A361482 A257683 A343152 * A080542 A330090 A072758
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 01 2016
STATUS
approved