inputL={-1,1,2,3,0,0,1,3,10,-8,1,2,3,-1,-2};

sub[{___,a_,m___,a_,___}]:=Length[{m}]

sub[inputL]

lhs->rhs   (* replacement rule *)

ReplaceList[
inputL,
{l___,a_,m___,a_,r___}->{{a},m,{a}}
]//ColumnForm

ReplaceList[
inputL,
{l___,a_,m___,a_,r___}:>Length[{m}]
]//ColumnForm

exp1->exp2

exp1->exp2//FullForm

x=3+a

x /.a->5

x

x=x/.a->5

x

x=3+a

x/. 3->5

3+3+a/. 3->5

3+a/.3->5

x

x /. a->x

x

x+y/. a-> y

a/.{a->2,a->4}

a/.{{a->2},{a->4}}

x+y/.{a->y,y->4}

//.

x+y//.{a->y,y->4}

x+y//.{a->y,y->a}

((x+y/.{a->y,y->a})/.{a->y,y->a})/.{a->y,y->a}

x+y//.{a->y,y->2a}

x+y/.{a->y,y->2a}
(x+y/.{a->y,y->2a})/.{a->y,y->2a}
((x+y/.{a->y,y->2a})/.{a->y,y->2a})/.{a->y,y->2a}

{3 a, a^2,3^a,a^a,a!}/.a->z

{3 a, a^2,3^a,a^a,a!}/.a->4

{3 a, a^2,3^a,a^a,a!}/.a->4.

{3 a, a^2,3^a,a^a,a!}/.a^_->Infinity

{3 a, a^2,3^a,a^a,a!}/._^_->Infinity

FullForm[a^_]

FullForm[a]

{3 a, a^2,3^a,a^a,a!}/.a_^b_->b^a

{3 a, (2+Pi)^2,3^(Sin[4]+xyz),a^a,a!}/.a_^b_->b^a

dif[a b]-> dif[a] b + a dif[b]
dif[a+ b]-> dif[a] + dif[b]

exp/.{dif[a b]-> dif[a] b + a dif[b]
dif[a+ b]-> dif[a] + dif[b]}

Clear[x]

p[x_]:=3 x^3-2x+4

sols=NSolve[p[x]==0,x]

p[x]/.sols[[2]]

p'[x]/.sols[[2]]

-3.6129685150952637`-9.083845367153287`

Plot[p[x],{x,-2,2}]

Solve, NSolve, Root,

?NSolve

Minimize[x^2+4,x]

Options[Plot]

Plot[p[Sin[x]],{x,-Pi,2},GridLines->Automatic,AspectRatio->Automatic,PlotRange ->{{-3,0},{2.8,3.2}}]

Plot3D[x^2 +Sin[12y],{x,-2,-1},{y,1,2}]

ParametricPlot[
{Sin[u] u,Cos[u] u},
{u,0,100}
]

Options[ParametricPlot]

ParametricPlot[
{Sin[u] u,Cos[u] u},
{u,0,100},
PlotPoints->125,
Axes->False,
MaxRecursion->0,
PlotStyle->Thick,
ColorFunction->(ColorData["Rainbow"][#3]&)
]

options[program]={option1->default1,option2->default2}

Options[Sin]

Options[Solve]

program[arg1_,arg2_,opts___]:=
definition/.Join[{opts},options[program]]

Join[{o1->e1,o2->e2},{o1->d1,o2->d2,o3->d3}]

program[arg1_,arg2_,opts___]:=
(definition/.{opts})/.options[program]

list=RandomInteger[10,{30}]

consecutive numbers, difference of 5

ReplaceList[
list,
{___,a_,b_,___}/;Abs[a-b]==5->{a,b}
]

list/.{___,a_,b_,___}/;Abs[a-b]==5->{a,b}

ReplaceList[
list,
{___,a_,b_,___}/;(a-b==5||b-a==5)->{a,b}
]

ReplaceList[
{1,2,3,4,5,6},
{x___,y___,z_}->{{x},{y},{z}}
]//ColumnForm

ReplaceList[
{1,2,3,4,5,6},
{x___,y__,z_}->{{x},{y},{z}}
]//ColumnForm

list=RandomInteger[10,{50}]

ReplaceList[
list,
{___,sub__,___}/;Apply[Plus,{sub}]==24->{sub}
]//Length

list=RandomInteger[5,{200}];

Map[
{#,
Length[
ReplaceList[
list,
{___,sub__,___}/;Apply[Plus,{sub}]==#->{sub}
]
]
}&,
Range[10,300]
]//ListPlot

Clear[f]

f[a___,b___]:=Length[{b}]

f[1,2,3,4]

{1,2,3,4}/.{a___,b___}:>{b,Length[{b}]}