Define an arithmetic function

asked 2024-06-09 20:29:04 +0100

I need help to define an arithmetic function f_k related to a non negative integer k. For example f_k(720)= 2^gcd(4,k) * 3^gcd(2,k).

edit retag flag offensive close merge delete

Comments

Do you need something like the following?

def f_k(k):
    return 2^gcd(4,k) * 3^gcd(2,k)

print(f_k(720))
tolga gravatar imagetolga ( 2024-06-10 08:07:56 +0100 )edit
1

f_k(720)= 2^gcd(4,k) * 3^gcd(2,k) is not a function definition. Please define what is f_k(n).

Max Alekseyev gravatar imageMax Alekseyev ( 2024-06-10 17:36:34 +0100 )edit