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.

A302029 Inverse permutation of A207901: a(n) = A006068(A052331(n)).

Original entry on oeis.org

0, 1, 3, 7, 15, 2, 31, 6, 63, 14, 127, 4, 255, 30, 12, 511, 1023, 62, 2047, 8, 28, 126, 4095, 5, 8191, 254, 60, 24, 16383, 13, 32767, 510, 124, 1022, 16, 56, 65535, 2046, 252, 9, 131071, 29, 262143, 120, 48, 4094, 524287, 508, 1048575, 8190, 1020, 248, 2097151, 61, 112, 25, 2044, 16382, 4194303, 11, 8388607, 32766, 32
Offset: 1

Views

Author

Antti Karttunen, Apr 13 2018

Keywords

Crossrefs

Inverse of A207901.
One less than A302030.

Programs

  • PARI
    up_to = 4096;
    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
    A302029(n) = A006068(A052331(n));

Formula

a(n) = A006068(A052331(n)).