A277617 Lexicographically earliest positive sequence such that a(n+1)-a(n) is a square > 1 and no number occurs twice; a(1) = 1.
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
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,0,0,0,0,1,-1).
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)
Comments