Function Repository Resource:

# RamanujanC

Evaluate Ramanujan's sum

Contributed by: Jan Mangaldan
 ResourceFunction["RamanujanC"][q,n] gives Ramanujan's sum cq(n).

## Details

Integer mathematical function, suitable for both symbolic and numerical manipulation.
Ramanujan's sum is also known as von Sterneck's function.
Ramanujan's sum is given by , where k ranges over all positive integers coprime and less than or equal to q.

## Examples

### Basic Examples (2)

Evaluate c10(5):

 In[1]:=
 Out[1]=

Plot RamanujanC for different indices:

 In[2]:=
 Out[2]=

### Scope (2)

Show a table of Ramanujan sums:

 In[3]:=
 Out[3]=

 In[4]:=
 Out[4]=

### Applications (2)

 In[5]:=
 Out[5]=

Express Cyclotomic[n,x] in terms of RamanujanC and BellY:

 In[6]:=
 Out[6]=

### Properties and Relations (5)

RamanujanC[q,1] is the same as MoebiusMu[q]:

 In[7]:=
 Out[7]=

RamanujanC[q,q] is the same as EulerPhi[q]:

 In[8]:=
 Out[8]=

RamanujanC[q,n] is a multiplicative function with respect to its first argument:

 In[9]:=
 Out[9]=

Verify the definition of RamanujanC in terms of the roots of unity:

 In[10]:=
 Out[10]=

RamanujanC can be expressed as a Dirichlet convolution:

 In[11]:=
 Out[11]=

### Neat Examples (1)

Visualize Ramanujan's sum over integer values:

 In[12]:=
 Out[12]=

## Version History

• 1.0.0 – 08 March 2021