login
The smallest number such that n or more numbers k exist such that a(n) - k = sopfr(a(n)) + sopfr(k), where sopfr(m) is the sum of the primes dividing m, with repetition.
9

%I #30 Feb 13 2024 08:14:09

%S 6,35,77,169,287,1147,1517,1517,4352,4352,4352,14647,55488,55488,

%T 114091,121673,167137,206837,277928,277928,277928,277928,277928,

%U 722473,2165407,2498227,2498227,2498227,5271391,5770603,8321771,8321771,9983680,9983680,9983680,9983680,28277536,28277536,28277536,28277536,28277536

%N The smallest number such that n or more numbers k exist such that a(n) - k = sopfr(a(n)) + sopfr(k), where sopfr(m) is the sum of the primes dividing m, with repetition.

%C From _David A. Corneth_, Feb 11 2024:

%C To find terms we can do the following:

%C a(n) - k = sopfr(a(n)) + sopfr(k) can be rewritten as

%C a(n) - sopfr(a(n)) = k + sopfr(k)

%C So one side depends on a(n) and the other side depends on k.

%C Now to find terms <= u, make a list V of values m + sopfr(m) where m <= 2*precprime(u). So like for 59 we get those values are 38, 44, 48 from V.

%C We look up 59 in a table W of values m - sopfr(m) and find that 77 is the smallest such value. Hence a(3) <= 77. By looking through all m <= 77 in V and then referring to W we find a(3) = 77.

%H Michael S. Branicky, <a href="/A369351/b369351.txt">Table of n, a(n) for n = 1..60</a>

%H David A. Corneth, <a href="/A369351/a369351.gp.txt">PARI program</a>

%e a(1) = 6 as 6 is the smallest number to have one number (k = 1) such that 6 - 1 = 5 = sopfr(6) + sopfr(1) = 5 + 0 = 5.

%e a(2) = 35 as 35 is the smallest number to have two numbers (k = 14, 15) such that 35 - 14 = 21 = sopfr(35) + sopfr(14) = 12 + 9 = 21, and 35 - 15 = 20 = sopfr(35) + sopfr(15) = 12 + 8 = 20.

%e a(3) = 77 as 77 is the smallest number to have three numbers (k = 38, 44, 48) such that 77 - 38 = 39 = sopfr(77) + sopfr(38) = 18 + 21 = 39, 77 - 44 = 33 = sopfr(77) + sopfr(44) = 18 + 15 = 33, and 77 - 48 = 29 = sopfr(77) + sopfr(48) = 18 + 11 = 29.

%o (Python)

%o from sympy import factorint

%o from functools import cache

%o from itertools import count, islice

%o from collections import Counter

%o kcount, kmax = Counter(), 0

%o @cache

%o def sopfr(n): return sum(p*e for p, e in factorint(n).items())

%o def f(n): # revised based on comment by _David A. Corneth_, Feb 11 2024

%o global kcount, kmax

%o target = n - sopfr(n)

%o for k in range(kmax+1, target+1):

%o kcount[k+sopfr(k)] += 1

%o kmax += 1

%o return kcount[target]

%o def agen(): # generator of terms

%o adict, n = dict(), 1

%o for m in count(2):

%o v = f(m)

%o if v not in adict: adict[v] = m

%o for i in range(n, v+1): yield m; n += 1

%o print(list(islice(agen(), 12))) # _Michael S. Branicky_, Feb 09 2024

%Y Cf. A001414, A369348, A369349, A369350, A369352, A369353, A370091.

%K nonn

%O 1,1

%A _Scott R. Shannon_, Jan 21 2024

%E a(24) from _Michael S. Branicky_, Feb 08 2024

%E a(25) from _Michael S. Branicky_, Feb 11 2024

%E More terms from _David A. Corneth_, Feb 11 2024