OFFSET
1,1
COMMENTS
EXAMPLE
a(1) = 6 = 1^2 + 5*1^2 is the least number that can be written as A+5B where A,B are positive squares.
a(2) = 9 = 2^2 + 5*1^2 is the second smallest number that can be written in this way.
MATHEMATICA
formQ[n_] := Reduce[a > 0 && b > 0 && n == a^2 + 5 b^2, {a, b}, Integers] =!= False; Select[ Range[300], formQ] (* Jean-François Alcover, Sep 20 2011 *)
Timing[mx = 300; limx = Sqrt[mx]; limy = Sqrt[mx/5]; Select[Union[Flatten[Table[x^2 + 5 y^2, {x, limx}, {y, limy}]]], # <= mx &]] (* T. D. Noe, Sep 20 2011 *)
PROG
(PARI) isA154778(n, /* use optional 2nd arg to get other analogous sequences */c=5) = { for( b=1, sqrtint((n-1)\c), issquare(n-c*b^2) & return(1))}
for( n=1, 300, isA154778(n) & print1(n", "))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
M. F. Hasler, Jan 24 2009
STATUS
approved