login
A391007
Prime numbers p that cannot be represented as either the sum of distinct nontrivial divisors of p - 1 or the sum of distinct nontrivial divisors of p + 1.
1
2, 3, 7, 67, 137, 163, 173, 257, 283, 317, 347, 373, 443, 487, 563, 643, 653, 677, 709, 733, 773, 787, 821, 823, 853, 877, 907, 941, 947, 977, 997, 1013, 1061, 1069, 1097, 1163, 1181, 1193, 1213, 1237, 1277, 1283, 1307, 1373, 1423, 1433, 1447, 1459, 1493, 1523
OFFSET
1,1
LINKS
FORMULA
p is term <=> p is prime and p not in A391004 and p not in A391006.
MAPLE
issum:= proc(n, S) option remember; local m, Sp;
Sp:= select(`<=`, S, n);
if n > convert(Sp, `+`) then return false fi;
if member(n, Sp) then return true fi;
m:= max(Sp); Sp:= Sp minus {m};
procname(n-m, Sp) or procname(n, Sp)
end proc:
filter:= proc(p)
isprime(p) and
not issum(p, NumberTheory:-Divisors(p-1) minus {1, p-1})
and not issum(p, NumberTheory:-Divisors(p+1) minus {1, p+1})
end proc:
select(filter, [2, seq(i, i=3..2000, 2)]); # Robert Israel, Jan 07 2026
PROG
(SageMath)
def A391007List(upto): return [p for p in prime_range(upto) if not is_A391004(p) and not is_A391006(p)]
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 30 2025
STATUS
approved