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.

Showing 1-10 of 10 results.

A089028 a(n) = n+1 where the Hofstadter-Conway Delta A093878(n) >0, otherwise a(n) = 1.

Original entry on oeis.org

1, 3, 1, 5, 6, 1, 1, 9, 10, 11, 1, 13, 1, 1, 1, 17, 18, 19, 20, 1, 22, 23, 1, 25, 1, 1, 28, 1, 1, 1, 1, 33, 34, 35, 36, 37, 1, 39, 40, 41, 1, 43, 44, 1, 46, 1, 1, 49, 50, 1, 52, 1, 1, 55, 1, 1, 1, 59, 1, 1, 1, 1, 1, 65, 66, 67, 68, 69, 70, 1, 72, 73, 74, 75, 1, 77, 78, 79, 1, 81, 82, 1, 84, 1
Offset: 1

Views

Author

Roger L. Bagula, Nov 12 2003

Keywords

Crossrefs

Cf. A004001.

Programs

  • Mathematica
    Conway[n_Integer?Positive] := Conway[n] =Conway[Conway[n-1]] + Conway[n - Conway[n-1]] Conway[1] = Conway[2] = 1 digits=200 a=Table[If[Conway[n]-Conway[n-1]>0, n, 1], {n, 2, digits}]

A094215 a(n)=A093878(n)-floor(n/phi) where phi=(1+sqrt(5))/2.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 3, 2, 1, 1, 1, 0, 1, 1, 2, 2, 2, 3, 2, 3, 2, 1, 2, 2, 2, 3, 3, 3, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 4, 3, 3, 2, 1, 1, 1, 0, 1, 1, 2, 2, 2, 3, 3, 4, 3, 3, 4, 3, 3, 3, 2, 3
Offset: 1

Views

Author

Benoit Cloitre, May 27 2004

Keywords

Formula

a(A001519(n))=0

A094217 First differences of A093878.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1
Offset: 1

Views

Author

Benoit Cloitre, May 27 2004

Keywords

Formula

a(n)=A093878(n+1)-A093878(n)

A095772 Number of times n appears in A093878.

Original entry on oeis.org

2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 2, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 5, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 1, 1, 1, 1, 1, 6, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 1, 1, 1, 1, 1, 1, 7, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Benoit Cloitre, Jun 05 2004

Keywords

Crossrefs

Programs

  • PARI
    v=vector(1000,j,1);for(n=3,1000,g=v[v[v[n-1]]]+v[n-v[v[n-1]]];v[n]=g);a(n)=sum(i=1,3*n,if(v[i]-n,0,1))

Formula

a(A000045(n)-1) = n-4 for n>4.

A004001 Hofstadter-Conway $10000 sequence: a(n) = a(a(n-1)) + a(n-a(n-1)) with a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 26, 26, 27, 27, 27, 28, 29, 29, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42
Offset: 1

Views

Author

Keywords

Comments

On Jul 15 1988 during a colloquium talk at Bell Labs, John Conway stated that he could prove that a(n)/n -> 1/2 as n approached infinity, but that the proof was extremely difficult. He therefore offered $100 to someone who could find an n_0 such that for all n >= n_0, we have |a(n)/n - 1/2| < 0.05, and he offered $10,000 for the least such n_0. I took notes (a scan of my notebook pages appears below), plus the talk - like all Bell Labs Colloquia at that time - was recorded on video. John said afterwards that he meant to say $1000, but in fact he said $10,000. I was in the front row. The prize was claimed by Colin Mallows, who agreed not to cash the check. - N. J. A. Sloane, Oct 21 2015
a(n) - a(n-1) = 0 or 1 (see the D. Newman reference). - Emeric Deutsch, Jun 06 2005
a(A188163(n)) = n and a(m) < n for m < A188163(n). - Reinhard Zumkeller, Jun 03 2011
From Daniel Forgues, Oct 04 2019: (Start)
Conjectures:
a(n) = n/2 iff n = 2^k, k >= 1.
a(n) = 2^(k-1): k times, for n = 2^k - (k-1) to 2^k, k >= 1. (End)

Examples

			If n=4, 2^4=16, a(16-i) = 2^(4-1) = 8 for 0 <= i <= 4-1 = 3, hence a(16)=a(15)=a(14)=a(13)=8.
		

