OFFSET
1,2
COMMENTS
Second quadrisection of natural numbers shifted right two places. - Ralf Stephan, Jun 10 2005
A permutation of the natural numbers partitioned into quadruples [4k-3,4k-1,4k,4k-2] for k > 0. Partition the natural number sequence into quadruples starting with (1,2,3,4); swap the second and third elements, then swap the third and fourth elements; repeat for all quadruples. - Guenther Schrack, Oct 18 2017
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
G.f.: x*(2*x^4 - 2*x^3 + x^2 + 2*x + 1)/((x-1)^2*(x+1)*(x^2+1)). - Colin Barker, Nov 08 2012
From Guenther Schrack, Oct 18 2017: (Start)
a(n) = a(n-4) + 4 for n > 4.
a(n) = n + periodic[0,1,1,-2].
a(n) = A292576(n) - 2*((-1)^floor(n/2)) for n > 0.
a(n+2) - a(n) = (-1)^floor(n^2/4)*A132400(n+1) for n > 0.
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5. (End)
a(n) = A298364(n-1) + 1 for n > 1. - Guenther Schrack, Feb 04 2018
MATHEMATICA
LinearRecurrence[{1, 0, 0, 1, -1}, {1, 3, 4, 2, 5}, 70] (* Harvey P. Dale, May 10 2014 *)
Table[Floor[(n - ((-1)^n + (-1)^(n (n - 1) / 2) (2 + (-1)^n)) / 2)], {n, 100}] (* Vincenzo Librandi, Feb 05 2018 *)
PROG
(MATLAB) a = [1 3 4 2];
max = 10000; % Generation of a b-file
for n := 5:max
a(n) = a(n-4) + 4;
end;
% Guenther Schrack, Oct 18 2017
(PARI) for(n=1, 10000, print1(n - ((-1)^n + (-1)^(n*(n-1)/2)*(2+(-1)^n))/2, ", ")) \\ Guenther Schrack, Oct 18 2017
(Magma) [Floor((n - ((-1)^n + (-1)^(n*(n-1)/2)*(2+(-1)^n)) / 2)): n in [1..100]]; // Vincenzo Librandi, Feb 05 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Knauth (knauth_jur(AT)yahoo.de), Nov 21 2003
STATUS
approved