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.
%I A245822 #17 Nov 10 2024 05:46:03 %S A245822 1,2,3,4,5,8,7,9,6,16,11,10,19,33,12,25,17,15,23,34,39,70,13,24,26,50, %T A245822 21,52,53,18,31,55,77,93,54,22,29,27,66,105,67,48,137,156,30,28,37,64, %U A245822 91,35,85,58,97,49,40,98,36,135,59,45,47,261,56,76,92,122,83,374,38,102,139,69,167,130,88,203,351,212,349,235,14 %N A245822 Permutation of natural numbers: a(n) = A245704(A091204(n)). %H A245822 Antti Karttunen, <a href="/A245822/b245822.txt">Table of n, a(n) for n = 1..10001</a> %H A245822 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A245822 a(n) = A245704(A091204(n)). %F A245822 Other identities. For all n >= 1, the following holds: %F A245822 A078442(a(n)) = A078442(n), A049076(a(n)) = A049076(n). [Preserves "the order of primeness of n"]. %F A245822 a(p_n) = p_{a(n)} where p_n is the n-th prime, A000040(n). %F A245822 a(n) = A049084(a(A000040(n))). [Thus the same permutation is induced also when it is restricted to primes]. %F A245822 A245816(n) = A062298(a(A018252(n))). [While restriction to nonprimes induces another permutation]. %o A245822 (PARI) %o A245822 allocatemem(123456789); %o A245822 default(primelimit, 2^22) %o A245822 v014580 = vector(2^18); A014580(n) = v014580[n]; %o A245822 v091226 = vector(2^22); A091226(n) = v091226[n]; %o A245822 A002808(n)={ my(k=-1); while( -n + n += -k + k=primepi(n), ); n}; \\ This function from _M. F. Hasler_ %o A245822 isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from _Charles R Greathouse IV_ %o A245822 i=0; j=0; n=2; while((n < 2^22), if(isA014580(n), i++; v014580[i] = n; v091226[n] = v091226[n-1]+1, v091226[n] = v091226[n-1]); n++) %o A245822 A091204(n) = if(n<=1, n, if(isprime(n), A014580(A091204(primepi(n))), {my(pfs, t, bits, i); pfs=factor(n); pfs[,1]=apply(t->Pol(binary(A091204(t))), pfs[,1]); sum(i=1, #bits=Vec(factorback(pfs))%2, bits[i]<<(#bits-i))})); %o A245822 A091245(n) = ((n-A091226(n))-1); %o A245822 A245704(n) = if(1==n, 1, if(isA014580(n), prime(A245704(A091226(n))), A002808(A245704(A091245(n))))); %o A245822 A245822(n) = A245704(A091204(n)); %o A245822 for(n=1, 10001, write("b245822.txt", n, " ", A245822(n))); %o A245822 (Scheme) (define (A245822 n) (A245704 (A091204 n))) %Y A245822 Inverse: A245821. %Y A245822 Other related permutations: A091204, A245704, A245816. %Y A245822 Fixed points: A245823. %Y A245822 Cf. A000040, A049084, A078442, A049076, A018252, A062298. %K A245822 nonn %O A245822 1,2 %A A245822 _Antti Karttunen_, Aug 02 2014