%I #12 Mar 24 2026 00:17:00
%S 1,2,3,4,5,6,7,9,8,11,10,13,12,15,14,18,16,21,20,19,25,17,23,22,28,27,
%T 26,32,24,30,29,38,37,34,43,31,41,33,40,50,39,49,36,47,45,55,42,53,44,
%U 52,64,51,62,35,48,60,58,72,54,70,56,67,82,65,80,46,61,78,63,76,91,57,74,71,89,73,69,85,86,104
%N a(n) is the position of A003961(A025487(n)) in A147516.
%C This is a permutation of the positive integers.
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>.
%e a(11) = 10 as A025487(11) = 36 = 2^2 * 3^2. When replacing each prime factor in the prime factorization with the next larger prime we get 3^3 * 5^2 = 225 = A147516(10).
%o (Python)
%o from functools import lru_cache
%o from itertools import count
%o from sympy import prime, integer_log, primorial, nextprime, factorint
%o from oeis_sequences.OEISsequences import bisection
%o def A393258(n):
%o @lru_cache(maxsize=None)
%o def g(x, m, j): return sum(g(x//(prime(m)**i), m-1, i) for i in range(j,integer_log(x, prime(m))[0]+1)) if m-1 else max(0,x.bit_length()-j)
%o @lru_cache(maxsize=None)
%o def h(x, m, j): return sum(h(x//(prime(m)**i), m-1, i) for i in range(j,integer_log(x, prime(m))[0]+1)) if m>2 else max(0,integer_log(x,3)[0]+1-j)
%o def f(x):
%o c = n-1+x
%o for k in count(1):
%o if primorial(k)>x:
%o break
%o c -= g(x,k,1)
%o return c
%o m, c = prod(nextprime(p)**e for p,e in factorint(bisection(f,n,n)).items()), 1
%o for k in count(2):
%o if primorial(k)>(m<<1):
%o break
%o c += h(m,k,1)
%o return c # _Chai Wah Wu_, Mar 23 2026
%Y Cf. A003961, A025487, A147516.
%K nonn
%O 1,2
%A _David A. Corneth_, Feb 07 2026