OFFSET
1,4
COMMENTS
a(n) is odd if and only if prime(n) is in A249410. - Jianing Song, Nov 14 2021
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
nod:= n -> numtheory:-tau(n/2^padic:-ordp(n, 2)):
map(nod, [seq(ithprime(i)-1, i=1..100)]); # Robert Israel, Oct 11 2024
MATHEMATICA
a[n_] := DivisorSigma[0, (k = Prime[n] - 1)/2^IntegerExponent[k, 2]]; Array[a, 100] (* Amiram Eldar, Jun 03 2021 *)
Count[Divisors[#-1], _?OddQ]&/@Prime[Range[100]] (* Harvey P. Dale, Jan 22 2024 *)
PROG
(Magma) [NumberOfDivisors(p-1)/Valuation(2*p-2, 2): p in PrimesUpTo(500)];
(Python)
from sympy import divisors, prime
def a(n): return sum(d%2 for d in divisors(prime(n)-1))
print([a(n) for n in range(1, 96)]) # Michael S. Branicky, Jul 04 2021
(PARI) a(n) = sumdiv(prime(n)-1, d, d%2); \\ Michel Marcus, Dec 18 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, Nov 12 2021
STATUS
approved