OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..138 (terms 1..95 from Robert Price)
Michael S. Branicky, Python program
Eric Weisstein's World of Mathematics, Square Number.
FORMULA
{n: A025428(n) = 1}. - R. J. Mathar, Jun 15 2018
A243148(a(n),4) = 1. - Alois P. Heinz, Feb 25 2019
MATHEMATICA
selQ[n_] := Length[ Select[ PowersRepresentations[n, 4, 2], Times @@ # != 0 &]] == 1; Reap[Do[If[selQ[n], Print[n]; Sow[n]], {n, 1, 2000}]][[2, 1]] (* Jean-François Alcover, Oct 03 2013 *)
b[n_, i_, k_, t_] := b[n, i, k, t] = If[n == 0, If[t == 0, 1, 0], If[i<1 || t<1, 0, b[n, i - 1, k, t] + If[i^2 > n, 0, b[n - i^2, i, k, t - 1]]]];
T[n_, k_] := b[n, Sqrt[n] // Floor, k, k];
Position[Table[T[n, 4], {n, 0, 2000}], 1] - 1 // Flatten (* Jean-François Alcover, Nov 06 2020, after Alois P. Heinz in A243148 *)
PROG
(Python) # see link for faster version
limit = 1664
from functools import lru_cache
sq = [k*k for k in range(1, int(limit**.5)+2) if k*k + 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 sq for t in findsums(n-s, m-1))
print([n for n in range(4, limit+1) if len(findsums(n, 4)) == 1]) # Michael S. Branicky, Apr 07 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved