OFFSET
1,1
COMMENTS
Subsequence of A020670 (which allows for a and b to be zero).
If N=a^2+7*b^2 is a term then 7*N=(7*b)^2+7*a^2 is also a term. Conversely,if 7*N is a term then N is a term. Example: N=56; N/7=8 is a term, N*7=7^2+7*7^2 is a term. Sequences A154777, A092572 and A154778 have the same property with 7 replaced by prime numbers 2,3 and 5 respectively. - Jerzy R Borysowicz, May 22 2020
MATHEMATICA
Select[Range[300], Reduce[a>0 && b>0 && # == a^2 + 7b^2, {a, b}, Integers] =!= False&] (* Jean-François Alcover, Nov 17 2016 *)
PROG
(PARI) isA155717(n, /* optional 2nd arg allows us to get other sequences */c=7) = { for(b=1, sqrtint((n-1)\c), issquare(n-c*b^2) & return(1))}
for( n=1, 300, isA155717(n) & print1(n", "))
(Python)
def aupto(limit):
cands = range(1, int(limit**.5)+2)
nums = [a**2 + 7*b**2 for a in cands for b in cands]
return sorted(set(k for k in nums if k <= limit))
print(aupto(268)) # Michael S. Branicky, Aug 11 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
M. F. Hasler, Jan 25 2009
STATUS
approved