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.

A245450 Self-inverse permutation of natural numbers, A245703-conjugate of balanced bit-reverse: a(n) = A245704(A057889(A245703(n))).

This page as a plain text file.
%I A245450 #11 Aug 08 2014 09:00:39
%S A245450 1,2,3,4,5,6,13,8,9,10,19,12,7,14,15,16,53,18,11,20,21,22,23,24,25,26,
%T A245450 27,33,41,30,113,32,28,34,35,36,47,39,38,92,29,54,163,85,45,462,37,60,
%U A245450 49,70,51,94,17,42,55,74,57,156,193,48,101,62,115,64,259,77,73,132,69,50,181,102,67,56,169,76,66,78,137,87,180,398,139,84,44
%N A245450 Self-inverse permutation of natural numbers, A245703-conjugate of balanced bit-reverse: a(n) = A245704(A057889(A245703(n))).
%H A245450 Antti Karttunen, <a href="/A245450/b245450.txt">Table of n, a(n) for n = 1..10080</a>
%H A245450 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A245450 a(n) = A245704(A057889(A245703(n))).
%F A245450 Other identities. For all n >= 1, the following holds:
%F A245450 A010051(a(n)) = A010051(n). [Maps primes to primes and composites to composites].
%o A245450 (PARI)
%o A245450 allocatemem(234567890);
%o A245450 default(primelimit, 2^22);
%o A245450 A014580 = vector(2^18);
%o A245450 A091226 = vector(2^22);
%o A245450 A091242 = vector(2^22);
%o A245450 A002808(n)={ my(k=-1); while( -n + n += -k + k=primepi(n), ); n}; \\ This function from _M. F. Hasler_
%o A245450 isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from _Charles R Greathouse IV_
%o A245450 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 A245450 A091245(n) = ((n-A091226[n])-1);
%o A245450 A245703(n) = if(1==n, 1, if(isprime(n), A014580[A245703(primepi(n))], A091242[A245703(n-primepi(n)-1)]));
%o A245450 A245704(n) = if(1==n, 1, if(isA014580(n), prime(A245704(A091226[n])), A002808(A245704(A091245(n)))));
%o A245450 A057889(n) = if(n<1, 0, 2^valuation(n,2) * subst(Polrev(binary(n / 2^valuation(n, 2))),x,2));
%o A245450 A245450(n) = A245704(A057889(A245703(n)));
%o A245450 for(n=1, 10080, write("b245450.txt", n, " ", A245450(n)));
%o A245450 (Scheme) (define (A245450 n) (A245704 (A057889 (A245703 n))))
%Y A245450 Cf. A010051, A244987, A057889, A245703, A245704, A234747, A234748, A245453.
%K A245450 nonn
%O A245450 1,2
%A A245450 _Antti Karttunen_, Aug 07 2014