Hello Jtccc,
We understand wanting to utilize previous iPads.
By 'four number long,' that would mean the passcode which would be different from the two-factor authentication code.
As for two-factor authentication:
If you use two-factor authentication with devices running older OS versions—like an Apple TV (2nd or 3rd generation)—you might be asked to add your six-digit verification code to the end of your password when signing in. Get your verification code from a trusted device running iOS 9 and later or OS X El Capitan and later, or have it sent to your trusted phone number. Then type your password followed by the six-digit verification code directly into the password field.
You can learn more here: Two-factor authentication for Apple ID
You would need to update your iPad to at least iOS 9 or later if it is able to in order to utilize and receive a code.
Thanks and have a great day.