login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Composites whose largest prime factor is equal to the sum of all the other prime factors (with repetition).
5

%I #24 Apr 10 2021 02:49:19

%S 4,9,25,30,49,70,84,121,169,286,289,308,361,440,495,528,529,594,646,

%T 728,819,841,884,961,975,1040,1170,1248,1369,1404,1496,1681,1683,1748,

%U 1798,1849,1976,2209,2223,2499,2809,2975,3128,3135,3344,3481,3519,3526,3570

%N Composites whose largest prime factor is equal to the sum of all the other prime factors (with repetition).

%C Sequence contains the square of every prime. - _Sean A. Irvine_, Oct 05 2009

%C Contains 4*A143206. - _David A. Corneth_, Apr 28 2020

%C Contains 2*A037074. - _Bernard Schott_, Apr 28 2020

%H Amiram Eldar, <a href="/A163836/b163836.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 4 (2=2), a(2) = 9 (3=3), a(3) = 25 (5=5), a(4) = 30 (5=3+2), a(5) = 49 (7=7), a(6) = 70 (7=5+2), a(7) = 84 (7=3+2+2), a(8) = 121 (11=11), a(9) = 169 (13=13), a(10) = 286 (13=11+2), a(11) = 289(17=17), a(12) = 308 (11=7+2+2), ...

%p A002808 := proc(n) option remember; local a; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do: end if; end proc: A006530 := proc(n) if n = 1 then 1; else numtheory[factorset](n) ; max(op(%)) ; end if; end: A001414 := proc(n) ifactors(n)[2] ; add( op(1,p)*op(2,p),p=%) ; end: A163836 := proc(n) option remember; local a,lpf; if n =1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then lpf := A006530(a) ; if 2*lpf = A001414(a) then return a; end if; end if; od: end if; end: seq(A163836(n),n=1..80) ; # _R. J. Mathar_, Oct 10 2009

%t seqQ[n_] := Module[{f = FactorInteger[n]}, If[Length[f] == 1, f[[1, 2]] == 2, f[[-1, 2]] == 1 && f[[-1, 1]] == Plus @@ Times @@@ Most[f]]]; Select[Range[4000], seqQ] (* _Amiram Eldar_, Apr 28 2020 *)

%o (Python)

%o from sympy import factorint

%o def ok(n):

%o f = factorint(n)

%o return sum(f[p] for p in f) > 1 and 2*max(f) == sum(p*f[p] for p in f)

%o print(list(filter(ok, range(3571)))) # _Michael S. Branicky_, Apr 09 2021

%Y Cf. A002808, A037074, A143206.

%K nonn

%O 1,1

%A _Juri-Stepan Gerasimov_, Aug 05 2009

%E Corrected and extended by _Sean A. Irvine_ and _R. J. Mathar_, Oct 05 2009