OFFSET
1,1
COMMENTS
Numbers n such that the sum of the prime factors with multiplicity of n divides n-1 and the sum of the prime factors with multiplicity of n+1 divides n.
LINKS
Robert Israel, Table of n, a(n) for n = 1..75
EXAMPLE
a(3) = 229177 is a term because 229177 = 13*17^2*61, 13+17+17+61 = 108 divides 229177-1 = 229176, 229177+1 = 229178 = 2*19*37*163, and 2+19+37+163 = 221 divides 229177.
MAPLE
R:= NULL: count:= 0: state:= 0:
for n from 2 while count < 30 do
s:= add(t[1]*t[2], t=ifactors(n)[2]);
if n mod s = 1 then
if state = 1 then R:= R, n-1; count:= count+1 fi;
state:= 1;
else
state:= 0;
fi
od:
R;
MATHEMATICA
q[n_] := Divisible[n - 1, Plus @@ Times @@@ FactorInteger[n]]; s = {}; q1 = q[2]; Do[q2 = q[n]; If[q1 && q2, AppendTo[s, n - 1]]; q1 = q2, {n, 3, 10^6}]; s (* Amiram Eldar, Sep 30 2022 *)
PROG
(Python)
from sympy import factorint
from itertools import count, islice
def ok(n):
return n > 1 and (n-1)%sum(p*e for p, e in factorint(n).items()) == 0
def agen():
prevok = kok = False
for k in count(1):
prevok, kok = kok, ok(k)
if prevok and kok: yield k-1
print(list(islice(agen(), 6))) # Michael S. Branicky, Sep 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Sep 30 2022
STATUS
approved