You could possibly compute the square root of your number. At least one prime factor of that number is smaller than the root.
Since you want to find the prime factors for 5 digits numbers, your biggest root will be √99,999= 316.22 - not a big deal because:
2 3 5 7 11 13 17 19 23 29
31 37 41 43 47 53 59 61 67 71
73 79 83 89 97 101 103 107 109 113
127 131 137 139 149 151 157 163 167 173
179 181 191 193 197 199 211 223 227 229
233 239 241 251 257 263 269 271 277 281
283 293 307 311 313 ...
There are only
65 prime numbers less than 316.22.
If you are lucky and your number ends up with 2, you will have to check only about √45000=212.1 ⇒47 numbers.
and if the number ends with 5, so just 34 numbers.
This method is not the most sophisticated one or efficient, but I believe it will be useful for your purposes.
-------------------------------------------------------------------------
For example: 61351
√61351=247 ⇒53 numbers to check...
not dividing: 2,3,5, 7,11,13,17,
dividing: 19
61351/19=3229
√3229=56.8⇒16 numbers to check, however we don't need to check 2,3,5, 7,11,13,17,
not dividing: 19 23 29
31 37 41 43 47 53
therefore: 19*3229=61351
Of course, doing the long divisions by hand is
not recommended.
I was lucky of choosing this number as said mfb,
If there is at most one large prime factor, trial division works reasonably well.