Function Repository Resource:

# Fusc

Evaluate the fusc function

Contributed by: Christopher Stover
 ResourceFunction["Fusc"][n] gives the fusc function fusc(n).

## Details

Integer mathematical function, suitable for both symbolic and numerical manipulation.
ResourceFunction["Fusc"] is defined by the recurrence relation fusc(0)=0, fusc(1)=1, fusc(2m)=fusc(m) and fusc(2m+1)=fusc(m)+fusc(m+1).
According to author Edsger W. Dijkstra (EWD 570), the fusc function is named for the obfuscated appearance of its output.

## Examples

### Basic Examples (3)

Evaluate numerically for positive even integer input:

 In[1]:=
 Out[1]=

Evaluate numerically for positive odd integer input:

 In[2]:=
 Out[2]=

Plot Fusc over a subset of the non-negative integers:

 In[3]:=
 Out[3]=

### Scope (1)

 In[4]:=
 Out[4]=

### Applications (4)

The value fusc(n+1) is the number of odd binomial coefficients of the form Binomial[n-r,r], 02rn:

 In[5]:=
 Out[6]=
 In[7]:=
 Out[7]=

Confirm the two lists are equal:

 In[8]:=
 Out[8]=

An alternative way to compute the same quantity:

 In[9]:=
 Out[9]=

Confirm all three are equal:

 In[10]:=
 Out[10]=

### Possible Issues (1)

Fusc returns unevaluated if its input is anything other than a non-negative integer:

 In[11]:=
 Out[11]=

### Neat Examples (3)

Generate the first 100 terms of Stern's diatomic series, also known as the Stern–Brocot sequence (OEIS A002487):

 In[12]:=
 Out[12]=

When used in conjunction with Prime, you can generate OEIS sequences A261179 and A261273:

 In[13]:=
 Out[13]=
 In[14]:=
 Out[14]=

These two sequences combine to form the prime numbered elements in the Calkin–Wilf sequence, one popular enumeration of the rational numbers. More precisely, the terms of the Calkin–Wilf enumeration of the rationals are given by fusc(n)/fusc(n+1):

 In[15]:=
 Out[15]=

therealcstover

## Version History

• 1.0.0 – 09 September 2022