OFFSET
1,2
COMMENTS
a(n) is also the number of peaks in the largest Dyck path of the symmetric representation of sigma of the n-th prime (see example and A237593).
EXAMPLE
Illustration of a(6) = 4:
.
. _ _ _ _ _ _ _ 7
. |_ _ _ _ _ _ _|
. |
. |_ _ 0
. |_ 0
. |
. |_ _ _ 7
. | |
. | |
. | |
. | |
| |
| |
|_|
.
For n = 6 the 6th prime is A000040(6) = 13. Then we have that the (13 - 1)th = 12th row of triangle A237593 is [7, 2, 2, 1, 1, 2, 2, 7] and the 13th row of the same triangle is [7, 3, 2, 1, 1, 2, 3, 7], so the diagram of the symmetric representation of sigma(13) is constructed in the first quadrant as shown above. Note that the diagram has two parts and the total number of cells is 7 + 7 = 14, equaling the sum of the divisors of 13 (sigma(13) = 1 + 13 = 14). We can see that the largest Dyck path of the diagram has four peaks, so a(6) = 4.
On the other hand there are four nonzero triangular numbers <= 13, they are 1, 3, 6 and 10, so a(6) = 4.
PROG
(PARI) a(n) = sum(k=1, prime(n), ispolygonal(k, 3)); \\ Michel Marcus, Aug 01 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Jul 22 2018
STATUS
approved