cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A192447 a(n) = n*(n-1)/2 if this is even, otherwise (n*(n-1)/2) + 1.

This page as a plain text file.
%I A192447 #38 Dec 15 2024 07:25:21
%S A192447 0,2,4,6,10,16,22,28,36,46,56,66,78,92,106,120,136,154,172,190,210,
%T A192447 232,254,276,300,326,352,378,406,436,466,496,528,562,596,630,666,704,
%U A192447 742,780,820,862,904,946,990,1036,1082,1128,1176,1226,1276,1326,1378,1432
%N A192447 a(n) = n*(n-1)/2 if this is even, otherwise (n*(n-1)/2) + 1.
%C A192447 Least number of swaps of passports of n persons so that each two have swapped at least once and finally each one gets his own passport (JBMO 2011 Shortlist).
%H A192447 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-4,4,-3,1).
%F A192447 a(n) = n*(n-1)/2 if this is even and a(n) = (n*(n-1)/2) + 1 otherwise.
%F A192447 a(n) = 2*A054925(n).
%F A192447 G.f.: 2*x*(x^2 - x + 1)/((1 - x)^3*(1 + x^2)).
%F A192447 a(n) = (n^2 - n + 1 - (-1)^(n*(n-1)/2))/2. - _Guenther Schrack_, Jun 04 2019
%F A192447 Sum_{n>=2} 1/a(n) = 2 - Pi/2 + Pi*sinh(sqrt(7)*Pi/4)/(sqrt(7)*(1/sqrt(2) + cosh(sqrt(7)*Pi/4))). - _Amiram Eldar_, Dec 14 2024
%F A192447 a(n) = 2*(A213484(n+1) - 1)/3 = (A373584(n) - 1)/3. - _Hugo Pfoertner_, Dec 15 2024
%e A192447 a(3) = 4: Let the initial state be Aa, Bb, Cc. Swap(AB) to get Ab, Ba, Cc. Swap(AC) to get Ac, Ba, Cb. Swap(BC) to get Ac, Bb, Ca. Swap(AC) to get Aa, Bb, Cc, done.
%t A192447 Table[(n^2 - n + 1 - (-1)^(n (n - 1)/2))/2, {n, 1, 60}] (* _Bruno Berselli_, Jun 07 2019 *)
%t A192447 LinearRecurrence[{3,-4,4,-3,1}, {0,2,4,6,10}, 54] (* _Georg Fischer_, Oct 26 2020 *)
%o A192447 (PARI) a(n) = my(m=n*(n-1)/2); if (m % 2, m+1, m); \\ _Michel Marcus_, Jun 07 2019
%Y A192447 Equals the corresponding term of A000217 if it is even or is 1 more otherwise.
%Y A192447 Cf. A054925, A213484, A373584.
%K A192447 nonn,easy
%O A192447 1,2
%A A192447 _Ivaylo Kortezov_, Jul 01 2011