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
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
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