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.

A244987 Self-inverse permutation of natural numbers, A245703-conjugate of Blue code: a(n) = A245704(A193231(A245703(n))).

This page as a plain text file.
%I A244987 #9 Aug 08 2014 09:00:00
%S A244987 1,3,2,6,5,4,13,8,21,15,23,16,7,25,10,12,41,18,19,64,9,22,11,49,14,26,
%T A244987 77,39,37,34,263,105,38,30,88,70,29,33,28,133,17,54,73,126,51,462,53,
%U A244987 60,24,66,45,74,47,42,78,94,156,81,239,48,97,62,100,20,155,50,79,98,84,36,167,141,43,52,129,164,27,55
%N A244987 Self-inverse permutation of natural numbers, A245703-conjugate of Blue code: a(n) = A245704(A193231(A245703(n))).
%H A244987 Antti Karttunen, <a href="/A244987/b244987.txt">Table of n, a(n) for n = 1..10001</a>
%H A244987 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A244987 a(n) = A245704(A193231(A245703(n))).
%F A244987 Other identities. For all n >= 1, the following holds:
%F A244987 A010051(a(n)) = A010051(n). [Maps primes to primes and composites to composites].
%o A244987 (PARI)
%o A244987 allocatemem(234567890);
%o A244987 default(primelimit, 2^22);
%o A244987 A014580 = vector(2^18);
%o A244987 A091226 = vector(2^22);
%o A244987 A091242 = vector(2^22);
%o A244987 A002808(n)={ my(k=-1); while( -n + n += -k + k=primepi(n), ); n}; \\ This function from _M. F. Hasler_
%o A244987 isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from _Charles R Greathouse IV_
%o A244987 i=0; j=0; n=2; while((n < 2^22), if(isA014580(n), i++; A014580[i] = n; A091226[n] = A091226[n-1]+1, j++; A091242[j] = n; A091226[n] = A091226[n-1]); n++);
%o A244987 A091245(n) = ((n-A091226[n])-1);
%o A244987 A245703(n) = if(1==n, 1, if(isprime(n), A014580[A245703(primepi(n))], A091242[A245703(n-primepi(n)-1)]));
%o A244987 A245704(n) = if(1==n, 1, if(isA014580(n), prime(A245704(A091226[n])), A002808(A245704(A091245(n)))));
%o A244987 A193231(n) = {my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2)};
%o A244987 A244987(n) = A245704(A193231(A245703(n)));
%o A244987 for(n=1, 10001, write("b244987.txt", n, " ", A244987(n)));
%o A244987 (Scheme) (define (A244987 n) (A245704 (A193231 (A245703 n))))
%Y A244987 Cf. A000040, A002808, A010051, A193231, A245703, A245704, A234747, A234748, A245450, A245454.
%K A244987 nonn
%O A244987 1,2
%A A244987 _Antti Karttunen_, Aug 07 2014