%I #15 Mar 07 2016 12:31:35
%S 1,2,3,4,5,6,11,8,7,9,31,10,127,18,13,14,709,12,5381,15,23,45,52711,
%T 16,17,165,19,27,648391,21,9737333,22,61,856,41,20,174440041,6185,197,
%U 24,3657500101,34,88362852307,63,29,58644,2428095424619,25,59,26,977,212
%N a(1) = 1, a(2n) = A065090(1+a(n)), a(2n+1) = A000040(a(A064989(2n+1))).
%C Term a(47) manually copied from A007097(15). Note that A000040(15) = 47.
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(1) = 1, a(2) = 2, for n > 2, if n is even, a(n) = A002808(a(n/2)-1), and for odd n, a(n) = A000040(a(A064989(n))).
%F As a composition of other permutations:
%F a(n) = A237739(A243071(n)).
%F Other identities. For all n >= 1:
%F a(A000040(n)) = A007097(n). [Maps primes to the primeth recurrence.]
%o (PARI)
%o allocatemem(2^30);
%o default(primelimit,4294965247);
%o A002808(n) = { my(k=-1); while( -n + n += -k + k=primepi(n), ); n}; \\ This function from _M. F. Hasler_
%o A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
%o A269848 = n -> if(n<=2,n,if((n%2),prime(A269848(A064989(n))),A002808(A269848(n/2)-1)));
%o for(n=1, 52, t = A269848(n); print1(t,", "); write("b269848.txt", n, " ", t));
%o (Scheme, with memoization-macro definec)
%o (definec (A269848 n) (cond ((<= n 1) n) ((even? n) (A065090 (+ 1 (A269848 (/ n 2))))) (else (A000040 (A269848 (A064989 n))))))
%Y Inverse: A269847.
%Y Cf. A000040, A007097, A002808, A064989, A065090.
%Y Related or similar permutations: A237739, A243071, A246682, A269858.
%K nonn
%O 1,2
%A _Antti Karttunen_, Mar 06 2016