OFFSET
1,4
COMMENTS
An infinite sequence of Langford pairs.
REFERENCES
D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7, p. 36.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10946
MAPLE
A000201 := proc(n) option remember; floor(n*(1+sqrt(5))/2) ; end proc:
A193564aux := proc(n, piv) local oc, j ; oc := 0 ; for j from 0 to n do if A014675(j) = piv then oc := oc+1 ; end if; end do: oc ; end proc:
A193564 := proc(n) local piv, oc ; piv := A014675(n-1) ; oc := A193564aux(n-1, piv) ; oc-1 ; end proc:
seq(A193564(n), n=1..80) ; # R. J. Mathar, Aug 18 2011
MATHEMATICA
Module[{a = 0, b = 0}, ReplaceAll[SubstitutionSystem[{1 -> {2}, 2 -> {2, 1}}, {1}, {10}][[1]], {1 :> a++, 2 :> b++}]] (* Paolo Xausa, Aug 01 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 04 2011
STATUS
approved