If for some reason you don't just want to use brace expansion (also see below), you might consider:
seq 5 | xargs -I N mkdir nameN
That creates name1, name2, name3, name4, and name5. It works even if your shell does not support brace expansion (but bash does). The xargs command builds and runs commands. That specific xargs command runs commands like mkdir nameN, but with N replaced with each word of the input (which is piped in from seq). Run man xargs or read this page for more information on the -I option.
If this is for a homework assignment, perhaps you are not allowed to use a third command (xargs). But in "real life," you're less likely to have such a restriction. Furthermore, if you're doing this for learning purposes, it's an opportunity to learn the xargs command--if you don't already know it--which is useful in a variety of situations.
You can also use a shell loop, as AlexP suggested (for d in $(seq 5); do mkdir name$d; done). That for loop uses the $( ) syntax to perform command substitution in order to obtain the list 1 2 3 4 5 from seq, then uses parameter expansion ($d) to form the directory name in each mkdir command.
You should be aware that all those methods rely on the absence of whitespace in the directory names, although it is possible to modify them so that they do not.
But you're using bash and, like many shells, it supports brace expansion. Now, so unlessmaybe you need your script to be portableportable to other shells that don't--in which case (such as dash). If that's what you need, you should not use brace expansion at all--you. Otherwise, you should follow Jeff Schaller's recommendation of simply writing mkdir name{1..5}.