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!)
A254115 Permutation of natural numbers: a(n) = A254104(A048673(n)). 4

%I #13 Jun 06 2017 10:33:10

%S 1,2,3,4,5,6,7,8,13,10,11,12,9,14,21,16,15,26,23,20,43,22,19,24,63,18,

%T 33,28,31,42,47,32,55,30,127,52,27,46,87,40,17,86,39,44,107,38,29,48,

%U 75,126,91,36,95,66,191,56,53,62,45,84,35,94,1023,64,255,110,25,60,183,254,79,104,37,54,171,92,125,174,59,80,4095,34,61,172,77,78

%N Permutation of natural numbers: a(n) = A254104(A048673(n)).

%H Antti Karttunen, <a href="/A254115/b254115.txt">Table of n, a(n) for n = 1..8192</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F a(n) = A254104(A048673(n)).

%F Other identities. For all n >= 1:

%F a(n) = a(2n)/2. [Even bisection halved gives back the sequence itself.]

%F A254117(n) = (a((2*n)+1) - 1)/2. [Likewise, the odd bisection induces A254117.]

%o (Scheme, different implementations)

%o (define (A254115 n) (A254104 (A048673 n)))

%o (definec (A254115 n) (cond ((<= n 1) n) ((even? n) (* 2 (A254115 (/ n 2)))) (else (+ 1 (* 2 (A254104 (Ainv_of_A007310off0 (A003961 n))))))))

%o (define (Ainv_of_A007310off0 n) (+ (* 2 (floor->exact (/ n 6))) (/ (- (modulo n 6) 1) 4)))

%o (Python)

%o from sympy import factorint, nextprime

%o from operator import mul

%o def a048673(n):

%o f = factorint(n)

%o return 1 if n==1 else (1 + reduce(mul, [nextprime(i)**f[i] for i in f]))/2

%o def a254104(n):

%o if n==0: return 0

%o if n%3==0: return 1 + 2*a254104(2*n/3 - 1)

%o elif n%3==1: return 1 + 2*a254104(2*(n - 1)/3)

%o else: return 2*a254104((n - 2)/3 + 1)

%o def a(n): return a254104(a048673(n)) # _Indranil Ghosh_, Jun 06 2017

%Y Inverse: A254116.

%Y Fixed points: A254099.

%Y Related permutations: A048673, A254104, A254117.

%Y Cf. A003961, A007310.

%K nonn

%O 1,2

%A _Antti Karttunen_, Feb 04 2015

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 August 3 15:06 EDT 2024. Contains 374894 sequences. (Running on oeis4.)