login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A135538 Number of triples in all permutations of order n that are collinear modulo n. 3

%I #14 Oct 18 2016 14:54:14

%S 0,0,0,6,32,400,2304,35280,322560,3888000,48384000,731808000,

%T 9858723840,161902540800,2628760780800,43181994240000,876764528640000,

%U 16124496740352000,358721232629760000,6933770723303424000,168738115888742400000,3644128675321085952000,94201965756599500800000

%N Number of triples in all permutations of order n that are collinear modulo n.

%H Alois P. Heinz, <a href="/A135538/b135538.txt">Table of n, a(n) for n = 0..400</a>

%H L. Li, <a href="http://arXiv.org/abs/0802.0572">Collinear triples in permutations</a>, arXiv:0802.0572 [math.CO], 2008.

%F For n>=3, a(n) = (n-3)! * A146557(n).

%e For example, in a permutation p=[5,2,4,3,1], a triple of points { (2,p(2)=2), (4,p(4)=3), (5,p(5)=1) } is collinear, since they are located on the line: x + 3*y == 3 (mod 5).

%t f[n_] := n*Sum[ Sum[ (n - i - j)*( n*GCD[i, j, n - i - j] - GCD[i, n] - GCD[j, n] - GCD[i + j, n] + 2 ) , {j, 1, n - i}] , {i, 1, n}]; Join[{0, 0, 0}, Table[(n - 3)!*f[n], {n, 3, 25}]] (* _G. C. Greubel_, Oct 18 2016 *)

%o (PARI) a(n) = if(n<3, 0, (n-3)! * n * sum(i=1,n, sum(j=1,n-i-1, (n-i-j) * (n*gcd([i,j,n-i-j]) - gcd(i,n) - gcd(j,n) - gcd(i+j,n) + 2) )))

%K nonn

%O 0,4

%A _R. J. Mathar_, Feb 22 2008, corrected Oct 24 2008

%E Edited and extended by _Max Alekseyev_, Oct 31 2008

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 08:22 EDT 2024. Contains 371236 sequences. (Running on oeis4.)