login
A088910
Conjectured minimal required number k of terms in a representation n = Sum_{i=1..k} e_i*(p_i)^2 by distinct primes p_i, where e_i is 1 or -1.
3
4, 3, 4, 4, 1, 2, 5, 5, 4, 1, 4, 4, 3, 2, 4, 3, 2, 5, 5, 4, 3, 2, 4, 3, 2, 1, 4, 4, 3, 2, 3, 5, 4, 3, 2, 4, 3, 4, 3, 3, 2, 5, 5, 4, 3, 2, 4, 3, 2, 1, 4, 4, 3, 2, 3, 5, 4, 3, 2, 4, 5, 4, 3, 3, 4, 3, 5, 4, 3, 4, 3, 3, 2, 3, 2, 4, 3, 4, 3, 4, 4, 3, 4, 3, 5, 4, 4, 3, 4, 5, 5, 4, 3, 4, 4, 3, 2, 3, 4, 4, 3, 4, 5, 5, 4
OFFSET
0,1
COMMENTS
It is conjectured that all sequence terms are <= 5. The terms with a(n)=5 were provided by W. Edwin Clark.
LINKS
Robert E. Dressler, Louis Pigno, and Robert Young, Sums of squares of primes, Nordisk Mat. Tidskr. 24 (1976), 39-40.
EXAMPLE
The following are representation with the minimal number of terms:
a(0)=4: 0=7^2-11^2-17^2+19^2;
a(1)=3: 1=7^2+11^2-13^2;
a(4)=1: 4=2^2;
a(5)=2: 5=3^2-2^2;
a(6)=5: 6=-(2^2)+3^2+7^2+11^2-13^2.
PROG
(Python)
from sympy import prime
from itertools import combinations, product, count
from functools import cache
@cache
def A001248_list(n): return list(prime(i)**2 for i in range(1, n+1))
@cache
def A001248_set(n): return set(A001248_list(n))
def A088910(n, num_primes=30):
Q, S = A001248_list(num_primes), A001248_set(num_primes)
for k in count(1):
for c in combinations(Q, k-1):
for s in product([1, -1], repeat=k-1):
v=abs(n-sum(x*y for x, y in zip(c, s)))
if v in S and v not in c: return k # Tyler Busby, Nov 30 2025
CROSSREFS
Cf. A088934 (maximum required prime in representation), A048261, A088908, A088909.
Sequence in context: A111048 A016700 A396895 * A010308 A200625 A156743
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Oct 24 2003
STATUS
approved