OFFSET
1,2
LINKS
Klaus Brockhaus, Table of n, a(n) for n = 1..4944
Eric Weisstein's World of Mathematics, B2-Sequence
EXAMPLE
36 is in the sequence since the pairwise sums of {1, 4, 9, 16, 25, 36} are all distinct: 2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, 34, 37, 40, 41, 45, 50, 52, 61, 72.
49 is not in the sequence since 1 + 49 = 25 + 25.
PROG
(Python)
from itertools import count, islice
def A062295_gen(): # generator of terms
aset1, aset2, alist = set(), set(), []
for k in (n**2 for n in count(1)):
bset2 = {k<<1}
if (k<<1) not in aset2:
for d in aset1:
if (m:=d+k) in aset2:
break
bset2.add(m)
else:
yield k
alist.append(k)
aset1.add(k)
aset2 |= bset2
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 02 2001
EXTENSIONS
Edited, corrected and extended by Klaus Brockhaus, Sep 24 2007
STATUS
approved