Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #28 May 20 2024 02:32:28
%S 0,1,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,1,1,0,1,1,0,1,0,0,1,0,0,0,0,1,1,1,
%T 1,1,0,1,1,1,0,1,1,0,1,0,0,1,1,0,1,0,0,1,0,0,0,1,0,0,0,0,0,1,1,1,1,1,
%U 1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,0,0,1,1,1,0,1,1,0,1,0,0,1,1,0,1,0,0,1,0,0,0
%N First differences of A004001.
%C All the terms are 0 or 1: it is easy to show that if {b(n)} = A004001, b(n)>=b(n-1) and b(n)<n, therefore the first differences form an infinite binary word. - _Benoit Cloitre_, Jun 05 2004
%H R. J. Mathar, <a href="/A093879/b093879.txt">Table of n, a(n) for n = 1..9999</a>
%H J. Grytczuk, <a href="http://dx.doi.org/10.1016/j.disc.2003.10.022">Another variation on Conway's recursive sequence</a>, Discr. Math. 282 (2004), 149-161.
%H D. Newman, <a href="http://www.jstor.org/stable/2322766">Problem E3274</a>, Amer. Math. Monthly, 95 (1988), 555.
%F From _Antti Karttunen_, Jan 18 2016: (Start)
%F a(n) = A004001(n+1) - A004001(n).
%F Other identities. For all n >= 1:
%F a(A087686(n+1)-1) = 0.
%F a(A088359(n)-1) = 1.
%F a(n) = 1 if and only if A051135(n+1) = 1.
%F (End)
%t a[1] = a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; t = Table[a[n], {n, 110}]; Drop[t, 1] - Drop[t, -1] (* _Robert G. Wilson v_, May 28 2004 *)
%o (PARI) {m=106;v=vector(m,j,1);for(n=3,m,a=v[v[n-1]]+v[n-v[n-1]];v[n]=a);for(n=2,m,print1(v[n]-v[n-1],","))}
%o (Scheme) (define (A093879 n) (- (A004001 (+ 1 n)) (A004001 n))) ;; Code for A004001 given in that entry. - _Antti Karttunen_, Jan 18 2016
%o (Magma)
%o h:=[n le 2 select 1 else Self(Self(n-1)) + Self(n-Self(n-1)): n in [1..160]];
%o A093879:= func< n | h[n+1] - h[n] >;
%o [A093879(n): n in [1..120]]; // _G. C. Greubel_, May 19 2024
%o (SageMath)
%o @CachedFunction
%o def h(n): return 1 if (n<3) else h(h(n-1)) + h(n - h(n-1))
%o def A093879(n): return h(n+1) - h(n)
%o [A093879(n) for n in range(1,101)] # _G. C. Greubel_, May 19 2024
%Y Cf. A004001, A051135, A087686, A088359, A188163.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_, May 27 2004
%E More terms and PARI code from _Klaus Brockhaus_ and _Robert G. Wilson v_, May 27 2004