|
| |
|
|
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).
|
|
1
| |
|
|
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
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 0,3
|
|
|
COMMENTS
| Primes which stay primes under transformation "opposite inner bits", A092570.
|
|
|
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]
|
|
|
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), ", ")) - W. Bomfim Jan 18, 2011
|
|
|
CROSSREFS
| Cf. A092570.
Sequence in context: A001058 A114462 A169746 * A191726 A088573 A181514
Adjacent sequences: A092566 A092567 A092568 * A092570 A092571 A092572
|
|
|
KEYWORD
| nonn,base,easy
|
|
|
AUTHOR
| Zak Seidov (zakseidov(AT)yahoo.com), Feb 28 2004
|
| |
|
|