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.

A302782 Inverse permutation to A302781.

Original entry on oeis.org

0, 1, 3, 15, 5, 2, 21, 14, 63, 6, 255, 12, 85, 20, 4, 341, 1023, 62, 4095, 10, 22, 254, 1365, 13, 5461, 86, 60, 16, 16383, 7, 65535, 340, 252, 1022, 26, 48, 21845, 4094, 84, 9, 87381, 23, 262143, 240, 58, 1366, 1048575, 342, 349525, 5460, 1020, 90, 1398101, 61, 250, 19, 4092, 16382, 4194303, 11, 16777215, 65534, 42
Offset: 1

Views

Author

Antti Karttunen, Apr 14 2018

Keywords

Crossrefs

Cf. A302781 (inverse).

Programs

  • PARI
    up_to = 8192;
    v050376 = vector(up_to);
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to,break));
    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); };
    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
    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); };
    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))));
    A302845(n) = A163355(A006068(A006068(n)));
    A302782(n) = A302845(A052331(n));

Formula

a(n) = A302845(A052331(n)).