login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A092569
Permutation of integers a(a(n)) = n. In binary representation of n, transformation of inner bits, 1 <-> 0, gives binary representation of a(n).
12
0, 1, 2, 3, 6, 7, 4, 5, 14, 15, 12, 13, 10, 11, 8, 9, 30, 31, 28, 29, 26, 27, 24, 25, 22, 23, 20, 21, 18, 19, 16, 17, 62, 63, 60, 61, 58, 59, 56, 57, 54, 55, 52, 53, 50, 51, 48, 49, 46, 47, 44, 45, 42, 43, 40, 41, 38, 39, 36, 37, 34, 35, 32, 33, 126, 127, 124, 125, 122, 123, 120
OFFSET
0,3
COMMENTS
Primes which stay primes under transformation "opposite inner bits", A092570.
This permutation transforms the enumeration system of positive irreducible fractions A020651/A020650 into the enumeration system A245327/A245326, and vice versa. - Yosu Yurramendi, Jun 16 2015
A117120(a(n)) = a(A117120(n)), n > 0.
A258996(a(n)) = a(A258996(n)), n > 0.
A258746(a(n)) = a(A258746(n)), n > 0.
A054429(a(n)) = a(A054429(n)), n > 0.
a(n) = A054429(A065190(n)) = A065190(A054429(n)), n > 0. - Yosu Yurramendi, Mar 23 2017
LINKS
FORMULA
a(0) = 0, a(1) = 1, a(2) = 2, a(3) = 3, a(2^(m+1) +k) = a(2^m+k) + 2^(m+1),
a(2^(m+1)+2^m+k) = a(2^m+k) + 2^m, m >= 1, 0 <= k < 2^m. - Yosu Yurramendi, Apr 02 2017
EXAMPLE
a(9)=15 because 9_10 = 1001_2, transformation of inner bits gives 1001_2 -> 1111_2 = 15_10.
MATHEMATICA
bb={0, 1, 2, 3}; Do[id=IntegerDigits[n, 2]; Do[id[[i]]=1-id[[i]], {i, 2, Length[id]-1}]; bb=Append[bb, FromDigits[id, 2]], {n, 4, 1000}]; fla=Flatten[bb]
(* Second program: *)
Table[If[n < 2, n, Function[b, FromDigits[#, 2] &@ Join[{First@ b}, Most[Rest@ b] /. { 0 -> 1, 1 -> 0}, {Last@ b}]]@ IntegerDigits[n, 2]], {n, 0, 70}] (* Michael De Vlieger, Apr 03 2017 *)
PROG
(PARI)T(n)={pow2=2; v=binary(n); L=#v-1; forstep(k=L, 2, -1, if(v[k], n-=pow2, n+=pow2); pow2*=2); return(n)};
for(n=0, 70, print1(T(n), ", ")) \\ Washington Bomfim, Jan 18 2011
(R)
maxrow <- 8 # by choice
a <- 1:3 # If it were c(1, 3, 2), it would be A054429
for(m in 1:maxrow) for(k in 0:(2^m-1)){
a[2^(m+1)+ k] = a[2^m+k] + 2^(m+1)
a[2^(m+1)+2^m+k] = a[2^m+k] + 2^m
}
a
# Yosu Yurramendi, Apr 10 2017
CROSSREFS
Cf. A092570.
Sequence in context: A368160 A234613 A258996 * A361996 A191726 A234025
KEYWORD
nonn,base,easy
AUTHOR
Zak Seidov, Feb 28 2004
STATUS
approved