Define an arithmetic function

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

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


Do you need something like the following?

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

tolga gravatar imagetolga ( 2024-06-10 08:07:56 +0200 )edit

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 +0200 )edit