OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
EXAMPLE
There are 3 triangular numbers between 9 and 27, namely 10, 15, 21. So a(3)=3.
MAPLE
b:= n-> floor((sqrt(n*8+1)-1)/2):
a:= n-> `if`(n<2, 0, b(n^3-1) -b(n^2)):
seq(a(n), n=0..100); # Alois P. Heinz, Aug 14 2014
PROG
(Python)
for n in range(60):
sq=n*n
cb=n**3
s = t = 0
while 1:
tn = t*(t+1)/2
if tn>sq and tn<cb: s+=1
elif tn>=cb: break
t+=1
print str(s)+', ',
(PARI) a(n) = sum(i=n^2+1, n^3-1, ispolygonal(i, 3)); \\ Michel Marcus, Aug 14 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Aug 13 2014
STATUS
approved