login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A295043
a(n) is the largest number k such that sigma(k) = 2^n or 0 if no such k exists.
2
1, 0, 3, 7, 0, 31, 0, 127, 217, 381, 889, 0, 3937, 8191, 11811, 27559, 57337, 131071, 253921, 524287, 1040257, 1777447, 4063201, 7281799, 16646017, 32247967, 66584449, 116522119, 225735769, 516026527, 1073602561, 2147483647, 4294434817, 7515217927, 15032385529
OFFSET
0,3
COMMENTS
If a(n) > 0, then it is a term of A046528 (numbers that are a product of distinct Mersenne primes).
FORMULA
a(A078426(n)) = 0.
a(A180221(n)) > 0.
a(n) <= 2^n - 1 with equality when n is a Mersenne exponent (A000043). - Michael B. Porter, Nov 14 2017
EXAMPLE
a(0) = 1 because 1 is the largest number k with sigma(k) = 1 = 2^0.
a(5) = 31 because 31 is the largest number k with sigma(k) = 32 = 2^5.
a(6) = 0 because there is no number k with sigma(k) = 64 = 2^6.
PROG
(PARI) a(n) = {local(r, k); r=0; for(k=1, 2^n, if(sigma(k) == 2^n, r=k)); return(r)}; \\ Michael B. Porter, Nov 14 2017
(PARI) a(n) = forstep(k=2^n, 1, -1, if (sigma(k)==2^n, return (k))); return (0) \\ Rémy Sigrist, Jan 08 2018
(PARI) a(n) = invsigmaMax(1<<n); \\ Amiram Eldar, Dec 20 2024, using Max Alekseyev's invphi.gp
CROSSREFS
Cf. A247956 (the smallest number k instead of the largest).
Cf. A078426 (no solution to the equation sigma(x)=2^n).
A000668 (Mersenne primes) is a subsequence.
Sequence in context: A198490 A354797 A247956 * A074051 A335918 A048292
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Nov 13 2017
STATUS
approved