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.

A030193 Let S = squares; a(0)=0; a(n) = smallest m such that m - a(i) is not in S for any i < n.

Original entry on oeis.org

0, 2, 5, 7, 10, 12, 15, 17, 20, 22, 34, 39, 44, 52, 57, 62, 65, 67, 72, 85, 95, 109, 119, 124, 127, 130, 132, 137, 142, 147, 150, 170, 177, 180, 182, 187, 192, 197, 204, 210, 215, 238, 243, 249, 255, 257, 260, 262, 267
Offset: 0

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 perfect square from the number on the board, the player who faces 0 loses. This sequence is the set of losing positions in this game. - Mikhail Dvorkin (mikhail.dvorkin(AT)gmail.com), Jan 27 2008
This sequence was investigated by Golomb (1966), who proved that it is infinite. More strongly (as Ruzsa 1984 notes) the number of values up to any given n is at least proportional to sqrt(n). No two numbers in this sequence differ by a square, and this sequence can be defined as the lexicographically first (greedy) sequence with no square differences. It follows from the Furstenberg-Sárközy theorem (e.g., see Sárközy 1978) that its natural density is zero. - David Eppstein, Nov 20 2016

Crossrefs

Programs

  • Mathematica
    moves[n_] := Table[n - i^2, {i, 1, Sqrt[n]}]; gana[n_] := Which[n == 0, False, True,!Select[moves[n], !gana[#] &] =={}]; Select[Range[155] - 1, ! gana[#] &] (* José María Grau Ribas, Jul 19 2013 *)
    Nest[Append[#, Block[{k = Last[#]}, While[AnyTrue[k - #, IntegerQ@ Sqrt@ # &], k++]; k]] &, {0}, 48] (* Michael De Vlieger, Jul 11 2018 *)

Extensions

More terms from Karl W. Heuer, Jun 13 2013