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.

A161510 Number of primes formed as the sum of distinct divisors of n, counted with repetition.

Original entry on oeis.org

0, 2, 1, 4, 1, 6, 1, 6, 2, 7, 1, 20, 1, 5, 4, 11, 1, 16, 1, 19, 5, 5, 1, 66, 2, 5, 4, 17, 1, 64, 1, 18, 4, 6, 6, 120, 1, 5, 5, 63, 1, 62, 1, 18, 11, 5, 1, 237, 1, 15, 3, 18, 1, 47, 6, 60, 5, 7, 1, 863, 1, 3, 20, 31, 6, 58, 1, 16, 3, 62, 1, 808, 1, 4, 13, 16, 4, 56, 1, 216, 5, 5, 1, 839, 5, 5
Offset: 1

Views

Author

T. D. Noe, Jun 17 2009

Keywords

Comments

That is, if a number has d divisors, then we compute all 2^d sums of distinct divisors and count how many primes are formed. Sequence A093893 lists the n that produce no primes except for the primes that divide n. The Mathematica code works well for numbers up to about 221760, which has 168 divisors and creates a polynomial of degree 950976. The coefficients of the prime powers of that polynomial sum to 28719307224839120896278355000770621322645671888269, the number of primes formed by the divisors of 221760. Records appear to occur at n=10 and n in A002182, the highly composite numbers.

Examples

			a(4) = 4 because the divisors (1,2,4) produce 4 primes (2,1+2,1+4,1+2+4).
		

Programs

  • Maple
    with(NumberTheory):
    A161510:=proc(n)
        local b,l,j;
        l:=[(Divisors(n))[]]:
        b:=proc(m,i)
            option remember;
            `if`(m=0,1,`if`(i<1,0,b(m,i-1)+`if`(l[i]>m,0,b(m-l[i],i-1))))
        end;
        add(b(ithprime(j),nops(l)),j=1..pi(sigma(n)));
    end:
    seq(A161510(n),n=1..77); # Felix Huber, Jul 24 2025
  • Mathematica
    CountPrimes[n_] := Module[{d=Divisors[n],t,lim,x}, t=CoefficientList[Product[1+x^d[[i]], {i,Length[d]}], x]; lim=PrimePi[Length[t]-1]; Plus@@t[[1+Prime[Range[lim]]]]]; Table[CountPrimes[n], {n,100}]
  • PARI
    a(n) = my(nb=0, d=divisors(n)); forsubset(#d, s, nb+=isprime(sum(i=1, #s, d[s[i]]))); nb; \\ Michel Marcus, Jul 24 2025