login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A246368 Permutation of natural numbers: a(n) = A227413(A005941(n)). 7

%I #10 Aug 27 2014 14:54:09

%S 1,2,4,3,6,7,8,5,9,13,10,17,20,19,12,11,46,23,166,41,15,29,858,59,14,

%T 71,16,67,6186,37,58645,31,18,199,22,83,705348,983,32,179,10428487,47,

%U 184718194,109,21,6659,3840230006,277,27,43,65,353

%N Permutation of natural numbers: a(n) = A227413(A005941(n)).

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

%F a(n) = A227413(A005941(n)) = A227413(1+A156552(n)).

%F Other identities:

%F For all n >= 1, A010051(a(n)) = 1 - A000035(n). [This permutation maps even numbers to primes and odd numbers to nonprimes, in some order, because the permutation A227413 has the same property and A005941 preserves the parity].

%o (Scheme) (define (A246368 n) (A227413 (A005941 n)))

%o (PARI)

%o default(primelimit,(2^31)+(2^30));

%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 A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));

%o A005941(n) = A156552(n)+1;

%o A227413(n) = if(1==n, 1, if(!(n%2), prime(A227413(n/2)), A002808(A227413((n-1)/2))));

%o A246368(n) = A227413(A005941(n));

%o for(n=1, 52, write("b246368.txt", n, " ", A246368(n)));

%Y Inverse: A246367.

%Y Similar or related permutations: A005941, A156552, A227413, A246364, A246366.

%Y Cf. A000035, A010051.

%K nonn

%O 1,2

%A _Antti Karttunen_, Aug 26 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 10:40 EDT 2024. Contains 371779 sequences. (Running on oeis4.)