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 16 results. Next

A265332 a(n) is the index of the column in A265901 where n appears; also the index of the row in A265903 where n appears.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 09 2016

Keywords

Comments

If all 1's are deleted, the remaining terms are the sequence incremented. - after Franklin T. Adams-Watters Oct 05 2006 comment in A051135.
Ordinal transform of A162598.

Examples

			Illustration how the sequence can be constructed by concatenating the frequency counts Q_n of each successive level n of A004001-tree:
--
             1                                      Q_0 = (1)
             |
            _2__                                    Q_1 = (2)
           /    \
         _3    __4_____                             Q_2 = (1,3)
        /     /  |     \
      _5    _6  _7    __8___________                Q_3 = (1,1,2,4)
     /     /   / |   /  |  \        \
   _9    10  11 12  13  14  15___    16_________    Q_4 = (1,1,1,2,1,2,3,5)
  /     /   /  / |  /  / |   |\  \   | \  \  \  \
17    18  19 20 21 22 23 24 25 26 27 28 29 30 31 32
--
The above illustration copied from the page 229 of Kubo and Vakil paper (page 5 in PDF).
		

Crossrefs

Essentially same as A051135 apart from the initial term, which here is set as a(1)=1.
Cf. A162598 (corresponding other index).
Cf. A265754.
Cf. also A267108, A267109, A267110.

Programs

  • Mathematica
    terms = 120;
    h[1] = 1; h[2] = 1;
    h[n_] := h[n] = h[h[n - 1]] + h[n - h[n - 1]];
    seq[nmax_] := seq[nmax] = (Length /@ Split[Sort @ Array[h, nmax, 2]])[[;; terms]];
    seq[nmax = 2 terms];
    seq[nmax += terms];
    While[seq[nmax] != seq[nmax - terms], nmax += terms];
    seq[nmax] (* Jean-François Alcover, Dec 19 2021 *)
  • Scheme
    (define (A265332 n) (if (= 1 n) 1 (A051135 n)))

Formula

a(1) = 1; for n > 1, a(n) = A051135(n).

A266109 a(n) = A087686(1+A188163(n)); second column of A265901, second row of A265903.

Original entry on oeis.org

2, 7, 12, 14, 21, 24, 26, 29, 38, 42, 45, 47, 51, 53, 56, 60, 71, 76, 80, 83, 85, 90, 93, 95, 99, 101, 104, 109, 111, 114, 118, 123, 136, 142, 147, 151, 154, 156, 162, 166, 169, 171, 176, 179, 181, 185, 187, 190, 196, 199, 201, 205, 207, 210, 215, 217, 220, 224, 230, 232, 235, 239, 244, 250, 265, 272
Offset: 1

Views

Author

Antti Karttunen, Jan 12 2016

Keywords

Crossrefs

Formula

a(n) = A087686(1+A188163(n)).

A265900 Main diagonal of arrays A265901 and A265903.

Original entry on oeis.org

1, 7, 27, 62, 227, 496, 1013, 2045, 7893, 16226, 32650, 65414, 131026, 262109, 524267, 1048572
Offset: 1

Views

Author

Antti Karttunen, Jan 09 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A265901(n,n) = A265903(n,n).

A265909 Submain diagonal of array A265903: a(n) = A265903(n+1, n).

Original entry on oeis.org

2, 15, 58, 126, 475, 1006, 2036, 4093, 16006, 32584, 65402, 130934, 262095, 524251, 1048554, 2097148
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A265903(n+1, n).

A267103 Row 3 of A265903; numbers that occur exactly three times in A004001.

Original entry on oeis.org

4, 15, 27, 30, 48, 54, 57, 61, 86, 96, 102, 105, 112, 115, 119, 124, 157, 172, 182, 188, 191, 202, 208, 211, 218, 221, 225, 233, 236, 240, 245, 251, 293, 314, 329, 339, 345, 348, 364, 374, 380, 383, 394, 400, 403, 410, 413, 417, 429, 435, 438, 445, 448, 452, 460, 463, 467, 472, 481, 484, 488, 493, 499, 506, 558
Offset: 1

Views

Author

Antti Karttunen, Jan 18 2016

Keywords

Comments

Numbers n for which A051135(n) = 3.

Crossrefs

Column 3 of A265901, row 3 of A265903.

Formula

a(n) = A087686(1+A266109(n)) = A087686(1+A087686(1+A188163(n))).

A267104 Inverse permutation to A265903.

Original entry on oeis.org

