A071376 Duplicate of A064502.
0, 2, 3, 0, 5, 0, 7, 15, 14, 21, 11, 35, 13, 33, 26, 39, 17, 65, 19, 51, 38, 57, 23, 95, 46
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
a(18) = 5 because 18 = 2 * 3^2 and 2 + 3 = 5. a(19) = 19 because 19 is prime. a(20) = 7 because 20 = 2^2 * 5 and 2 + 5 = 7.
a008472 = sum . a027748_row -- Reinhard Zumkeller, Mar 29 2012
[n eq 1 select 0 else &+[p[1]: p in Factorization(n)]: n in [1..100]]; // Vincenzo Librandi, Jun 24 2017
A008472 := n -> add(d, d = select(isprime, numtheory[divisors](n))): seq(A008472(i), i = 1..40); # Peter Luschny, Jan 31 2012 A008472 := proc(n) add( d, d= numtheory[factorset](n)) ; end proc: # R. J. Mathar, Jul 08 2012
Prepend[Array[Plus @@ First[Transpose[FactorInteger[#]]] &, 100, 2], 0] Join[{0}, Rest[Total[Transpose[FactorInteger[#]][[1]]]&/@Range[100]]] (* Harvey P. Dale, Jun 18 2012 *) (* Requires version 7.0+ *) Table[DivisorSum[n, # &, PrimeQ[#] &], {n, 75}] (* Alonso del Arte, Dec 13 2014 *) Table[Sum[p, {p, Select[Divisors[n], PrimeQ]}], {n, 1, 100}] (* Vaclav Kotesovec, May 20 2020 *)
sopf(n) = local(fac=factor(n)); sum(i=1,matsize(fac)[1],fac[i,1])
vector(100,n,vecsum(factor(n)[,1]~)) \\ Derek Orr, May 13 2015
A008472(n)=vecsum(factor(n)[,1]) \\ M. F. Hasler, Jul 18 2015
from sympy import primefactors def A008472(n): return sum(primefactors(n)) # Chai Wah Wu, Feb 03 2022
def A008472(n): return add(d for d in divisors(n) if is_prime(d)) print([A008472(i) for i in (1..40)]) # Peter Luschny, Jan 31 2012
[sum(prime_factors(n)) for n in range(1,74)] # Giuseppe Coppoletta, Jan 19 2015
a(8) = 15 = 3*5 because 15 is the smallest number whose prime divisors sum to 8. a(10000) = 586519: Let pp(n) be the largest prime < n and the candidate being the current value that might be a(10000). Then we see that pp(10000 - 1) = 9973, giving a candidate 9973 * a(10000 - 9973) = 9973 * 92. pp(9973) = 9967, giving a candidate 9967 * a(10000 - 9967) = 9967 * 62. pp(9967) = 9949, giving the candidate 9949 * a(10000 - 9949) = 9962 * 188. This is larger than our candidate so we keep 9967 * 62 as our candidate. pp(9949) = 9941, giving a candidate 9941 * pp(10000 - 9941) = 9941 * 59. We see that (n - p) * a(p) >= (n - p) * p > candidate = 9941 * 59 for p > 59 so we stop iterating to conclude a(10000) = 9941 * 59 = 586519. - _David A. Corneth_, Mar 23 2018, edited by _M. F. Hasler_, Jan 19 2019
a056240 = (+ 1) . fromJust . (`elemIndex` a001414_list) -- Reinhard Zumkeller, Jun 14 2012
A056240 := proc(n) local k ; for k from 1 do if A001414(k) = n then return k ; end if; end do: end proc: seq(A056240(n),n=2..80) ; # R. J. Mathar, Apr 15 2024
a = Table[0, {75}]; Do[b = Plus @@ Flatten[ Table[ #1, {#2}] & @@@ FactorInteger[n]]; If[b < 76 && a[[b]] == 0, a[[b]] = n], {n, 2, 1000}]; a (* Robert G. Wilson v, May 04 2002 *) b[n_] := b[n] = Total[Times @@@ FactorInteger[n]]; a[n_] := For[k = 2, True, k++, If[b[k] == n, Return[k]]]; Table[a[n], {n, 2, 63}] (* Jean-François Alcover, Jul 03 2017 *)
isok(k, n) = my(f=factor(k)); sum(j=1, #f~, f[j,1]*f[j,2]) == n; a(n) = my(k=2); while(!isok(k, n), k++); k; \\ Michel Marcus, Jun 21 2017
a(n) = {if(n < 7, return(n + 2*(n==6))); my(p = precprime(n), res); if(p == n, return(p), p = precprime(n - 2); res = p * a(n - p); while(res > (n - p) * p && p > 2, p = precprime(p - 1); res = min(res, a(n - p) * p)); res)} \\ David A. Corneth, Mar 23 2018
A056240(n, p=n-1, m=oo)=if(n<6 || isprime(n), n, n==6, 8, until(p<3 || (n-p=precprime(p-1))*p >= m=min(m,A056240(n-p)*p),); m) \\ M. F. Hasler, Jan 19 2019
Expressed as a sum of distinct primes, 12 = 5 + 7 = 2 + 3 + 7. Products are 5*7 = 35 and 2*3*7 = 42; 42 > 35, so a(12) = 42. 13 = 2 + 11; products are 13 = 13 and 2*11 = 22; 22 > 13, so a(13) = 22.
alist(n)={local(v); v=vector(n, x, -1); forprime(p=2, n, forstep(h=n, p+1, -1, v[h]=max(v[h], v[h-p]*p)); v[p]=max(v[p], p)); v}
Comments