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!)
A254118 Permutation of natural numbers: a(n) = A249745(1+A254103(n)) - 1. 4
1, 2, 3, 6, 5, 4, 8, 20, 11, 7, 9, 33, 18, 23, 14, 13, 30, 36, 21, 44, 10, 29, 15, 55, 53, 28, 16, 74, 39, 41, 12, 179, 90, 96, 50, 114, 24, 42, 35, 92, 69, 47, 19, 86, 25, 51, 26, 236, 153, 110, 81, 101, 22, 45, 48, 221, 113, 119, 56, 77, 65, 38, 17, 546, 182 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = A249745(1+A254103(n)) - 1.
a(n) = (A254116((2*n)+1)-1) / 2. [Obtained also from the odd bisection of A254116.]
PROG
(PARI)
default(primelimit, 2^30);
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
A064216(n) = A064989((2*n)-1);
A254103(n) = { if(0==n, 0, if(!(n%2), (3*A254103(n/2))-1, (3*(1+A254103((n-1)/2)))\2)); };
A254118(n) = (A254116(n+n+1)-1)/2;
for(n=1, 8191, write("b254118.txt", n, " ", A254118(n)));
(Scheme, two versions)
(define (A254118 n) (+ -1 (A249745 (+ 1 (A254103 n)))))
(define (A254118 n) (/ (+ -1 (A254116 (+ 1 n n))) 2))
(Python)
from sympy import factorint, prevprime, floor
from operator import mul
from functools import reduce
def a064216(n):
f=factorint(2*n - 1)
return 1 if n==1 else reduce(mul, [prevprime(i)**f[i] for i in f])
def a254103(n):
if n==0: return 0
if n%2==0: return 3*a254103(n//2) - 1
else: return floor((3*(1 + a254103((n - 1)/2)))//2)
def a254116(n): return a064216(a254103(n))
def a(n): return (a254116(2*n + 1) - 1)//2
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 06 2017
CROSSREFS
Inverse: A254117.
Other related permutations: A254116, A249745, A254103 (compare to the scatterplot of this one).
Cf. A254120 (= a(2^n)).
Sequence in context: A371343 A166166 A106452 * A056895 A254117 A370629
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, Feb 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 July 12 07:24 EDT 2024. Contains 374237 sequences. (Running on oeis4.)