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.

A296142 Triangle read by rows: first row is 2; given row k, define the elements of row k+1 as the (sorted) elements derived from row k by two recursion rules: (i.) if x is in row k, then (x+5)^2 is in row k+1; (ii.) if x^2 is in row k, then x is in row k+1.

Original entry on oeis.org

2, 49, 7, 2916, 54, 144, 8532241, 12, 2921, 3481, 22201, 72799221804516, 59, 149, 289, 8532246, 8561476, 12152196, 493106436, 5299726695343845803536039441, 17, 2926, 3486, 4096, 22206, 23716, 86436, 72799221804521, 72799307127001, 73298956913361, 147675989144401, 243153962155686481
Offset: 1

Views

Author

Jeremy F. Alm, Dec 05 2017

Keywords

Comments

Inspired by problem A1 on the 2017 William Lowell Putnam Mathematical Competition.
Every positive integer greater than one will appear, except the multiples of 5.
For k > 2, the number of terms in row k is at least the sum of the number of terms in rows k-1 and k-2.
3 shows up for the first time no later than row 104.

Examples

			First few rows are
  2;
  49;
  7, 2916;
  54, 144, 8532241;
  12, 2921, 3481, 22201, 72799221804516;
  59, 149, 289, 8532246, 8561476, 12152196, 493106436, 299726695343845803536039441;
  17, 2926, 3486, 4096, 22206, 23716, 86436, 72799221804521, 72799307127001, 73298956913361, 147675989144401, 243153962155686481, 28087103045340200593045577229687766576786428563667986916;
		

Programs

  • Mathematica
    NestList[Complement[DeleteDuplicates@ Join[# /. s_ /; IntegerQ@ Sqrt@ s :> Sqrt@ s, # /. k_ :> (k + 5)^2], #] &, {2}, 6] // Flatten (* Michael De Vlieger, Dec 06 2017 *)
  • PARI
    lista(nn) = my(row = [2], all = row); for (n=1, nn, row = concat(apply(x->(x+5)^2, row), apply(x->sqrtint(x), select(issquare, row))); all = concat(all, vecsort(row,,8));); all; \\ Michel Marcus, Oct 16 2023