cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A227691 Winning positions in the Subtract-a-Prime game.

This page as a plain text file.
%I A227691 #13 Nov 13 2013 12:44:40
%S A227691 2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,29,
%T A227691 30,31,32,33,36,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,56,
%U A227691 57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74
%N A227691 Winning positions in the Subtract-a-Prime game.
%C A227691 Consider the following game: two players make moves in turn, initially the number on the board is n. Each move consists of subtracting a prime number that is at most the number on the board. The player who cannot play loses. This sequence is the set of winner positions in this game.
%C A227691 Complement of A025043.
%t A227691 moves[n_] := Table[n - Prime[i], {i, 1, PrimePi[n]}]
%t A227691 gana[n_] := gana[n] = If[n < 2, False,! Select[moves[n],!gana[#] &] == {}];
%t A227691 Select[Range[155], gana[#] &]
%o A227691 (PARI) is(n)=if(isprime(n) || isprime(n-1), return(1)); if(n<15,return(0)); for(k=9,n-1,if(isprime(n-k) && !is(k), return(1))); 0 \\ _Charles R Greathouse IV_, Nov 13 2013
%Y A227691 The Grundy numbers of this game are in A014589.
%K A227691 nonn
%O A227691 1,1
%A A227691 _José María Grau Ribas_, Jul 19 2013