cp's OEIS Frontend

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.

A093879 First differences of A004001.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

N. J. A. Sloane, May 27 2004

Keywords

Comments

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)Benoit Cloitre, Jun 05 2004

Crossrefs

Programs

  • Magma
    h:=[n le 2 select 1 else Self(Self(n-1)) + Self(n-Self(n-1)): n in [1..160]];
    A093879:= func< n | h[n+1] - h[n] >;
    [A093879(n): n in [1..120]]; // G. C. Greubel, May 19 2024
    
  • Mathematica
    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 *)
  • 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],","))}
    
  • SageMath
    @CachedFunction
    def h(n): return 1 if (n<3) else h(h(n-1)) + h(n - h(n-1))
    def A093879(n): return h(n+1) - h(n)
    [A093879(n) for n in range(1,101)] # G. C. Greubel, May 19 2024
  • Scheme
    (define (A093879 n) (- (A004001 (+ 1 n)) (A004001 n))) ;; Code for A004001 given in that entry. - Antti Karttunen, Jan 18 2016
    

Formula

From Antti Karttunen, Jan 18 2016: (Start)
a(n) = A004001(n+1) - A004001(n).
Other identities. For all n >= 1:
a(A087686(n+1)-1) = 0.
a(A088359(n)-1) = 1.
a(n) = 1 if and only if A051135(n+1) = 1.
(End)

Extensions

More terms and PARI code from Klaus Brockhaus and Robert G. Wilson v, May 27 2004