1, 3, 2, 6, 4, 7, 5, 10, 11, 16, 22, 8, 29, 12, 9, 15, 37, 46, 56, 67, 17, 79, 92, 23, 106, 30, 13, 121, 38, 18, 14, 21, 137, 154, 172, 191, 211, 47, 232, 254, 277, 57, 301, 326, 68, 352, 80, 24, 379, 407, 93, 436, 107, 31, 466, 122, 39, 19, 497, 138, 48, 25, 20, 28, 529, 562, 596, 631, 667, 704, 155, 742, 781, 821
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2016

Keywords

Crossrefs

Inverse: A265903.

Programs

  • Scheme
    (define (A267104 n) (let ((col (A162598 n)) (row (A265332 n))) (* (/ 1 2) (- (expt (+ row col) 2) row col col col -2))))

Formula

a(n) = (1/2) * ((c+r)^2 - r - 3*c + 2), where c = A162598(n), and r = A265332(n).

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]

A087686 Elements of A004001 that repeat consecutively.

Original entry on oeis.org

1, 2, 4, 7, 8, 12, 14, 15, 16, 21, 24, 26, 27, 29, 30, 31, 32, 38, 42, 45, 47, 48, 51, 53, 54, 56, 57, 58, 60, 61, 62, 63, 64, 71, 76, 80, 83, 85, 86, 90, 93, 95, 96, 99, 101, 102, 104, 105, 106, 109, 111, 112, 114, 115, 116, 118, 119, 120, 121, 123, 124, 125, 126, 127
Offset: 1

Views

Author

Roger L. Bagula, Sep 27 2003

Keywords

Comments

Complement of A088359; A051135(a(n)) > 1. [Reinhard Zumkeller, Jun 03 2011]
From Antti Karttunen, Jan 18 2016: (Start)
This set of numbers is closed with respect to A004001, see A266188.
After 1, one more than the positions of zeros in A093879.
(End)

Crossrefs

Cf. A088359 (complement), A188163 (almost complement).
Cf. A080677 (the least monotonic left inverse).

