|
|
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
|
|
|
FORMULA
|
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
|
|
|
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) 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
(Python)
def a(n): return ((n-1)^2) + 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|