It's too obvious for words that the census was not for God's benefit because - as you point out - God already knew the total number that would be arrived at.
There were three census counts, so this one needs to be dealt with for it was different to the other two. This one was to count all the eligible males to be used to fight. That is why no women or children were included, and only males of a certain age were to be counted. What would be the benefit to Moses and the Israelites to know the number, and why would God not just tell him?
First, those counted were all on one 'level', all equal, all included as a body of men. There was no individuality here. The count would remind them that they were a nation that had to band together with an army of fighting men, to go forward according to God's plan that they inhabit the Promised Land. This would remind them of what lay ahead and of teamwork that would be required.
Second, Moses and the others needed to organise themselves with this army, again, for what lay ahead. Although God had promised Abraham and themselves with that land, it was not going to be handed to them on a plate - as if God was getting them to think, "Well, I fought your battles for you to get you out of bondage in Egypt, and you can continue to sit back and see what I shall do for you." Although there was truth in that, also in how God did perform miracles when their army fought and they obeyed God's instructions (e.g. in how they saw the walls of Jericho come tumbling down), God knew the nation would need to develop a trained, experienced army. The census was the first step towards that. But the specifics would be written down, not just numbers, for family and tribal details needed to be known, to organise into units. God stating the total number would not enable all the details to be written down.
Third, God gets his people to mature in faith, and obedience to God is vital for that to happen. God did not tell Moses the number because Moses had work to do. He had to be seen leading the nation and carrying out God's instructions in order to do that. God is not a data-base we can consult by asking him questions that he will obligingly answer for us. He does not have to prove anything to us! He's not out to convince us that he "knows it all"! We are the ones who need to learn to know him, and we do that by being obedient to his directions and commands. When David took a census that was against God's will, there were dreadful consequences.
You may find helpful information on this, from the Israeli point of view, at this link: https://www.chabad.org/search/keyword.asp?kid=13860&page=2&jewish=Census-of-the-Israelites.htm