OFFSET
1,1
COMMENTS
Primes p for which (A001414(p-1), A001414(p+1)) form the legs of a right triangle with integer hypotenuse.
The reduced Pythagorean triples arising include (3,4,5), (9,40,41), (12,5,13), (33,56,65), and others. For example, a(6)=16111 and a(7)=19469 both yield the triple 16*(12,5,13).
Conjecture: this sequence is infinite (empirical observation; no proof is known).
REFERENCES
D. E. Knuth, The Art of Computer Programming, Vol. 2, Addison-Wesley, 1998, Section 4.5.4 (on completely additive arithmetic functions).
FORMULA
EXAMPLE
a(1) = 4271: 4270 = 2 * 5 * 7 * 61, so A001414(4270) = 75; 4272 = 2^4 * 3 * 89, so A001414(4272) = 100; 75^2 + 100^2 = 15625 = 125^2. Triple: 25*(3,4,5).
MAPLE
sopfr:= proc(n) local t; add(t[1]*t[2], t = ifactors(n)[2]) end proc:
filter:= n -> isprime(n) and issqr(sopfr(n-1)^2 + sopfr(n+1)^2):
select(filter, [2, seq(i, i=3..10^6, 2)]); # Robert Israel, May 21 2026
MATHEMATICA
sopfr[n_] := Total[Times @@@ FactorInteger[n]]; Select[Prime[Range[5, 50000]], IntegerQ[Sqrt[sopfr[#-1]^2 + sopfr[#+1]^2]]&]
PROG
(Python)
from sympy import factorint, nextprime
import math
def sopfr(n):
if n <= 1:
return 0
return sum(p * e for p, e in factorint(n).items())
def is_sq(n):
r = math.isqrt(n)
return r * r == n
p = 2
while p < 10**6:
if is_sq(sopfr(p-1)**2 + sopfr(p+1)**2):
print(p)
p = nextprime(p)
(PARI) sopfr(n) = my(f=factor(n)); sum(k=1, matsize(f)[1], f[k, 1]*f[k, 2]);
isok(p) = isprime(p) && issquare(sopfr(p-1)^2+sopfr(p+1)^2); \\ Michel Marcus, May 21 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Rudra Jadhav, May 21 2026
STATUS
approved
