OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
MATHEMATICA
A023531[n_]:= SquaresR[1, 8*n+9]/2;
p[n_]:= If[n==1, 1, Prime[n-1]];
a[n_]:= Sum[A023531[j]*p[n-j+1], {j, Floor[(n+1)/2]}];
Table[a[n], {n, 60}] (* G. C. Greubel, Jan 19 2022 *)
PROG
(Magma)
A023531:= func< n | IsIntegral( (Sqrt(8*n+9) -3)/2 ) select 1 else 0 >;
p:= func< n | n eq 1 select 1 else NthPrime(n-1) >;
[ (&+[A023531(j)*p(n-j+1): j in [1..Floor((n+1)/2)]]) : n in [1..60]]; // G. C. Greubel, Jan 19 2022
(Sage)
def A023531(n):
if ((sqrt(8*n+9) -3)/2).is_integer(): return 1
else: return 0
def p(n):
if (n==1): return 1
else: return nth_prime(n-1)
[sum( A023531(j)*p(n-j+1) for j in (1..floor((n+1)/2)) ) for n in (1..60)] # G. C. Greubel, Jan 19 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved