OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
N:= 10000: # to get all terms <= N
S[2]:= {}: S[3]:= {}: S[5]:= {}:
for a from 1 to floor(sqrt(N)) do
for k in [2, 3, 5] do
S[k]:= S[k] union {seq(a^2 + k*b^2, b = 1 .. floor(sqrt((N-a^2)/k)))}
od
od:
R:= S[2] intersect S[3] intersect S[5]:
sort(convert(R, list)); # Robert Israel, Jul 11 2018
PROG
(PARI) isA155708(n, /* optional 2nd arg allows us to get other sequences */c=[5, 3, 2]) = { for(i=1, #c, for(b=1, sqrtint((n-1)\c[i]), issquare(n-c[i]*b^2) & next(2)); return); 1}
for(n=1, 9999, isA155708(n) & print1(n", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Feb 10 2009
STATUS
approved