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.

Showing 1-4 of 4 results.

A227455 Sequence defined recursively: 1 is in the sequence, and k > 1 is in the sequence iff for some prime divisor p of k, p-1 is not in the sequence.

Original entry on oeis.org

1, 3, 5, 6, 9, 10, 12, 15, 17, 18, 20, 21, 23, 24, 25, 27, 29, 30, 33, 34, 35, 36, 39, 40, 42, 45, 46, 48, 50, 51, 53, 54, 55, 57, 58, 60, 63, 65, 66, 68, 69, 70, 72, 75, 78, 80, 81, 83, 84, 85, 87, 89, 90, 92, 93, 95, 96, 99, 100, 102, 105, 106, 108, 110
Offset: 1

Views

Author

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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
  • 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]

Extensions

Edited by Jon E. Schoenfield, Jan 23 2021

A227763 Winning positions in the misere version of the Subtract-a-Prime game.

Original entry on oeis.org

1, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75
Offset: 1

Views

Author

Keywords

Comments

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 wins. This sequence is the set of winning positions in this game.

Crossrefs

Programs

  • Mathematica
    moves[n_]:= Table[n - Prime[i], {i, 1, PrimePi[n]}]; gana[n_]:= gana[n] = If[n < 2, True, !Select[moves[n], !gana[#]&]=={}]; Select[Range[155], gana[#] &]

A227764 Losing positions in the misere version of the Subtract-a-Prime game.

Original entry on oeis.org

2, 3, 11, 12, 27, 36, 37, 51, 57, 87, 93, 102, 117, 123, 127, 135, 147, 157, 171, 177, 189, 197, 207, 219, 237, 249, 255, 261, 267, 291, 297, 303, 311, 312, 321, 327, 337, 345, 357, 363, 377, 387, 393, 397, 405, 417, 427, 447, 453, 471, 477, 483, 487, 495
Offset: 1

Views

Author

Keywords

Comments

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 wins. This sequence is the set of lost positions in this game.

Crossrefs

Programs

  • Mathematica
    moves[n_] := Table[n - Prime[i], {i, 1, PrimePi[n]}]; gana[n_] := gana[n] = If[n < 2, True, ! Select[moves[n], !gana[#] &] == {}]; Select[Range[155], !gana[#] &]

A340780 Losing positions n (P-positions) in the following game: two players take turns dividing the current value of n by either a prime power > 1 or by A007947(n) to obtain the new value of n. The winner is the player whose division results in 1.

Original entry on oeis.org

1, 12, 18, 20, 28, 44, 45, 50, 52, 63, 68, 75, 76, 92, 98, 99, 116, 117, 120, 124, 147, 148, 153, 164, 168, 171, 172, 175, 188, 207, 212, 216, 236, 242, 244, 245, 261, 264, 268, 270, 275, 279, 280, 284, 292, 312, 316, 325, 332, 333, 338, 356, 363, 369, 378, 387, 388
Offset: 1

Views

Author

Keywords

Comments

The game is equivalent to the game of Nim with the additional allowed move consisting of removing one object from each pile.

Crossrefs

Programs

  • Mathematica
    Clear[moves,los]; A003557[n_]:= {Module[{aux = FactorInteger[n], L=Length[FactorInteger[n]]},Product[aux[[i,1]]^(aux[[i, 2]]-1),{i, L}]]};
    moves[n_] :=moves[n] = Module[{aux = FactorInteger[n], L=Length[ FactorInteger [n]]}, Union[Flatten[Table[n/aux[[i,1]]^j, {i,1,L},{j,1,aux[[i,2]]}],1], A003557[n]]]; los[1]=True; los[m_] := los[m] = If[PrimeQ[m], False, Union@Flatten@Table[los[moves[m][[i]]], {i,1,Length[moves[m]]}] == {False}]; Select[Range[400], los]
Showing 1-4 of 4 results.