login
A394435
Primes p such that A001414(p-1)^2 + A001414(p+1)^2 is a perfect square, where A001414(n) is the sum of prime factors of n with multiplicity (sopfr).
0
2, 4271, 4591, 7151, 10973, 13183, 16111, 19469, 31151, 32749, 41887, 43051, 64033, 65729, 73471, 74933, 91541, 122609, 128591, 142993, 144451, 181039, 185071, 187373, 195593, 263759, 321199, 328357, 332477, 363439, 388961, 413129, 453311, 489539, 524087, 528391, 534311, 536717
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
a(n) is prime and there exists a positive integer h such that A001414(a(n)-1)^2 + A001414(a(n)+1)^2 = h^2.
Equivalently: a(n) is prime and A001414(a(n)-1)/A001414(a(n)+1) is a rational number whose square plus 1 is a perfect rational square (i.e., the ratio is a rational leg-to-leg ratio of a Pythagorean triple).
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).
a(2) = 4591: 4590 = 2 * 3^3 * 5 * 17, so A001414(4590) = 33; 4592 = 2^4 * 7 * 41, so A001414(4592) = 56; 33^2 + 56^2 = 4225 = 65^2. Primitive triple (33,56,65).
a(3) = 7151: A001414(7150) = 36, A001414(7152) = 160; 36^2 + 160^2 = 26896 = 164^2. Triple: 4*(9,40,41).
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
Cf. A001414 (sopfr), A086299 (Ruth-Aaron pairs: sopfr(n)=sopfr(n+1)), A074981 (Ruth-Aaron numbers), A001222 (Omega, number of prime factors with multiplicity).
Sequence in context: A114722 A135959 A105667 * A178410 A067668 A292391
KEYWORD
nonn
AUTHOR
Rudra Jadhav, May 21 2026
STATUS
approved