77. a) Find all numbers $n$ between 1 and 100 such that $(n-1)!$ does not divide $n$.

b) Find all numbers $n$ between 1 and 100 such that $(n-1)!$ does not divide $n^2$.
77. a) The number ( $n-1$ )! does not divide $n$ only in the case when $n$ is a prime number or if $n=4$. Indeed, if $n$ is a composite number that can be represented as the product of two different factors $a$ and $b$, then both $a$ and $b$ are less than $n-1$ and, consequently, are included in ( $n-1$ )!; hence, ( $n-1$ )! is divisible by $a b=n$. If $n$ is the square of a prime number $p$ greater than two, then $n-1=p^{2}-1>2 p$. Therefore, both $p$ and $2 p$ are included in ( $n-1$ )!; hence, $(n-1)$ ! is divisible by $p \cdot 2 p=2 p^{2}=2$ n. Thus, the condition of the problem is satisfied only by the numbers $2,3,4,5,7,11,13,17,19,23,29,31$, $37,41,43,47,53,59,61,67,7$ ! $, 73,79,83,89,97$, i.e., the number 4 and all prime numbers less than 100.

b) ( $n-1$ )! does not divide $n^{2}$ only in the following cases: $n$ is a prime number, $n$ is a doubled prime number, $n=8, n=9$. Indeed, if $n$ is neither a prime number nor a doubled prime number, nor the square of a prime number, and is not equal to 8 or 16, then $n$ can be represented as $n=a b$, where $a$ and $b$ are different numbers, not less than 3. We will assume that $b>a, a \geqslant 3$. In this case, the numbers $a, b, 2 a, 2 b, 3 a$ are all less than $n-1$ and at least one of the numbers $2 a$ and $3 a$ is different from the numbers $a, b$ and $2 b$. Thus, ( $n-1$ )! includes the factors $a, b$, $2 b, 2 a$ or $a, b, 2 b, 3 a$ (or possibly all factors $a, b$, $2 b, 2 a, 3 a$); in all cases, ( $n-1$ )! is divisible by $a^{2} b^{2}=n^{2}$.

Furthermore, if $n=p^{2}$, where $p$ is a prime number greater than 4, then $n-1>4 p$ and ( $n-1$ )! contains the factors $p, 2 p, 3 p, 4 p$ and, consequently, is divisible by $p^{4}=n^{2}$. If $n=2 p$, then ( $n-1$ )! is not divisible by $p^{2}$, and, consequently, not by $n^{2}$; when $n=8$ or 9, then ( $n-1$ )! is not divisible by $n^{2}$ ( 7 ! is not divisible by $8^{2}$ and 8 ! is not divisible by $9^{2}$ ); when $n=$ $=16$, then ( $n-1$ )! is divisible by $n^{2}$ (15! contains the factors $2,4=$ $=2^{2}, 6=3 \cdot 2,8=2^{3}, 10=2 \cdot 5,12=2^{2} \cdot 3,14=2 \cdot 7$ and, consequently, is divisible by $2^{1+2+1+3+1+2+1}=2^{11}=16^{2} \cdot 2^{3}$ ).

Thus, the condition of problem b) is satisfied by all numbers that satisfy the condition of problem a), and, in addition, the numbers $6,8,9$, $10,14,22,26,34,38,46,58,62,74,82,86,94$, i.e., all prime numbers, all doubled prime numbers, and the numbers 8 and 9.