As wedifrid said, this is approximately transparent Newcomb plus distractions. Given Eliezer’s clarifications (Omega knows the lottery numbers and is accurate even when the Omega and lottery numbers match), I’ll ask how two algorithms would perform against Omega: OneBoxBot, which always one-boxes, and ConditionalBot, which one-boxes unless the lottery and Omega numbers match, in which case it two-boxes. I’ll ignore the tiny error rates in computing payoffs.
Case 1: the lottery is going to output a prime number.
Against OneBoxBot, Omega delivers a prime number, which may or may not match the lottery number. OneBoxBot gets a payoff of $1MM.
Against ConditionalBot, Omega must deliver a prime number different from the lottery number (if it matched the lottery Omega would be handing over a prime number with a predicted response of two-boxing from Conditional). So ConditionalBot one-boxes and gets a payoff of $1MM.
Case 2: the lottery will output a composite number.
OneBoxBot will one-box, so Omega must provide it with a prime number (which will not match the lottery). So OneBoxBot gets a payoff of $3MM every time the lottery randomly outputs a composite number.
Against ConditionalBot, Omega has two choices. It could deliver a prime number which does not match the lottery. This would lead ConditionalBot to one-box and get a total payoff of $3MM, the same as OneBoxBot. Alternatively, Omega could match the composite lottery number, leading ConditionalBot to two-box and get a payoff of $2,001,000, $999,000 worse than OneBoxBot’s payoff.
So: both algorithms receive lottery wins with equal frequency, OneBoxBot always performs at least as well as ConditionalBot across the possibilities, and ConditionalBot performs worse when the lottery outputs a composite and Omega chooses to match it. Thus we should not adopt ConditionalBot over OneBoxBot and should one-box faced with the Ultimate Newcomb problem.
There is a big and implicit step that is worth explicating here, because most people who first approach Newcomb-like problems miss it completely:
TREAT HUMANS AS BOTS
By a bot I mean an algorithm, of course. An algorithm Omega can analyze for all possible combination of inputs.
That this step is valid follows from the problem's stipulation that Omega can predict your actions. In other words, it knows your output for any combination of inputs it cares to give you.
Whether Omega does this by running your algorithm in a sandbox or by analyzing your code does not... (read more)
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?