OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..371 from G. C. Greubel)
EXAMPLE
The sum of the distinct prime factors of 23 is 23; the sum of the distinct prime factors of 22 = 2 * 11 is 2 + 11 = 13; the sum of the distinct prime factors of 21 = 3 * 7 is 3 + 7 = 10; Hence 23 belongs to the sequence.
MATHEMATICA
p[n_] := Apply[Plus, Transpose[FactorInteger[n]][[1]]]; Select[Range[4, 10^5], p[ # - 1] + p[ # - 2] == p[ # ] &]
PROG
(PARI) sopf(n) = my(f=factor(n)); sum(k=1, #f~, f[k, 1]);
isok(n) = sopf(n) == sopf(n-1) + sopf(n-2); \\ Michel Marcus, Feb 12 2020
(Magma) [k:k in [5..560000]| &+PrimeDivisors(k-1)+ &+PrimeDivisors(k-2) eq &+PrimeDivisors(k)]; // Marius A. Burtea, Feb 12 2020
(Python)
from sympy import primefactors
def sopf(n): return sum(primefactors(n))
def afind(limit):
sopfm2, sopfm1, sopf = 2, 3, 2
for k in range(4, limit+1):
if sopf == sopfm1 + sopfm2: print(k, end=", ")
sopfm2, sopfm1, sopf = sopfm1, sopf, sum(primefactors(k+1))
afind(600000) # Michael S. Branicky, May 23 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Oct 18 2002
EXTENSIONS
Edited and extended by Ray Chandler, Feb 13 2005
STATUS
approved