OFFSET
0,2
COMMENTS
For n > 1, number of k such that psi(k) divides 2*n, where psi = A002322 is the reduced totient function. In other words, number of k such that x^(2*n) == 1 (mod k) for every x coprime to k.
LINKS
Jianing Song, Table of n, a(n) for n = 0..10000
PROG
(Python)
from math import prod
from sympy import factorint, divisors, isprime
def A396683(n): return prod(e+2 for p, e in factorint(n).items() if p>2 and not 2*n%(p-1))*((~n & n-1).bit_length()+4)<<sum(1 for d in divisors(2*n, generator=True) if d>1 and n%(d+1) and isprime(d+1)) if n else 1 # Chai Wah Wu, Jun 02 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jianing Song, Jun 02 2026
STATUS
approved
