cp's OEIS Frontend

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.

A361806 Sum of distinct prime factors of all composite numbers between n-th and (n+1)st primes.

Original entry on oeis.org

0, 2, 5, 10, 5, 17, 5, 28, 30, 10, 45, 42, 12, 44, 47, 76, 10, 72, 57, 5, 97, 51, 117, 150, 28, 22, 83, 5, 65, 321, 66, 131, 28, 298, 10, 108, 172, 145, 109, 205, 10, 276, 5, 127, 16, 441, 582, 130, 24, 80, 232, 10, 276, 195, 270, 256, 10, 218, 187, 52, 388, 701, 162
Offset: 1

Views

Author

Karl-Heinz Hofmann, Mar 26 2023

Keywords

Examples

			a(6): 6th prime = 13 and the (6+1)th prime = 17; the composites between are {14,15,16} and the distinct prime factors of this set are {2,7,3,5} (no duplicates allowed); so a(6) = 2 + 7 + 3 + 5 = 17.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Plus @@ Union@ (Join @@ (FactorInteger[#][[;; , 1]] & /@ Range[Prime[n] + 1, Prime[n + 1] - 1])); Array[a, 65] (* Amiram Eldar, Mar 27 2023 *)
  • PARI
    a(n) = my(list=List()); for(i=prime(n)+1, prime(n+1)-1, my(f=factor(i)[,1]); for (k=1, #f, listput(list, f[k]))); vecsum(Set(list)); \\ Michel Marcus, Mar 27 2023
  • Python
    from sympy import primefactors, sieve
    def A361806(n):
        primeset = []
        for composites in range (sieve[n]+1, sieve[n+1]):
            for p in primefactors(composites): primeset.append(p)
        return(sum(set(primeset)))
    

Formula

a(n) = A008472(A061214(n)).