Square-Cube Digit Usage

05AB1E, 14 12 13 bytes

-2 bytes thanks to @KevinCruijssen

+1 byte thanks to @Grimmy

∞.Δ23SmJœIÅ?Z

Try it online!


Explanation

∞.Δ                  - First number that... 
   23Sm              - Power of 2 and 3 [n^2, n^3] 
       J             - Concatenated
        œ            - Permutations of this number
         IÅ?Z        - any of these start with the number 

By the way it's quite slow...


Python 3, 78 bytes

f=lambda s,n=1:n*all(f'{n*n}{n**3}'.count(i)>=s.count(i)for i in s)or f(s,n+1)

Try it online!


Python 2, 82 \$\cdots\$78 77 bytes

Added 2 bytes to fix an error kindly pointed out by S.S. Anne.
Switched to Python 2 thanks to Grimmy.
Saved a byte thanks to Arnauld!!!

f=lambda s,i=1:i*all((`i*i`+`i**3`).count(c)/s.count(c)for c in s)or f(s,i+1)

Try it online!

Tags:

Math

Code Golf