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.

A277617 Lexicographically earliest positive sequence such that a(n+1)-a(n) is a square > 1 and no number occurs twice; a(1) = 1.

Original entry on oeis.org

1, 5, 9, 13, 4, 8, 12, 3, 7, 11, 2, 6, 10, 14, 18, 22, 26, 17, 21, 25, 16, 20, 24, 15, 19, 23, 27, 31, 35, 39, 30, 34, 38, 29, 33, 37, 28, 32, 36, 40, 44, 48, 52, 43, 47, 51, 42, 46, 50, 41, 45, 49, 53, 57, 61, 65, 56, 60, 64, 55, 59, 63, 54, 58, 62, 66, 70, 74, 78, 69, 73, 77, 68, 72, 76, 67, 71, 75, 79, 83, 87, 91, 82, 86, 90, 81, 85, 89, 80, 84, 88
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Oct 23 2016

Keywords

Comments

A variant of A277616, which is defined in the same way but starts with a(0) = 0.
Another variant is A277618, which is defined in a similar way, but with primes instead of squares. (The strictly positive variant is A065186.)

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1}, {1, 5, 9, 13, 4, 8, 12, 3, 7, 11, 2, 6, 10, 14}, 100] (* Paolo Xausa, Jan 16 2025 *)
  • PARI
    {u=[a=1];(chk(n)=(!#u||(n>u[1]&&!setsearch(u,n)))&&(u=setunion(u,[n]))&&!while(#u>1&&u[2]==u[1]+1,u=u[^1]));for(n=1,99,print1(a",");for(k=-sqrtint(a+!a-1),9e9,k^2>1||next;chk(a+k*abs(k))||next;a+=k*abs(k);break))}

Formula

From Chai Wah Wu, Mar 30 2023: (Start)
a(n) = a(n-1) + a(n-13) - a(n-14) for n > 14.
G.f.: x*(3*x^13 + 4*x^12 + 4*x^11 - 9*x^10 + 4*x^9 + 4*x^8 - 9*x^7 + 4*x^6 + 4*x^5 - 9*x^4 + 4*x^3 + 4*x^2 + 4*x + 1)/(x^14 - x^13 - x + 1). (End)