OFFSET
1,2
COMMENTS
Consider a two-player game in which players take turns and a player given the position k = p_1^s_1 * ... * p_j^s_j must choose one of the j possible moves p_1 - 1, ..., p_j - 1, and the player's chosen move becomes the position given to the other player. The first player whose only possible move is 1 loses. Terms in this sequence are the winning positions for the player whose turn it is.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
Numbers of the form 2^k are not in the sequence because their unique prime divisor is p = 2 and p-1 = 1 is in the sequence.
Numbers of the form 3^k are in the sequence because 3-1 = 2 is not in the sequence.
Numbers of the form 5^k are in the sequence because 5-1 = 4 = 2^2, and 2 is not in the sequence.
MATHEMATICA
fa=FactorInteger; win[1] = True; win[n_] := win[n] = ! Union@Table[win[fa[n][[i, 1]] - 1], {i, 1, Length@fa@n}] == {True}; Select[Range[300], win]
PROG
(Haskell)
a227455 n = a227455_list !! (n-1)
a227455_list = 1 : f [2..] [1] where
f (v:vs) ws = if any (`notElem` ws) $ map (subtract 1) $ a027748_row v
then v : f vs (v : ws) else f vs ws
-- Reinhard Zumkeller, Dec 08 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Jul 12 2013
EXTENSIONS
Edited by Jon E. Schoenfield, Jan 23 2021
STATUS
approved