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 A245816 #15 Apr 01 2017 21:12:07 %S A245816 1,2,4,5,3,10,6,22,7,16,9,23,27,51,15,17,35,13,37,11,39,56,69,38,14, %T A245816 18,48,78,33,120,20,19,46,67,24,62,42,34,28,73,25,103,31,206,40,55,68, %U A245816 92,300,26,76,50,99,65,157,281,165,184,8,121,134,277,423,30,47,36,223,70,514,75,101,116,236,139,74 %N A245816 Permutation of natural numbers induced when A245822 is restricted to nonprime numbers: a(n) = A062298(A245822(A018252(n))). %C A245816 This permutation is induced when A245822 is restricted to nonprimes, A018252, the first column of A114537, but equally, when it is restricted to column 2 (A007821), column 3 (A049078), etc. of that square array, or alternatively, to the successive rows of A236542. %C A245816 The sequence of fixed points f(n) begins as 1, 2, 15, 142, 548, 1694, 54681. A018252(f(n)) gives the nonprime terms of A245823. %H A245816 Antti Karttunen, <a href="/A245816/b245816.txt">Table of n, a(n) for n = 1..10001</a> %H A245816 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A245816 a(n) = A062298(A245822(A018252(n))). %F A245816 As a composition of related permutations: %F A245816 a(n) = A245820(A245814(n)). %F A245816 Also following holds for all n >= 1: %F A245816 a(n) = A062298(A049084(A245822(A007821(n)))). %F A245816 a(n) = A062298(A049084(A049084(A245822(A049078(n))))). %F A245816 etc. %o A245816 (PARI) %o A245816 allocatemem(123456789); %o A245816 default(primelimit, 2^22) %o A245816 A014580 = vector(2^18); %o A245816 A091226 = vector(2^22); %o A245816 A002808(n)={my(k); for(k=0, primepi(n), isprime(n++)&&k--); n}; \\ This function from _M. F. Hasler_, Oct 31 2008 %o A245816 A062298(n) = n-primepi(n); %o A245816 A018252(n) = if(1==n,1,A002808(n-1)); %o A245816 isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from _Charles R Greathouse IV_ %o A245816 i=0; j=0; n=2; while((n < 2^22), if(isA014580(n), i++; A014580[i] = n; A091226[n] = A091226[n-1]+1, A091226[n] = A091226[n-1]); n++) %o A245816 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 A245816 A091245(n) = ((n-A091226[n])-1); %o A245816 A245704(n) = if(1==n, 1, if(isA014580(n), prime(A245704(A091226[n])), A002808(A245704(A091245(n))))); %o A245816 A245822(n) = A245704(A091204(n)); %o A245816 A245816(n) = A062298(A245822(A018252(n))); %o A245816 for(n=1, 10001, write("b245816.txt", n, " ", A245816(n))); %o A245816 (Scheme) (define (A245816 n) (A062298 (A245822 (A018252 n)))) %Y A245816 Inverse: A245815. %Y A245816 Related permutations: A245814, A245820, A245822. %Y A245816 Cf. A007821, A018252, A049078, A062298, A114537, A236542, A245823. %K A245816 nonn %O A245816 1,2 %A A245816 _Antti Karttunen_, Aug 02 2014