What’s the optimal number of digits for a verification text message?

This is regarding a validation process in an app. User has downloaded the app, within it they get asked to validate their account through a text message. So they have to check their messages, then enter a code in the app.

When you get a text message sent to the phone number you've already entered to validate your account, I know iCloud uses 4 digits and some uses 6. In my mind 4 is better since it's easier to remember as a chunk than 6 digits. I can easily remember 4432 but harder to remember 443 267 as I jump between the messaging app and the app that validates. I get there's a security issue, but since they've entered the number themselves and received the text the security should be high even with 4 digits.

So, here's the question: which will result in more conversion and does anyone have any articles regarding this?