The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A256008 Self-inverse permutation of positive integers: 4k+1 is swapped with 4k+3, and 4k+2 with 4k+4. 6
 3, 4, 1, 2, 7, 8, 5, 6, 11, 12, 9, 10, 15, 16, 13, 14, 19, 20, 17, 18, 23, 24, 21, 22, 27, 28, 25, 26, 31, 32, 29, 30, 35, 36, 33, 34, 39, 40, 37, 38, 43, 44, 41, 42, 47, 48, 45, 46, 51, 52, 49, 50, 55, 56, 53, 54, 59, 60, 57, 58, 63, 64, 61, 62, 67, 68, 65, 66, 71, 72, 69, 70, 75, 76, 73, 74, 79 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS A lexicographically minimal sequence of distinct positive integers such that a(n)*n + 1 is a square. The same condition without the requirement for a(n) to be distinct would produce A076942. LINKS Ivan Neretin, Table of n, a(n) for n = 1..10000 F. Michel Dekking, Jeffrey Shallit, and N. J. A. Sloane, Queens in exile: non-attacking queens on infinite chess boards, Electronic J. Combin., 27:1 (2020), #P1.52. Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1). FORMULA From Wesley Ivan Hurt, Oct 13 2015: (Start) G.f.: x*(3-2*x-x^2+2*x^3)/((x-1)^2*(x^2+1)). a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4) for n>4. a(n) = n-2*(-1)^((2*n+1-(-1)^n)/4). (End) a(n) = (-1+i)*((-i)^n+i*i^n)+n, where i = sqrt(-1). - Colin Barker, Oct 19 2015 MAPLE A256008:=n->n-2*(-1)^((2*n+1-(-1)^n)/4): seq(A256008(n), n=1..100); # Wesley Ivan Hurt, Oct 13 2015 MATHEMATICA Table[BitXor[n - 1, 2] + 1, {n, 77}] CoefficientList[Series[(3 - 2*x - x^2 + 2*x^3)/((x - 1)^2*(x^2 + 1)), {x, 0, 100}], x] (* Wesley Ivan Hurt, Oct 13 2015 *) LinearRecurrence[{2, -2, 2, -1}, {3, 4, 1, 2}, 80] (* Vincenzo Librandi, Oct 14 2015 *) PROG (PARI) a(n) = bitxor(n-1, 2)+1 \\ Charles R Greathouse IV, May 06 2015 (PARI) Vec(x*(3-2*x-x^2+2*x^3)/((x-1)^2*(x^2+1)) + O(x^100)) \\ Altug Alkan, Oct 13 2015 (PARI) a(n) = (-1+I)*((-I)^n+I*I^n)+n \\ Colin Barker, Oct 19 2015 (MAGMA) [n-2*(-1)^((2*n+1-(-1)^n) div 4): n in [1..100]]; // Wesley Ivan Hurt, Oct 13 2015 (MAGMA) I:=[3, 4, 1, 2]; [n le 4 select I[n] else 2*Self(n-1)-2*Self(n-2)+2*Self(n-3)-Self(n-4): n in [1..80]]; // Vincenzo Librandi, Oct 14 2015 (MAGMA) /* By definition: */ &cat[[4*k+3, 4*k+4, 4*k+1, 4*k+2]: k in [0..20]]; // Bruno Berselli, Oct 19 2015 CROSSREFS Cf. A076942, A269526. Sequence in context: A333454 A021971 A260822 * A171073 A021297 A124909 Adjacent sequences:  A256005 A256006 A256007 * A256009 A256010 A256011 KEYWORD nonn,easy AUTHOR Ivan Neretin, May 06 2015 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 13 00:57 EDT 2021. Contains 344980 sequences. (Running on oeis4.)