OFFSET
1,2
COMMENTS
A permutation of the positive integers, swapping consecutive values congruent to 3 and 4 (mod 4). - Franklin T. Adams-Watters, Jan 22 2012.
This is the lexicographically earliest sequence of distinct positive integers such that no polynomial of degree d can be fitted to d+2 consecutive terms (equivalently, such that no iterated difference is zero). - Pontus von Brömssen, Dec 26 2021
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
From Chai Wah Wu, Sep 10 2020: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: x*(x^4 - x^3 + 2*x^2 + x + 1)/(x^5 - x^4 - x + 1). (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 - log(2)/2. - Amiram Eldar, Jan 31 2023
MATHEMATICA
Table[Which[Mod[n, 4]==3, n+1, Divisible[n, 4], n-1, True, n], {n, 40}] (* or *) Partition[Range[40], 4]/.{a_, b_, c_, d_}->{a, b, d, c}//Flatten (* Harvey P. Dale, Aug 29 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, Oct 15 2007
EXTENSIONS
Definition fixed and offset changed by Franklin T. Adams-Watters, Jan 22 2012
STATUS
approved