login
A155716
Numbers of the form N = a^2 + 6b^2 for some positive integers a,b.
20
7, 10, 15, 22, 25, 28, 31, 33, 40, 42, 49, 55, 58, 60, 63, 70, 73, 79, 87, 88, 90, 97, 100, 103, 105, 106, 112, 118, 121, 124, 127, 132, 135, 145, 150, 151, 154, 159, 160, 166, 168, 175, 177, 186, 193, 196, 198, 199, 202, 214, 217, 220, 223, 225, 231, 232, 240
OFFSET
1,1
COMMENTS
Subsequence of A002481 (which allows for a and b to be zero).
Primes are in A033199. - Bernard Schott, Sep 20 2019
LINKS
David A. Corneth, Table of n, a(n) for n = 1..17743 (terms <= 10^5)
MATHEMATICA
With[{upto=240}, Select[Union[#[[1]]^2+6#[[2]]^2&/@Tuples[ Range[Sqrt[ upto]], 2]], #<=upto&]] (* Harvey P. Dale, Aug 05 2016 *)
PROG
(PARI) isA155716(n, /* optional 2nd arg allows us to get other sequences */c=6) = { for(b=1, sqrtint((n-1)\c), issquare(n-c*b^2) & return(1))}
for( n=1, 999, isA155716(n) & print1(n", "))
(PARI) upto(n) = my(res=List()); for(i=1, sqrtint(n), for(j=1, sqrtint((n - i^2) \ 6), listput(res, i^2 + 6*j^2))); listsort(res, 1); res \\ David A. Corneth, Sep 18 2019
KEYWORD
easy,nonn
AUTHOR
M. F. Hasler, Jan 25 2009
STATUS
approved