# Smallest integer divisible by all up to $n$

What's the smallest integer which is divisible by all integers $1, 2, \dots, n$? Is there a simple way to represent the answer? Call it $f(n)$ here.

Clearly factorial ($n!$) satisfies the condition of divisibility. But once you get to $f(4)$ (which is $12$), factorial ($24$) is too large, because it includes as factors both $4$ and $2$, which are redundant.

Multiplying all the prime numbers up to $n$ gives you another estimate, which is this time too low, because you need to include primes multiple times when they're repeated in the factorization of the inputs.

So the answer is somewhere between factorial, and the product of primes. Is there a simple answer?

-
It's the least common multiple of $\{1,\dots,n\}$, that is, $\mathrm{lcm}(1,2,\dots,n)$ –  Bill Cook Nov 8 '11 at 0:03
Let $p_1,\dots,p_\ell$ be the primes less than or equal to $n$ and $k_i$ be the largest integer such that $p_i^{k_i}<n$, then $\mathrm{lcm}(1,2,\dots,n)=p_1^{k_1}\cdots p_\ell^{k_\ell}$ –  Bill Cook Nov 8 '11 at 0:06

Given $n$, and given a prime number $p$, there's a non-negative integer $r=r(p)$ such that $p^r\le n\lt p^{r+1}$. The number you are looking for is the product of all the numbers $p^r$ over all the primes $p$.

It is known to be asymptotic to $e^n$, but this is not so easy to prove.

-

For more, see http://oeis.org/A003418 and references given there.

-

It's the least common multiple of $\{1,\dots,n\}$, that is, $\mathrm{lcm}(1,2,\dots,n)$
Let $p_1,\dots,p_\ell$ be the primes less than or equal to $n$ and $k_i$ be the largest integer such that $p_i^{k_i}<n$, then $\mathrm{lcm}(1,2,\dots,n)=p_1^{k_1}\cdots p_\ell^{k_\ell}$.
Yes: $\text{lcm}(1,2,\ldots,n)$.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.947005569934845, "perplexity": 141.92953615571662}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-06/segments/1422121540415.91/warc/CC-MAIN-20150124174540-00140-ip-10-180-212-252.ec2.internal.warc.gz"}