OFFSET
0,3
COMMENTS
From a question by Jonathan Vos Post dated Jul 09 2013, the indices of a(n) which are prime begin: 2, 3, 5, 7, 11, 41, 111, 205, 211, 215, 341, 345, 395, 581, 585, 1221, ..., . - Robert G. Wilson v, Jul 10 2013
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..1000
EXAMPLE
a(2) = 2 + 1*0 = 2.
a(3) = 3 + 2*1 = 5.
a(9) = 9 + 8*7 + 6*5*4 + 3*2*1*0 = 9 + 56 + 120 = 185.
a(11) = 11 + 10*9 + 8*7*6 + 5*4*3*2 = 557.
a(18) = 18 + 17*16 + 15*14*13 + 12*11*10*9 + 8*7*6*5*4 = 21620.
MATHEMATICA
f[n_] := Sum[ Product[ n - k (k - 1)/2 - i + 1, {i, k}], {k, Sqrt[ 2n]}]; Array[f, 39, 0] (* Robert G. Wilson v, Jul 10 2013 *)
PROG
(Python)
for n in range(55):
sum = i = 0
k = 1
while i<=n:
product = 1
for x in range(k):
product *= n-i
i += 1
if i>n: break
sum += product
k += 1
print(str(sum), end=', ')
(PARI) a(n)=sum(k=1, sqrtint(2*n)+1, prod(i=1, k, max(n-k*(k-1)/2-i+1, 0))) \\ Charles R Greathouse IV, Jul 09 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Jul 07 2013
STATUS
approved