OFFSET
0,1
COMMENTS
a(n) is odd iff n = 3, as a consequence of the Catalan-Mihăilescu theorem. - Bernard Schott, Oct 05 2021
LINKS
Max Alekseyev, Table of n, a(n) for n = 0..1122 (terms 0..500 from T. D. Noe, terms 501..1062 from Amiram Eldar, term 1108 from Tyler Busby)
Wikipedia, Catalan's conjecture.
FORMULA
EXAMPLE
a(7)=4, because 2^7 + 1 = 129 has 4 divisors.
MAPLE
a:= n-> numtheory[tau](2^n+1):
seq(a(n), n=0..100); # Alois P. Heinz, Aug 23 2021
MATHEMATICA
A046798[n_IntegerQ]:=DivisorSigma[0, 1+2^n]; (* Enrique Pérez Herrero, Nov 09 2010 *)
DivisorSigma[0, 1 + 2^#] & /@ Range[0, 83] (* Jayanta Basu, Jun 29 2013 *)
Table[DivisorSigma[0, 2^n + 1], {n, 0, 100}] (* Vincenzo Librandi, Feb 05 2018 *)
PROG
(PARI) a(n) = numdiv(2^n+1); \\ Michel Marcus, Mar 18 2017
(Python)
from sympy.ntheory import divisor_count
def A046798(n): return divisor_count(2**n + 1) # Indranil Ghosh, Mar 18 2017
(Magma) [NumberOfDivisors(2^n+1): n in [0..100]]; // Vincenzo Librandi, Feb 05 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved