login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A263272 Self-inverse permutation of nonnegative integers: a(n) = A263273(2*n) / 2. 29
0, 1, 2, 3, 4, 5, 6, 11, 8, 9, 10, 7, 12, 13, 14, 15, 32, 23, 18, 29, 20, 33, 38, 17, 24, 35, 26, 27, 28, 19, 30, 37, 16, 21, 34, 25, 36, 31, 22, 39, 40, 41, 42, 95, 68, 45, 86, 59, 96, 113, 50, 69, 104, 77, 54, 83, 56, 87, 110, 47, 60, 101, 74, 99, 92, 65, 114, 119, 44, 51, 98, 71, 72, 89, 62, 105, 116, 53, 78, 107, 80, 81 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = A263273(2*n) / 2 = A264984(n) / 2.
As a composition of related permutations:
a(n) = A264974(A264975(n)) = A264976(A264974(n)).
Other identities. For all n >= 0:
a(3*n) = 3*a(n).
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]
A264974(n) = a(2n)/2. [Thus the restriction onto even numbers induces yet another permutation.]
MATHEMATICA
f[n_] := Block[{g, h}, g[x_] := x/3^IntegerExponent[x, 3]; h[x_] := x/g@ x; If[n == 0, 0, FromDigits[Reverse@ IntegerDigits[#, 3], 3] &@ g[n] h[n]]]; Table[f[2 n]/2, {n, 0, 81}] (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A263273 *)
PROG
(Scheme) (define (A263272 n) (/ (A263273 (+ n n)) 2))
(Python)
from sympy import factorint
from sympy.ntheory.factor_ import digits
from operator import mul
def a030102(n): return 0 if n==0 else int(''.join(map(str, digits(n, 3)[1:][::-1])), 3)
def a038502(n):
f=factorint(n)
return 1 if n==1 else reduce(mul, [1 if i==3 else i**f[i] for i in f])
def a038500(n): return n/a038502(n)
def a263273(n): return 0 if n==0 else a030102(a038502(n))*a038500(n)
def a(n): return a263273(2*n)/2 # Indranil Ghosh, May 23 2017
CROSSREFS
Bisections: A264986, A264987.
Sequence in context: A245706 A072622 A072621 * A264968 A264967 A266641
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 05 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)