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.

A290126 Least k such that the sum of the n greatest divisors of k is a prime number.

Original entry on oeis.org

2, 2, 4, 28, 16, 140, 24, 90, 120, 108, 60, 144, 300, 288, 120, 672, 252, 432, 240, 630, 960, 756, 480, 1200, 1080, 1728, 1680, 1008, 720, 2016, 840, 3150, 2160, 2700, 1980, 4800, 2520, 3780, 3240, 8736, 3960, 3600, 6720, 6930, 10800, 6300, 4200, 16848, 9240, 5040
Offset: 1

Views

Author

Michel Lagneau, Jul 20 2017

Keywords

Comments

The corresponding primes are 2, 3, 7, 53, 31, 307, 59, 223, 331, 277, 167, 397, 853, 809, 359, 1973, 727, 1237, ...
The squares of the sequence are 4, 16, 144, 3600, ...

Examples

			a(4)=28 because the sum of the last 4 divisors of 28: 28+14+7+4 = 53 is a prime number.
		

Crossrefs

Programs

  • Maple
    M:= 20000: # to get all terms before the first term > M
    R:= 'R':
    for k from 2 to M do
       F:= ListTools:-PartialSums(sort(convert(
          numtheory:-divisors(k),list),`>`));
       for n in select(t -> isprime(F[t]),[$1..nops(F)]) do
        if not assigned(R[n]) then R[n]:= k fi
       od
    od:
    inds:= map(op,{indices(R)}):
    N:= min({$1..max(inds)+1} minus inds):
    seq(R[i],i=1..N-1);  # Robert Israel, Jul 24 2017
  • Mathematica
    Table[k=1;While[Nand[Length@#>=n,PrimeQ[Total@Take[PadLeft[#,n],n]]]&@Divisors@k,k++];k,{n,1,20}](* Program from Michael De Vlieger adapted for this sequence. See A289776 *)
  • PARI
    a(n) = {my(i = 2, d);  while(1, d = divisors(i); if(#d >= n, if(isprime(sum(j=#d-n+1,#d,d[j])), return(i), i++), i++)); i} \\ David A. Corneth, Jul 20 2017
    
  • Python
    from sympy import divisors, isprime
    def A290126(n):
        i = 1
        while len(divisors(i)) < n or not isprime(sum(divisors(i)[-n:])):
            i += 1
        return i # Chai Wah Wu, Aug 05 2017