The problem with taking the factorial is that it repeats prime powers too many times: For example, $8!$ contains $6$ powers of $2$, while $8$ is only divisble by $2^3$.
You're looking for the number that's divisible by all the primes at most $A$, and powers of primes that are still less than $A$; to this end, let $P_A = \{p_1, p_2,\dots p_n\}$ be the collection of primes in $\{1, \dots, A\}$. Then for primes $p$,
$$p^k \le A \iff k \le \frac{\log A}{\log p}$$
Thus, the desired number is
$$\operatorname{lcm}(1,2,\dots,A) = \prod_{k = 1}^n p_k^{\lfloor\log A / \log p_k\rfloor}$$
where $\lfloor \cdot \rfloor$ denotes the floor function.
As an example, for $A = 8$, we have $P_A = \{2,3,5,7\}$. Then the exponent for $2$ is
$$\left\lfloor \frac{\log 8}{\log 2} \right\rfloor = 3$$
as expected. Similarly, the exponent for $3$ is $\lfloor \log 8 / \log 3\rfloor = 1$, and likewise for $5$ and $7$. Thus the desired number is
$$2^3 \cdot 3 \cdot 5 \cdot 7 = 840$$