login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A263449
Permutation of the natural numbers: [4k+1, 4k+4, 4k+3, 4k+2, ...].
3
1, 4, 3, 2, 5, 8, 7, 6, 9, 12, 11, 10, 13, 16, 15, 14, 17, 20, 19, 18, 21, 24, 23, 22, 25, 28, 27, 26, 29, 32, 31, 30, 33, 36, 35, 34, 37, 40, 39, 38, 41, 44, 43, 42, 45, 48, 47, 46, 49, 52, 51, 50, 53, 56, 55, 54, 57, 60, 59, 58, 61, 64, 63, 62, 65, 68, 67
OFFSET
0,2
COMMENTS
From Franklin T. Adams-Watters, Jul 13 2017: (Start)
For this to be a permutation, it should have offset one, not zero.
With offset 1, a(n) is the smallest positive integer == n (mod 2) with a(n) != a(n-1) + 1. (End)
FORMULA
G.f.: (1+2*x-3*x^2+2*x^3)/((x-1)^2*(1+x^2)).
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4) for n>3.
a(n) = n+1+(1-(-1)^n)*(-1)^(n*(n-1)/2).
a(2n) = A005408(n), a(2n+1) = 2*A014681(n+1).
a(n) = n+1+i*((-i)^n-i^n), where i=sqrt(-1). - Colin Barker, Oct 27 2015
a(n) = 4*ceiling(n/4) - (n mod 4) + 1. - Wesley Ivan Hurt, Nov 07 2015
Sum_{n>=0} (-1)^n/a(n) = log(2) (A002162). - Amiram Eldar, Nov 28 2023
MAPLE
A263449:=n->n+1+(1-(-1)^n)*(-1)^(n*(n-1)/2): seq(A263449(n), n=0..100);
MATHEMATICA
Table[n + 1 + (1 - (-1)^n) (-1)^(n (n - 1)/2), {n, 0, 100}] (* or *) LinearRecurrence[{2, -2, 2, -1}, {1, 4, 3, 2}, 70]
PROG
(Magma) [n+1+(1-(-1)^n)*(-1)^(n*(n-1) div 4) : n in [0..100]];
(Magma) /* By definition: */ &cat[[4*k+1, 4*k+4, 4*k+3, 4*k+2]: k in [0..20]]; // Bruno Berselli, Oct 19 2015
(PARI) Vec((1+2*x-3*x^2+2*x^3)/((x-1)^2*(1+x^2)) + O(x^100)) \\ Altug Alkan, Oct 19 2015
(PARI) a(n) = n+1+I*((-I)^n-I^n) \\ Colin Barker, Oct 27 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 18 2015
STATUS
approved