OFFSET
1,1
COMMENTS
a(n) = 2 if and only if 2^n + 1 is in A019434.
From Jinyuan Wang, Jan 30 2021: (Start)
a(n) = 0 if n > 1 is not a prime power. Proof: note that sigma_n(k) = Product_{i=1..m} (1 + p_i^n + ... + p_i^(n*e_i)), where k = Product_{i=1..m} p_i^e_i. We only need to prove when n > 1 is not a prime power and e > 1, s = Sum_{i=0..e-1} p^(n*i) = (p^(n*e) - 1)/(p^n - 1) is composite. If e is prime, then s is divisible by (p^(e^(t+1)) - 1)/(p^(e^t) - 1), where t is the e-adic valuation of n. If e is composite, then s is divisible by (p^(n*q) - 1)/(p^n - 1), where q is a prime factor of e.
Corollary: k must be of the form p^(e - 1) when n = e^t, where p and e are primes. Therefore, a(2^t) = 0 if 2^2^t + 1 is composite. (End)
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..50
EXAMPLE
2 has two divisors, 2 and 1. 2^3 + 1^3 = 9 is not prime.
3 has two divisors, 3 and 1. 3^3 + 1^3 = 28 is not prime.
4 has three divisors, 4, 2, and 1. 4^3 + 2^3 + 1^3 = 73 is prime. So, a(3) = 4.
MATHEMATICA
a252040[n_Integer] := If[PrimePowerQ[n] && (p=First@ First@ FactorInteger[n])>2, q=2; While[!PrimeQ[DivisorSigma[n, q^(p-1)]], q=NextPrime[q]]; q^(p-1), 2*Boole[PrimeQ[2^n+1]]]; a252040 /@ Range[10] (* Michael De Vlieger, Dec 13 2014 *) (* modified by Jinyuan Wang, Jan 30 2021 *)
PROG
(PARI) a(n) = if(isprimepower(n, &p) && p>2, my(q=2); while(!ispseudoprime(sigma(q^(p-1), n)), q=nextprime(q+1)); q^(p-1), 2*isprime(2^n+1)); \\ Modified by Jinyuan Wang, Jan 25 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Dec 12 2014
EXTENSIONS
Name edited by and more terms from Jinyuan Wang, Jan 30 2021
STATUS
approved