You see two boxes and you can either take both boxes, or take only box B. Box A is transparent and contains $1000. Box B contains a visible number, say 1033. The Bank of Omega, which operates by very clear and transparent mechanisms, will pay you $1M if this number is prime, and $0 if it is composite. Omega is known to select prime numbers for Box B whenever Omega predicts that you will take only Box B; and conversely select composite numbers if Omega predicts that you will take both boxes. Omega has previously predicted correctly in 99.9% of cases.
Separately, the Numerical Lottery has randomly selected 1033 and is displaying this number on a screen nearby. The Lottery Bank, likewise operating by a clear known mechanism, will pay you $2 million if it has selected a composite number, and otherwise pay you $0. (This event will take place regardless of whether you take only B or both boxes, and both the Bank of Omega and the Lottery Bank will carry out their payment processes - you don't have to choose one game or the other.)
You previously played the game with Omega and the Numerical Lottery a few thousand times before you ran across this case where Omega's number and the Lottery number were the same, so this event is not suspicious.
Omega also knew the Lottery number before you saw it, and while making its prediction, and Omega likewise predicts correctly in 99.9% of the cases where the Lottery number happens to match Omega's number. (Omega's number is chosen independently of the lottery number, however.)
You have two minutes to make a decision, you don't have a calculator, and if you try to factor the number you will be run over by the trolley from the Ultimate Trolley Problem.
Do you take only box B, or both boxes?
Primes less than sqrt(1033) for which I know of no really obvious tricks (i.e. the digit adding tricks for them aren't so simple one can trivially do them in your head): 7, 13, 17, 19, 23, 29, 31
Also, since the scenario said we've done this many times and we haven't been trolleyed yet, it can't be all that easy to get trolleyed.
(eta: why the -1? Both points seem solid to me, even in the light of the additional trick below - there are several possible factors remaining, and it's not like I was enumerating these during my 2 minutes. Moreover, the 1001 trick works for 1033, but doesn't help so much with other typical numbers of that general magnitude - say, 1537, that it's something you're liable to do by accident)
Maybe you get run over by the trolley only if you try to factor Omega's number, and all the times before this Omega's number and the lottery number were different, and there's no much point in trying to factor the lottery number in that case since (assuming linear utility of money) it has no relevance on how many boxes you should take.