login
A393258
a(n) is the position of A003961(A025487(n)) in A147516.
1
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, 26, 32, 24, 30, 29, 38, 37, 34, 43, 31, 41, 33, 40, 50, 39, 49, 36, 47, 45, 55, 42, 53, 44, 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
OFFSET
1,2
COMMENTS
This is a permutation of the positive integers.
EXAMPLE
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).
PROG
(Python)
from functools import lru_cache
from itertools import count
from sympy import prime, integer_log, primorial, nextprime, factorint
from oeis_sequences.OEISsequences import bisection
def A393258(n):
@lru_cache(maxsize=None)
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)
@lru_cache(maxsize=None)
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)
def f(x):
c = n-1+x
for k in count(1):
if primorial(k)>x:
break
c -= g(x, k, 1)
return c
m, c = prod(nextprime(p)**e for p, e in factorint(bisection(f, n, n)).items()), 1
for k in count(2):
if primorial(k)>(m<<1):
break
c += h(m, k, 1)
return c # Chai Wah Wu, Mar 23 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, Feb 07 2026
STATUS
approved