login
Number of intersections of diagonals in the interior of a regular p-gon where p is the n-th prime.
1

%I #40 Sep 08 2022 08:46:14

%S 0,0,5,35,330,715,2380,3876,8855,23751,31465,66045,101270,123410,

%T 178365,292825,455126,521855,766480,971635,1088430,1502501,1837620,

%U 2441626,3464840,4082925,4421275,5160610,5563251,6438740,10334625,11716640,14043870

%N Number of intersections of diagonals in the interior of a regular p-gon where p is the n-th prime.

%C This is binomial(prime(n),4). - _N. J. A. Sloane_, May 17 2020

%C Subsequence of A006561.

%C a(n) = prime(n) only for n = 3.

%H Harvey P. Dale, <a href="/A262248/b262248.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = (prime(n)^4 - 6*prime(n)^3 + 11*prime(n)^2 - 6*prime(n))/24.

%F a(n) = A006561(A000040(n)).

%e For prime(2)=3, there is no intersection of diagonals in the interior of a regular triangle, so a(2)=0.

%t Table[(Prime[n]^4 - 6 (Prime[n]^3) + 11 Prime[n]^2 - 6 Prime[n])/24, {n, 50}] (* _Vincenzo Librandi_, Sep 17 2015 *)

%t (#^4-6#^3+11#^2-6#)/24&/@Prime[Range[40]] (* _Harvey P. Dale_, Jun 17 2022 *)

%o (PARI) a(n) = my(p=prime(n)); p*(p^3 - 6*p^2 + 11*p - 6)/24;

%o vector(40, n, a(n))

%o (Magma) [(NthPrime(n)^4-6*(NthPrime(n)^3)+11*NthPrime(n)^2- 6*NthPrime(n))/24: n in [1..40]]; // _Vincenzo Librandi_, Sep 17 2015

%Y Cf. A006561, A006600, A007569, A126995.

%K nonn,easy

%O 1,3

%A _Altug Alkan_, Sep 16 2015