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.

A382506 a(n) is the smallest k such that sigma(n) + k is a perfect number.

Original entry on oeis.org

5, 3, 2, 21, 0, 16, 20, 13, 15, 10, 16, 0, 14, 4, 4, 465, 10, 457, 8, 454, 464, 460, 4, 436, 465, 454, 456, 440, 466, 424, 464, 433, 448, 442, 448, 405, 458, 436, 440, 406, 454, 400, 452, 412, 418, 424, 448, 372, 439, 403, 424, 398, 442, 376, 424, 376, 416, 406, 436, 328, 434, 400
Offset: 1

Views

Author

Leo Hennig, Mar 29 2025

Keywords

Examples

			sigma(1) = 1, 1 + 5 = 6, k = 5.
sigma(6) = 12, 12 + 16 = 28, k = 16.
sigma(180) = 546, 546 + 7582 = 8128, k = 7582.
As sigma(3000) = 9360 and the smallest perfect number at least as large as 9360 is 2^12 * (2^13 - 1) = 33550336 we have a(3000) = 33550336 - sigma(3000) = 33540976. - _David A. Corneth_, Apr 10 2025
		

Crossrefs

Programs

  • Mathematica
    Do[k=0;s=DivisorSigma[1,n];While[DivisorSigma[1,s+k]!=2*(s+k),k++];a[n]=k,{n,62}];Array[a,62] (* James C. McMahon, Apr 10 2025 *)
  • PARI
    a(n) = my(s=sigma(n),k=0); while (sigma(s+k) != 2*(s+k), k++); k; \\ Michel Marcus, Mar 30 2025
    
  • PARI
    a(n) = {my(s = sigma(n));
        forprime(p = 2, oo,
            my(c = 2^p-1);
            if(isprime(c) && binomial(c+1, 2) >= s,
               return(binomial(c+1, 2) - s)))
    } \\ David A. Corneth, Apr 10 2025

Formula

a(A081357(n)) = 0 and a(A146542(n)) = 0.