OFFSET
0,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..16383
Antti Karttunen, Data supplement: n, a(n) computed for n = 0..65537
PROG
(PARI) A324184(n) = if(!n, 1, my(p=2, mp=p*p, m=1); while(n>1, if(n%2, p=nextprime(1+p); mp = p*p, if((2==n)||!(n%4), mp *= p, m *= (mp-1)/(p-1))); n >>= 1); (m*(mp-1)/(p-1)));
(PARI)
A163511(n) = if(!n, 1, my(p=2, t=1); while(n>1, if(!(n%2), (t*=p), p=nextprime(p+1)); n >>= 1); (t*p));
(Python)
from sympy import nextprime
def A324184(n):
if n:
c, p = 1, 1
while n:
c *= ((p:=nextprime(p))**(s:=(~n&n-1).bit_length()+1)-1)//(p-1)
n >>= s
return c*(p**(s+1)-1)//(p**s-1)
return 1 # Chai Wah Wu, Jul 25 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 17 2019
STATUS
approved