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)).

This page as a plain text file.
%I A302029 #5 Apr 13 2018 21:55:47
%S A302029 0,1,3,7,15,2,31,6,63,14,127,4,255,30,12,511,1023,62,2047,8,28,126,
%T A302029 4095,5,8191,254,60,24,16383,13,32767,510,124,1022,16,56,65535,2046,
%U A302029 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
%N A302029 Inverse permutation of A207901: a(n) = A006068(A052331(n)).
%H A302029 Antti Karttunen, <a href="/A302029/b302029.txt">Table of n, a(n) for n = 1..4096</a>
%H A302029 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A302029 a(n) = A006068(A052331(n)).
%o A302029 (PARI)
%o A302029 up_to = 4096;
%o A302029 v050376 = vector(up_to);
%o A302029 ispow2(n) = (n && !bitand(n,n-1));
%o A302029 i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to,break));
%o A302029 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 A302029 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 A302029 A302029(n) = A006068(A052331(n));
%Y A302029 Inverse of A207901.
%Y A302029 One less than A302030.
%K A302029 nonn
%O A302029 1,3
%A A302029 _Antti Karttunen_, Apr 13 2018