References

  • J. Arkin, D. C. Arney, L. S. Dewald and W. E. Ebel, Jr., Families of recursive sequences, J. Rec. Math., 22 (No. 22, 1990), 85-94.
  • B. W. Conolly, Meta-Fibonacci sequences, in S. Vajda, editor, "Fibonacci and Lucas Numbers and the Golden Section", Halstead Press, NY, 1989, pp. 127-138.
  • R. K. Guy, Unsolved Problems Number Theory, Sect. E31.
  • D. R. Hofstadter, personal communication.
  • C. A. Pickover, Wonders of Numbers, "Cards, Frogs and Fractal sequences", Chapter 96, pp. 217-221, Oxford Univ. Press, NY, 2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Cf. A005229, A005185, A080677, A088359, A087686, A093879 (first differences), A265332, A266341, A055748 (a chaotic cousin), A188163 (greedy inverse).
Cf. A004074 (A249071), A005350, A005707, A093878. Different from A086841. Run lengths give A051135.
Cf. also permutations A267111-A267112 and arrays A265901, A265903.

Programs

  • Haskell
    a004001 n = a004001_list !! (n-1)
    a004001_list = 1 : 1 : h 3 1  {- memoization -}
      where h n x = x' : h (n + 1) x'
              where x' = a004001 x + a004001 (n - x)
    -- Reinhard Zumkeller, Jun 03 2011
    
  • Magma
    [n le 2 select 1 else Self(Self(n-1))+ Self(n-Self(n-1)):n in [1..75]]; // Marius A. Burtea, Aug 16 2019
    
  • Maple
    A004001 := proc(n) option remember; if n<=2 then 1 else procname(procname(n-1)) +procname(n-procname(n-1)); fi; end;
  • Mathematica
    a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Table[ a[n], {n, 1, 75}] (* Robert G. Wilson v *)
  • PARI
    a=vector(100);a[1]=a[2]=1;for(n=3,#a,a[n]=a[a[n-1]]+a[n-a[n-1]]);a \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    first(n)=my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); v \\ Charles R Greathouse IV, Feb 26 2017
    
  • Python
    def a004001(n):
        A = {1: 1, 2: 1}
        c = 1 #counter
        while n not in A.keys():
            if c not in A.keys():
                A[c] = A[A[c-1]] + A[c-A[c-1]]
            c += 1
        return A[n]
    # Edward Minnix III, Nov 02 2015
    
  • SageMath
    @CachedFunction
    def a(n): # a = A004001
        if n<3: return 1
        else: return a(a(n-1)) + a(n-a(n-1))
    [a(n) for n in range(1,101)] # G. C. Greubel, Apr 25 2024
  • Scheme
    ;; An implementation of memoization-macro definec can be found for example from: http://oeis.org/wiki/Memoization
    (definec (A004001 n) (if (<= n 2) 1 (+ (A004001 (A004001 (- n 1))) (A004001 (- n (A004001 (- n 1)))))))
    ;; Antti Karttunen, Oct 22 2014
    

Formula

Limit_{n->infinity} a(n)/n = 1/2 and as special cases, if n > 0, a(2^n-i) = 2^(n-1) for 0 <= i < = n-1; a(2^n+1) = 2^(n-1) + 1. - Benoit Cloitre, Aug 04 2002 [Corrected by Altug Alkan, Apr 03 2017]

A117567 Riordan array ((1+x^2)/(1-x^3),x).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1
Offset: 0

Views

Author

Paul Barry, Mar 29 2006

Keywords

Comments

Sequence array for the sequence F(L((n+2)/3)).

Examples

			Triangle begins:
n\k|  0  1  2  3  4  5  6  7  8  9
---+--------------------------------
0  |  1,
1  |  0, 1,
2  |  1, 0, 1,
3  |  1, 1, 0, 1,
4  |  0, 1, 1, 0, 1,
5  |  1, 0, 1, 1, 0, 1,
6  |  1, 1, 0, 1, 1, 0, 1,
7  |  0, 1, 1, 0, 1, 1, 0, 1,
8  |  1, 0, 1, 1, 0, 1, 1, 0, 1,
9  |  1, 1, 0, 1, 1, 0, 1, 1, 0, 1
etc. Row and column numbering added by _Antti Karttunen_, Jan 19 2025
		

References

  • Murat Sahin and Elif Tan, Conditional (strong) divisibility sequences, Fib. Q., 56 (No. 1, 2018), 18-31.

Crossrefs

Row sums are A093878. Diagonal sums are A051275. Inverse is A117568.

Programs

  • PARI
    up_to = 119;
    A117567tr0(n,k) = abs(kronecker((n-k+2), 3)); \\ We could also use fibonacci instead of abs
    A117567list(up_to) = { my(v = vector(1+up_to), i=0); for(n=0,oo, for(k=0,n, i++; if(i > 1+up_to, return(v)); v[i] = A117567tr0(n,k))); (v); };
    v117567 = A117567list(up_to);
    A117567(n) = v117567[1+n]; \\ Antti Karttunen, Jan 19 2025

Formula

Number triangle T(n,k) = F(L((n-k+2)/3))[k<=n] where L(j/p) is the Legendre symbol of j and p.
In the above, I assume that F stands for Fibonacci sequence (A000045), which in domain {-1, 0, 1} reduces to taking the absolute value of the argument. - Antti Karttunen, Jan 19 2025

Extensions

Data section extended up to a(119) [15 rows of triangle] by Antti Karttunen, Jan 19 2025

A095769 a(1)=a(2)=1; a(n)=a(a(a(a(n-1))))+a(n-a(a(a(n-1)))).

Original entry on oeis.org

1, 1, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 17, 17, 17, 18, 19, 19, 20, 21, 22, 23, 24, 25, 26, 26, 26, 26, 27, 28, 28, 29, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 39, 39, 39, 39, 39, 40, 41, 41, 42, 43, 44, 45, 46, 47, 47, 48, 48, 48, 49, 50, 51, 52
Offset: 1

Views

Author

Benoit Cloitre, Jun 05 2004

Keywords

Comments

A generalization of A004001.

Crossrefs

Programs

  • PARI
    v=vector(150,j,1);for(n=3,150,g=v[v[v[v[n-1]]]]+v[n-v[v[v[n-1]]]];v[n]=g);a(n)=v[n]

Formula

For n > 1, a(A000930(n)) = A000930(n-1).
Conjecture: lim_{n->oo} a(n)/n = 0.682327803828... (the real positive root of x^3 + x = 1).

A095770 First differences of A095769.

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0
Offset: 1

Views

Author

Benoit Cloitre, Jun 05 2004

Keywords

Crossrefs

Programs

  • PARI
    v=vector(150,j,1);for(n=3,150,g=v[v[v[v[n-1]]]]+v[n-v[v[v[n-1]]]];v[n]=g);a(n)=v[n+1]-v[n]

A095771 Number of times n appears in A095769.

Original entry on oeis.org

2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 5, 1, 2, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Benoit Cloitre, Jun 05 2004

Keywords

Crossrefs

Programs

  • PARI
    v=vector(1000,j,1);for(n=3,1000,g=v[v[v[v[n-1]]]]+v[n-v[v[v[n-1]]]];v[n]=g);a(n)=sum(i=1,3*n,if(v[i]-n,0,1))

Formula

a(n) = card{ k in N : A095769(k)=n }.

A320063 A sequence which changes by one or zero: a(n) = a(n-1-a(a(n-1))) + a(a(a(n-1))) for n > 1, a(n) = n for n < 2.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 6, 6, 6, 7, 8, 8, 8, 8, 9, 10, 10, 10, 10, 11, 12, 12, 13, 13, 13, 13, 14, 15, 15, 15, 16, 17, 17, 17, 17, 18, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 22, 23, 23, 23, 24, 24, 25, 26, 27, 27, 27, 27, 27, 28, 28, 29, 29, 29
Offset: 0

Views

Author

David S. Newman, Oct 04 2018

Keywords

Comments

This is similar to a problem that I had in the Monthly 35 years ago. The solution then was by Daniel Kleitman.

Crossrefs

Cf. A093878.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n,
          a(n-1-a(a(n-1)))+a(a(a(n-1))))
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Oct 08 2018
  • Mathematica
    f[0] = 0;
    f[1] = 1;
    f[n_] := f[n] = +f[n - 1 - f[f[n - 1]]] + f[f[f[n - 1]]];
    Table[f[i], {i, 1, 30}]
Showing 1-10 of 10 results.