|
|
A163327
|
|
Self-inverse permutation of integers: swap the odd- and even-positioned digits in the ternary expansion of n, then convert back to decimal.
(history;
published version)
|
|
|
#21 by Michael De Vlieger at Fri Aug 05 15:35:09 EDT 2022
|
|
|
|
#20 by Michel Marcus at Fri Aug 05 12:59:37 EDT 2022
|
|
|
|
#19 by Michael S. Branicky at Fri Aug 05 12:55:21 EDT 2022
|
|
|
|
#18 by Michael S. Branicky at Fri Aug 05 12:55:19 EDT 2022
|
| PROG
|
(Python)
from sympy.ntheory import digits
def a(n):
d = digits(n, 3)[1:]
return sum(3**(i+(1-2*(i&1)))*di for i, di in enumerate(d[::-1]))
print([a(n) for n in range(72)]) # Michael S. Branicky, Aug 05 2022
|
| STATUS
|
approved
editing
|
|
|
|
#17 by Alois P. Heinz at Fri Jan 07 07:24:15 EST 2022
|
|
|
|
#16 by Joerg Arndt at Fri Jan 07 02:33:57 EST 2022
|
|
|
|
#15 by Michel Marcus at Fri Jan 07 01:25:22 EST 2022
|
|
|
|
#14 by Michel Marcus at Fri Jan 07 01:25:18 EST 2022
|
| LINKS
|
A. Antti Karttunen, <a href="/A163327/b163327.txt">Table of n, a(n) for n = 0..728</a>
|
| STATUS
|
proposed
editing
|
|
|
|
#13 by Jon E. Schoenfield at Fri Jan 07 00:15:22 EST 2022
|
|
|
|
#12 by Jon E. Schoenfield at Fri Jan 07 00:15:21 EST 2022
|
| NAME
|
Self-inverse permutation of integers: swap the odd - and even-positioned digits in the ternary expansion of n, then convert back to decimal.
|
| EXAMPLE
|
11 in ternary base (A007089) is written as '(000...)102' (... + 0*27 + 1*9 + 0*3 + 2), which results '1020' = 1*27 + 0*9 + 2*3 + 0 = 33, when the odd - and even-positioned digits are swapped, thus a(11) = 33.
|
| STATUS
|
approved
editing
|
|
|
|