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.

A224839 a(1) = 1 and a(n) is the smallest number greater than a(n-1) with no square difference with any preceding term.

Original entry on oeis.org

1, 3, 6, 8, 11, 13, 16, 18, 21, 23, 35, 40, 45, 53, 58, 63, 66, 68, 73, 86, 96, 110, 120, 125, 128, 131, 133, 138, 143, 148, 151, 171, 178, 181, 183, 188, 193, 198, 205, 211, 216, 239, 244, 250, 256, 258, 261, 263, 268, 273
Offset: 1

Views

Author

Jean-François Alcover, Sep 18 2013

Keywords

Comments

The first 11 terms are identical to those of A210570.
This sequence represents the losing positions in the misère version of a one-heap nim game, where players remove a square number of objects (> 0) on their turn. - Kiran Ananthpur Bacche, Feb 23 2025

Crossrefs

Programs

  • Haskell
    a224839 n = a224839_list !! (n-1)
    a224839_list = f [1..] [] where
       f (x:xs) ys = if all ((== 0) . a010052) $ map (x -) ys
                        then x : f xs (x:ys) else f xs ys
    -- Reinhard Zumkeller, May 02 2014
  • Maple
    N:= 1000: # to get all terms <= N
    V:= Vector(N):
    Res:= NULL:
    for m from 1 to N do
      if V[m] = 0 then
        V[m]:= 1;
        Res:= Res, m;
        for k from 1 to floor(sqrt(N-m)) do V[m+k^2]:= 1 od:
      fi
    od:
    Res; # Robert Israel, Nov 30 2016
  • Mathematica
    a[1] = 1; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[FreeQ[k - Array[a, n-1], d_ /; IntegerQ[Sqrt[d]]], Return[k]]]; Table[a[n], {n, 1, 40}]

Formula

a(n) >= A210570(n) by definition of the latter. - Charles R Greathouse IV, Nov 28 2024
a(n) = A030193(n-1) + 1. - Kiran Ananthpur Bacche, Feb 23 2025