For 40 gallons... Abdopus aculeatus or a group of Octopus mercatoris.
Abdopus isn't technically a dwarf, but it stays relatively small. O. mercatoris is a dwarf at a fraction of the size of Abdopus.
Abdopus is diurnal, active throughout the daylight hours. O. mercatoris is strictly nocturnal.
Just make sure you have a really good skimmer rated for about 3x the tank size and keep a regular water change routine.