This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A193564 #21 Aug 01 2024 09:16:33 %S A193564 0,0,1,2,1,3,2,4,5,3,6,7,4,8,5,9,10,6,11,7,12,13,8,14,15,9,16,10,17, %T A193564 18,11,19,20,12,21,13,22,23,14,24,15,25,26,16,27,28,17,29,18,30,31,19, %U A193564 32,20,33,34,21,35,36,22,37,23,38,39,24,40,41,25,42 %N A193564 In A014675, replace the n-th occurrence of 1 with n-1 and also replace the n-th occurrence of 2 with n-1. %C A193564 An infinite sequence of Langford pairs. %D A193564 D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7, p. 36. %H A193564 Paolo Xausa, <a href="/A193564/b193564.txt">Table of n, a(n) for n = 1..10946</a> %p A193564 A000201 := proc(n) option remember; floor(n*(1+sqrt(5))/2) ; end proc: %p A193564 A014675 := proc(n) A000201(n+2)-A000201(n+1) ; end proc: %p A193564 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: %p A193564 A193564 := proc(n) local piv,oc ; piv := A014675(n-1) ; oc := A193564aux(n-1,piv) ; oc-1 ; end proc: %p A193564 seq(A193564(n),n=1..80) ; # _R. J. Mathar_, Aug 18 2011 %t A193564 Module[{a = 0, b = 0}, ReplaceAll[SubstitutionSystem[{1 -> {2}, 2 -> {2, 1}}, {1}, {10}][[1]], {1 :> a++, 2 :> b++}]] (* _Paolo Xausa_, Aug 01 2024 *) %Y A193564 Cf. A014552, A014675. %K A193564 nonn %O A193564 1,4 %A A193564 _N. J. A. Sloane_, Aug 04 2011