Function Repository Resource:

SomosSequence

Source Notebook

Get elements of the Somos sequences

Contributed by: Sander Huisman

ResourceFunction["SomosSequence"][n,k]

give the nth term for the k-order Somos sequence.

Details

The Somos sequence is defined recursively. For fixed order k, the nth term is given as , where aj=1 for 0<=j<=k-1.

Examples

Basic Examples (2) 

Get the 14th term for the 4th order Somos sequence:

In[1]:=
ResourceFunction["SomosSequence"][14, 4]
Out[1]=

Calculate the first 14 elements of the 4th-order Somos sequence:

In[2]:=
ResourceFunction["SomosSequence"][#, 4] & /@ Range[14]
Out[2]=

Scope (1) 

Elements need not be integers:

In[3]:=
ResourceFunction["SomosSequence"][17, 8]
Out[3]=

Neat Examples (2) 

Plot the 4th-order Somos sequence versus the 5th-order Somos sequence:

In[4]:=
data = Table[{ResourceFunction["SomosSequence"][n, 4], ResourceFunction["SomosSequence"][n, 5]}, {n, 1, 75}];
ListLogLogPlot[data]
Out[5]=

Find the scaling exponent:

In[6]:=
ResourceFunction["FitPowerLaw"][data]["ExponentAround"]
Out[6]=

Publisher

SHuisman

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.1.0 – 08 May 2023
  • 1.0.0 – 24 April 2023

License Information