A025362 Numbers that are the sum of 4 nonzero squares in exactly 6 ways.
90, 124, 133, 147, 156, 157, 159, 163, 165, 166, 171, 174, 177, 188, 193, 201, 203, 205, 219, 239, 241, 249, 254, 260, 284, 293, 299, 329, 341, 360, 496, 624, 664, 696, 752, 1016, 1040, 1136, 1440, 1984, 2496, 2656, 2784, 3008, 4064, 4160, 4544, 5760, 7936
Offset: 1
Keywords
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..100 (terms 67..73 from Chai Wah Wu and terms n = 1..66 from Robert Price)
- Index entries for sequences related to sums of squares
Programs
-
Python
limit = 8000 from functools import lru_cache sq = [k**2 for k in range(1, int(limit**.5)+2) if k**2 + 3 <= limit] sqs = set(sq) @lru_cache(maxsize=None) def findsums(n, m): if m == 1: return {(n, )} if n in sqs else set() return set(tuple(sorted(t+(s,))) for s in sqs for t in findsums(n-s, m-1)) print([n for n in range(4, limit+1) if len(findsums(n, 4)) == 6]) # Michael S. Branicky, Apr 20 2021