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.
%I A382506 #55 Apr 12 2025 09:43:49 %S A382506 5,3,2,21,0,16,20,13,15,10,16,0,14,4,4,465,10,457,8,454,464,460,4,436, %T A382506 465,454,456,440,466,424,464,433,448,442,448,405,458,436,440,406,454, %U A382506 400,452,412,418,424,448,372,439,403,424,398,442,376,424,376,416,406,436,328,434,400 %N A382506 a(n) is the smallest k such that sigma(n) + k is a perfect number. %H A382506 David A. Corneth, <a href="/A382506/b382506.txt">Table of n, a(n) for n = 1..10000</a> (first 3000 terms from Michel Marcus) %H A382506 Michael De Vlieger, <a href="/A382506/a382506.png">Log log scatterplot of a(n)</a>, n = 1..10000. %F A382506 a(A081357(n)) = 0 and a(A146542(n)) = 0. %e A382506 sigma(1) = 1, 1 + 5 = 6, k = 5. %e A382506 sigma(6) = 12, 12 + 16 = 28, k = 16. %e A382506 sigma(180) = 546, 546 + 7582 = 8128, k = 7582. %e A382506 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 %t A382506 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 *) %o A382506 (PARI) a(n) = my(s=sigma(n),k=0); while (sigma(s+k) != 2*(s+k), k++); k; \\ _Michel Marcus_, Mar 30 2025 %o A382506 (PARI) a(n) = {my(s = sigma(n)); %o A382506 forprime(p = 2, oo, %o A382506 my(c = 2^p-1); %o A382506 if(isprime(c) && binomial(c+1, 2) >= s, %o A382506 return(binomial(c+1, 2) - s))) %o A382506 } \\ _David A. Corneth_, Apr 10 2025 %Y A382506 Cf. A000203, A000396, A081357, A146542, A382929. %K A382506 nonn %O A382506 1,1 %A A382506 _Leo Hennig_, Mar 29 2025