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 A302782 #9 Mar 22 2022 00:12:09 %S A302782 0,1,3,15,5,2,21,14,63,6,255,12,85,20,4,341,1023,62,4095,10,22,254, %T A302782 1365,13,5461,86,60,16,16383,7,65535,340,252,1022,26,48,21845,4094,84, %U A302782 9,87381,23,262143,240,58,1366,1048575,342,349525,5460,1020,90,1398101,61,250,19,4092,16382,4194303,11,16777215,65534,42 %N A302782 Inverse permutation to A302781. %H A302782 Antti Karttunen, <a href="/A302782/b302782.txt">Table of n, a(n) for n = 1..8192</a> %H A302782 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A302782 a(n) = A302845(A052331(n)). %o A302782 (PARI) %o A302782 up_to = 8192; %o A302782 v050376 = vector(up_to); %o A302782 ispow2(n) = (n && !bitand(n,n-1)); %o A302782 i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to,break)); %o A302782 A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(n/d)), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); }; %o A302782 A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068 %o A302782 A057300(n) = { my(t=1,s=0); while(n>0, if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); }; %o A302782 A163355(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); if(((1==d)&&!(i%2))||((2==d)&&(i%2)), f+A163355(A057300(r)), if(3==d,f+f+A163355(A057300(r)), (3*f)+A163355(f-1-r)))); %o A302782 A302845(n) = A163355(A006068(A006068(n))); %o A302782 A302782(n) = A302845(A052331(n)); %Y A302782 Cf. A302781 (inverse). %Y A302782 Cf. A006068, A052331, A163355, A302845. %K A302782 nonn %O A302782 1,3 %A A302782 _Antti Karttunen_, Apr 14 2018