cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A246368 #10 Aug 27 2014 14:54:09
%S A246368 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 A246368 71,16,67,6186,37,58645,31,18,199,22,83,705348,983,32,179,10428487,47,
%U A246368 184718194,109,21,6659,3840230006,277,27,43,65,353
%N A246368 Permutation of natural numbers: a(n) = A227413(A005941(n)).
%H A246368 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A246368 a(n) = A227413(A005941(n)) = A227413(1+A156552(n)).
%F A246368 Other identities:
%F A246368 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 A246368 (Scheme) (define (A246368 n) (A227413 (A005941 n)))
%o A246368 (PARI)
%o A246368 default(primelimit,(2^31)+(2^30));
%o A246368 A002808(n) = { my(k=-1); while( -n + n += -k + k=primepi(n), ); n }; \\ This function from _M. F. Hasler_
%o A246368 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 A246368 A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
%o A246368 A005941(n) = A156552(n)+1;
%o A246368 A227413(n) = if(1==n, 1, if(!(n%2), prime(A227413(n/2)), A002808(A227413((n-1)/2))));
%o A246368 A246368(n) = A227413(A005941(n));
%o A246368 for(n=1, 52, write("b246368.txt", n, " ", A246368(n)));
%Y A246368 Inverse: A246367.
%Y A246368 Similar or related permutations: A005941, A156552, A227413, A246364, A246366.
%Y A246368 Cf. A000035, A010051.
%K A246368 nonn
%O A246368 1,2
%A A246368 _Antti Karttunen_, Aug 26 2014