BUG: pd.date_range gives a error when freq = LastWeekOfMonth(1)
- [x] I have checked that this issue has not already been reported.

- [x] I have confirmed this bug exists on the latest version of pandas.

- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.

---

**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.

#### Code Sample, a copy-pastable example

```python
>>> from pandas.tseries.offsets import *
>>> fq = LastWeekOfMonth(1)
>>> pd.date_range('2018-04-01', periods=1, freq=fq)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/miniconda3/envs/test37/lib/python3.7/site-packages/pandas/core/indexes/datetimes.py", line 1077, in date_range
    **kwargs,
  File "/home/miniconda3/envs/test37/lib/python3.7/site-packages/pandas/core/arrays/datetimes.py", line 416, in _generate_range
    values = np.array([x.value for x in xdr], dtype=np.int64)
  File "/home/miniconda3/envs/test37/lib/python3.7/site-packages/pandas/core/arrays/datetimes.py", line 416, in <listcomp>
    values = np.array([x.value for x in xdr], dtype=np.int64)
  File "/home/miniconda3/envs/test37/lib/python3.7/site-packages/pandas/core/arrays/datetimes.py", line 2438, in generate_range
    end = start + (periods - 1) * offset
  File "pandas/_libs/tslibs/offsets.pyx", line 459, in pandas._libs.tslibs.offsets.BaseOffset.__mul__
  File "pandas/_libs/tslibs/offsets.pyx", line 455, in pandas._libs.tslibs.offsets.BaseOffset.__mul__
  File "pandas/_libs/tslibs/offsets.pyx", line 2647, in pandas._libs.tslibs.offsets.LastWeekOfMonth.__init__
ValueError: N cannot be 0
```

#### Problem description

The  output of date_range with period = 1, freq = LastWeekOfMonth should not raise a error, since other freq like WeekOfMonth gives a normal output with period = 1.

#### Expected Output
```DatetimeIndex(['2018-04-30'], dtype='datetime64[ns]', freq='LWOM-MON')```

#### Output of ``pd.show_versions()``

<details>

INSTALLED VERSIONS
------------------
commit           : 2cb96529396d93b46abab7bbc73a208e708c642e
python           : 3.7.10.final.0
python-bits      : 64
OS               : Linux
OS-release       : 5.4.0-72-generic
Version          : #80~18.04.1-Ubuntu SMP Mon Apr 12 23:26:25 UTC 2021
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : zh_CN.UTF-8
LOCALE           : zh_CN.UTF-8

pandas           : 1.2.4
numpy            : 1.19.3
pytz             : 2021.1
dateutil         : 2.8.1
pip              : 21.0.1
setuptools       : 52.0.0.post20210125
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : 3.5.4
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : None
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : 2.11.3
IPython          : 7.22.0
pandas_datareader: None
bs4              : None
bottleneck       : None
fsspec           : None
fastparquet      : None
gcsfs            : None
matplotlib       : 3.4.1
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : None
pyxlsb           : None
s3fs             : None
scipy            : 1.6.2
sqlalchemy       : None
tables           : None
tabulate         : None
xarray           : None
xlrd             : None
xlwt             : None
numba            : None


</details>
