login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Least inverse of the Kempner function A002034.
9

%I #38 Oct 17 2024 14:28:47

%S 1,2,3,4,5,9,7,32,27,25,11,243,13,49,125,4096,17,2187,19,625,343,121,

%T 23,59049,3125,169,177147,2401,29,78125,31,134217728,1331,289,16807,

%U 43046721,37,361,2197,1953125,41,117649,43,14641,9765625,529,47

%N Least inverse of the Kempner function A002034.

%C To compute the n-th term for n > 1: For each prime p that divides n, find the highest power p^E(p) that divides (n-1)!. Then a(n) is the smallest of the numbers p^(E(p)+1). - _Jonathan Sondow_, Mar 03 2004

%C p^(E(p)+1) is smallest when p = P(n), the largest prime dividing n (since E(p) is approximately p^((n-1)/(p-1)), which decreases as p increases). So a(n) = P(n)^(E(P(n))+1) = A006530(n)^A102048(n) for n>1. - _Jonathan Sondow_, Dec 26 2004

%D R. L. Graham, D. E. Knuth and O. Patashnik, "Factorial Factors" Sect. 4.4 in Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, pp. 111-115, 1994.

%H Charlie Neder, <a href="/A046021/b046021.txt">Table of n, a(n) for n = 1..1000</a>

%H J. Sondow and E. W. Weisstein, <a href="http://mathworld.wolfram.com/SmarandacheFunction.html">MathWorld: Smarandache Function</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/GreatestPrimeFactor.html">Greatest Prime Factor</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Factorial.html">Factorial</a>.

%H <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>.

%F a(n) = P^(1+Sum(k=1 to [log(n-1)/log(P)], [(n-1)/P^k])) for n>1, where P = A006530(n) is the largest prime dividing n. E.g. a(6) = 9 because 9 is the least integer m with A002034(m) = 6, that is, m divides 6!, but m does not divide k! for k < 6. - _Jonathan Sondow_, Dec 26 2004

%t With[{p=First[Last[FactorInteger[n, FactorComplete->True]]]}, p^(1+Sum[Floor[(n-1)/p^k], {k, Floor[Log[n-1]/Log[p]]}])] (* _Jonathan Sondow_, Dec 26 2004 *)

%o (PARI) A046021(n,p=A006530(n))=p^A102048(n,p) \\ _M. F. Hasler_, Nov 27 2018

%o (Python)

%o from sympy import primefactors, integer_log

%o def A046021(n):

%o if n == 1: return 1

%o p = max(primefactors(n))

%o return p**sum(((n-1)//p**k for k in range(1,integer_log(n-1,p)[0]+1)),start=1) # _Chai Wah Wu_, Oct 17 2024

%Y Cf. A002034, A046022, A006530, A102048.

%K nonn,nice

%O 1,2

%A _Eric W. Weisstein_

%E More terms from _David W. Wilson_ and _Christian G. Bower_, independently.