login
A262248
Number of intersections of diagonals in the interior of a regular p-gon where p is the n-th prime.
1
0, 0, 5, 35, 330, 715, 2380, 3876, 8855, 23751, 31465, 66045, 101270, 123410, 178365, 292825, 455126, 521855, 766480, 971635, 1088430, 1502501, 1837620, 2441626, 3464840, 4082925, 4421275, 5160610, 5563251, 6438740, 10334625, 11716640, 14043870
OFFSET
1,3
COMMENTS
This is binomial(prime(n),4). - N. J. A. Sloane, May 17 2020
Subsequence of A006561.
a(n) = prime(n) only for n = 3.
LINKS
FORMULA
a(n) = (prime(n)^4 - 6*prime(n)^3 + 11*prime(n)^2 - 6*prime(n))/24.
a(n) = A006561(A000040(n)).
EXAMPLE
For prime(2)=3, there is no intersection of diagonals in the interior of a regular triangle, so a(2)=0.
MATHEMATICA
Table[(Prime[n]^4 - 6 (Prime[n]^3) + 11 Prime[n]^2 - 6 Prime[n])/24, {n, 50}] (* Vincenzo Librandi, Sep 17 2015 *)
(#^4-6#^3+11#^2-6#)/24&/@Prime[Range[40]] (* Harvey P. Dale, Jun 17 2022 *)
PROG
(PARI) a(n) = my(p=prime(n)); p*(p^3 - 6*p^2 + 11*p - 6)/24;
vector(40, n, a(n))
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Sep 16 2015
STATUS
approved