1,4

A solution to recursion of Mallows's sequence (A005229).

Table of n, a(n) for n=1..81.

Altug Alkan, Plot of n/2 - a(n) for n <= 7*2^10.

a(n+1) - a(n) = 0 or 1 for all n >= 1.

a[1] = a[2] = a[3] = 1; a[n_] := a[n] = a[a[n - 2]] + a[n - a[n - 2]]; Array[a, 81] (* Michael De Vlieger, Jun 11 2018 *)

(PARI) a=vector(100); a[1]=a[2]=a[3]=1; for(n=4, #a, a[n] = a[a[n-2]] + a[n-a[n-2]]); a

Cf. A004001, A005229, A005350.

Sequence in context: A037037 A156262 A218447 * A120565 A244989 A296021

Adjacent sequences: A305842 A305843 A305844 * A305846 A305847 A305848

nonn,easy

Altug Alkan, Jun 11 2018

approved