Programs

  • Haskell
    import Data.List (findIndices)
    a087686 n = a087686_list !! (n-1)
    a087686_list = map succ $ findIndices (> 1) a051135_list
    -- Reinhard Zumkeller, Jun 03 2011
    (Scheme, with Antti Karttunen's IntSeq-library)
    (define A087686 (MATCHING-POS 1 1 (lambda (n) (> (A051135 n) 1))))
    ;; Antti Karttunen, Jan 18 2016
  • Mathematica
    Conway[n_Integer?Positive] := Conway[n] =Conway[Conway[n-1]] + Conway[n - Conway[n-1]] Conway[1] = Conway[2] = 1 digits=1000 a=Table[Conway[n], {n, 1, digits}]; b=Table[If[a[[n]]-a[[n-1]]==0, a[[n]], 0], {n, 2, digits}]; c=Delete[Union[b], 1]

Formula

Other identities. For all n >= 1:
A080677(a(n)) = n. [See comments in A080677.]

A267111 Permutation of natural numbers: a(1) = 1, a(A087686(n)) = 2*a(n-1), a(A088359(n)) = 1+2*a(n), where A088359 and A087686 = numbers that occur only once (resp. more than once) in A004001, the Hofstadter-Conway $10000 sequence.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 6, 8, 9, 11, 15, 10, 13, 14, 12, 16, 17, 19, 23, 31, 18, 21, 27, 22, 29, 30, 20, 25, 26, 28, 24, 32, 33, 35, 39, 47, 63, 34, 37, 43, 55, 38, 45, 59, 46, 61, 62, 36, 41, 51, 42, 53, 54, 44, 57, 58, 60, 40, 49, 50, 52, 56, 48, 64, 65, 67, 71, 79, 95, 127, 66, 69, 75, 87, 111, 70, 77, 91, 119, 78, 93, 123
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2016

Keywords

Crossrefs

Inverse: A267112.
Similar or related permutations: A006068, A054429, A276441, A233275, A233277, A276343, A276345, A276445.
Cf. also permutations A266411, A266412 and arrays A265901, A265903.

Formula

a(1) = 1; for n > 1, if A093879(n-1) = 0 [when n is in A087686], a(n) = 2*a(A080677(n)-1), otherwise [when n is in A088359], a(n) = 1 + 2*a(A004001(n)-1).
Equally, for n > 1, if A093879(n-1) = 0, a(n) = 2*a(n - A004001(n)), otherwise a(n) = 1 + 2*a(A004001(n)-1). [Above formula in a more symmetric form.]
As a composition of other permutations:
a(n) = A054429(A276441(n)).
a(n) = A233275(A276343(n)).
a(n) = A233277(A276345(n)).
a(n) = A006068(A276445(n)).
Other identities. For all n >= 0:
a(2^n) = 2^n. [Follows from the properties (3) and (4) of A004001 given on page 227 of Kubo & Vakil paper.]

A051135 a(n) = number of times n appears in the Hofstadter-Conway $10000 sequence A004001.

Original entry on oeis.org

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

Views

Author

Robert Lozyniak (11(AT)onna.com)

Keywords

Comments

If the initial 2 is changed to a 1, the resulting sequence (A265332) has the property that if all 1's are deleted, the remaining terms are the sequence incremented. - Franklin T. Adams-Watters, Oct 05 2006
a(A088359(n)) = 1 and a(A087686(n)) > 1; first differences of A188163. - Reinhard Zumkeller, Jun 03 2011
From Robert G. Wilson v, Jun 07 2011: (Start)
a(k)=1 for k = 3, 5, 6, 9, 10, 11, 13, 17, 18, 19, 20, 22, 23, 25, 28, ..., ; (A088359)
a(k)=2 for k = 1, 2, 7, 12, 14, 21, 24, 26, 29, 38, 42, 45, 47, 51, 53, ..., ; (1 followed by A266109)
a(k)=3 for k = 4, 15, 27, 30, 48, 54, 57, 61, 86, 96, 102, 105, 112, ..., ; (A267103)
a(k)=4 for k = 8, 31, 58, 62, 106, 116, 120, 125, 192, 212, 222, 226, ..., ;
a(k)=5 for k = 16, 63, 121, 126, 227, 242, 247, 253, 419, 454, 469, ..., ;
a(k)=6 for k = 32, 127, 248, 254, 475, 496, 502, 509, 894, 950, 971, ..., ;
a(k)=7 for k = 64, 255, 503, 510, 978, 1006, 1013, 1021, 1872, 1956, ..., ;
a(k)=8 for k = 128, 511, 1014, 1022, 1992, 2028, 2036, 2045, 3864, ..., ;
a(k)=9 for k = 256, 1023, 2037, 2046, 4029, 4074, 4083, 4093, 7893, ..., ;
a(k)=10 for k = 512, 2047, 4084, 4094, 8113, 8168, 8178, 8189, ..., . (End)
Compare above to array A265903. - Antti Karttunen, Jan 18 2016

Crossrefs

Cf. A088359 (positions of ones).
Cf. A265332 (essentially the same sequence, but with a(1) = 1 instead of 2).

Programs

  • Haskell
    import Data.List (group)
    a051135 n = a051135_list !! (n-1)
    a051135_list = map length $ group a004001_list
    -- Reinhard Zumkeller, Jun 03 2011
    
  • Magma
    nmax:=200;
    h:=[n le 2 select 1 else Self(Self(n-1)) + Self(n - Self(n-1)): n in [1..5*nmax]]; // h = A004001
    A188163:= function(n)
       for j in [1..3*nmax+1] do
           if h[j] eq n then return j; end if;
       end for;
    end function;
    A051135:= func< n | A188163(n+1) - A188163(n) >;
    [A051135(n): n in [1..nmax]]; // G. C. Greubel, May 20 2024
    
  • Maple
    a[1]:=1: a[2]:=1: for n from 3 to 300 do a[n]:=a[a[n-1]]+a[n-a[n-1]] od: A:=[seq(a[n],n=1..300)]:for j from 1 to A[nops(A)-1] do c[j]:=0: for n from 1 to 300 do if A[n]=j then c[j]:=c[j]+1 else fi od: od: seq(c[j],j=1..A[nops(A)-1]); # Emeric Deutsch, Jun 06 2006
  • Mathematica
    a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; t = Array[a, 250]; Take[ Transpose[ Tally[t]][[2]], 105] (* Robert G. Wilson v, Jun 07 2011 *)
  • SageMath
    @CachedFunction
    def h(n): return 1 if (n<3) else h(h(n-1)) + h(n - h(n-1)) # h=A004001
    def A188163(n):
        for j in range(1,2*n+1):
            if h(j)==n: return j
    def A051135(n): return A188163(n+1) - A188163(n)
    [A051135(n) for n in range(1,201)] # G. C. Greubel, May 20 2024
  • Scheme
    (define (A051135 n) (- (A188163 (+ 1 n)) (A188163 n))) ;; Antti Karttunen, Jan 18 2016
    

Formula

From Antti Karttunen, Jan 18 2016: (Start)
a(n) = A188163(n+1) - A188163(n). [after Reinhard Zumkeller's Jun 03 2011 comment above]
Other identities:
a(n) = 1 if and only if A093879(n-1) = 1. [See A188163 for a reason.]
(End)

Extensions

More terms from Jud McCranie
Added links (in parentheses) to recently submitted related sequences - Antti Karttunen, Jan 18 2016
Showing 1-10 of 16 results. Next