Your looking at about 8-10 Malawis in a 40 gallon tank, but it also depends on the shape of the tank - if you have a tall tank you may only be able to keep the 6, but if you have a long tank then you can probably do closer to 10. And of course since malawis range from 2" to 24", you'd want to make it clear what type of 'Malawi' you have. The numbers I gave are based on average mbuna.
i have a 55 gallon long with approx 18 malawi's/tanganyika's.mine all lived together at my lfs and with the exception of 2 tropheus sp black kiriza's having a full on fight to the death,everything has been really good.i have added some more malawi's from another fish shop approx 6 weeks ago and they have all settled in fine.i read all the time,reading and learning about what fish go with what fish.lots of mine are a single specimen to avoid fighting/bullying.a really good malawi site is malawimayhem.research the fish that you like.how big do they getwhat do they eatshould i get 1 male and 3 females of the samethere are lots of guide lines for malawis of fish that should work together,fish that may work together,and,fish that wont work together.socolofi's are nice,as are yellow labs.
in my 40 i have 6 malawi and a pleco.4 red zebra possibly 2 male 2 female or 3 male 1 female,1 yellow lab female,1 blue acei gender ?,and the rubber lipped plecto
i wnat to put in male + female blue ram,1 jewel, possibly a small green terror,and a small synodontis.i have live plants,doing well,and a fairly rocky tank with arogonite/white sand in the tank
i've got 3 jewels in my tank with my various malawis/tanganyikans.only been in the tank a week.ok at the minute,but too early to make a recommendation.the green terror is a definite no no.
the best syno's to add are the petricola and the multipuncatus.they are expensive though at approx £30 each( ouch ). live plants no good in the long run as they will either get uprooted all the time,or,eaten.