OFFSET
1,1
COMMENTS
Contains all squares of primes (A001248).
Terms that are not squares of primes: 300, 504, 980, 1056, 1404, 1575, 2600, 2736, 4851, 6375, 6696, 7436, 7448, 7695, 9639, 10304, 11375, 11583, 12384, 13376, 13770, 14144, 19250, 20691, 21500, 22656, 24548, 24975, 28175, 28944, 30008, 34983, 36848, 37026, 50024, 58400, 63455, ... - Alex Ratushnyak, Aug 17 2012
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
The prime factors of 300 are 2, 3, 5, the sum and product of which are 10, 30 respectively, which multiply to 300. Hence 300 belongs to the sequence.
MATHEMATICA
h[n_] := Module[{a, l }, a = FactorInteger[n]; l = Length[a]; Sum[a[[i]][[1]], {i, 1, l}]*Product[a[[i]][[1] ], {i, 1, l}] == n]; Select[Range[2, 10^4], h[ # ] &]
pf[n_] := First /@ FactorInteger[n]; Select[Range[11500], (Plus @@ pf[ # ])*(Times @@ pf[ # ]) == # &] (* Ray Chandler, Nov 14 2005 *)
PROG
(Python)
from sympy import primerange
import math
primes = list(primerange(2, 10000))
for n in range(1, 10000):
d = n
sum = 0
product = 1
for p in primes:
if d%p==0:
sum += p
product *= p
while d%p==0:
d//=p
if d==1:
break
if sum*product==n:
print(n, end=', ')
# Alex Ratushnyak, Aug 18 2012
(Python)
from math import prod
from sympy import primefactors
def ok(n): pf = primefactors(n); return n == sum(pf)*prod(pf)
print(list(filter(ok, range(1, 11600)))) # Michael S. Branicky, May 15 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Mar 20 2002
EXTENSIONS
Extended by Ray Chandler, Nov 14 2005
STATUS
approved