OFFSET
0,4
LINKS
FORMULA
PROG
(PARI)
A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
A054429(n) = ((3<<#binary(n\2))-n-1);
(Python)
from sympy import nextprime
def A335420(n):
c, p, k = 1, 1, n
while k:
c *= (p:=nextprime(p))**(s:=(~k&k-1).bit_length())
k >>= s+1
return (c*p).bit_count() # Chai Wah Wu, Jul 25 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 09 2020
STATUS
approved