Basic Examples 
(2)
 

Let
u=1
and
v=1
. Call the sequence
s
n
. Then
s
1
=1
and
s
2
=2
:
In[14]:=
[◼]
UlamSequence
[2,{1,2}]
Out[14]=
{1,2}
For term 3, there is only one sum,
3=1+2
, so
s
3
=3
:
In[15]:=
[◼]
UlamSequence
[3,{1,2}]
Out[15]=
{1,2,3}
For term 4, only the sum
1+3
gives
4
, so
s
4
=4
. The sum
2+2
is not a sum of unique previous terms:
In[16]:=
[◼]
UlamSequence
[4,{1,2}]
Out[16]=
{1,2,3,4}
For term 5, the two sums
1+4
and
2+3
give
5
, so
s
5
≠5
. The sum
2+4
is
6
; the sum
1+2+3=6
has more than one summand, so
s
5
=6
:
In[17]:=
[◼]
UlamSequence
[6,{1,2}]
Out[17]=
{1,2,3,4,6}
———
Here are the terms up to 1000:
In[18]:=
[◼]
UlamSequence
[1000,{1,2}]
Out[18]=
{1,2,3,4,6,8,11,13,16,18,26,28,36,38,47,48,53,57,62,69,72,77,82,87,97,99,102,106,114,126,131,138,145,148,155,175,177,180,182,189,197,206,209,219,221,236,238,241,243,253,258,260,273,282,309,316,319,324,339,341,356,358,363,370,382,390,400,402,409,412,414,429,431,434,441,451,456,483,485,497,502,522,524,544,546,566,568,585,602,605,607,612,624,627,646,668,673,685,688,690,695,720,722,732,734,739,751,781,783,798,800,820,847,849,861,864,866,891,893,905,927,949,983,986,991}
The plot is wrinkly:
In[64]:=
ListLinePlot[%]
Out[64]=
0
20
40
60
80
100
120
200
400
600
800
1000

Scope 
(2)
 
