30% of number A means
[tex]\dfrac{30A}{100}=\dfrac{3A}{10}[/tex]
similarly, 40% of number B means
[tex]\dfrac{40B}{100}=\dfrac{2B}{5}[/tex]
These must be equal, so we have
[tex]\dfrac{3A}{10}=\dfrac{2B}{5}[/tex]
Multiply both sides by 10 to get
[tex]3A=4B \iff A=\dfrac{4B}{3}[/tex]
So, you can choose any number for A, and then you multiply it by 4/3 to get B. There are infinitely many solutions to this equation.