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 14 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).

A267102 Inverse permutation to A265901.

Original entry on oeis.org

1, 2, 3, 4, 6, 10, 5, 7, 15, 21, 28, 9, 36, 14, 8, 11, 45, 55, 66, 78, 20, 91, 105, 27, 120, 35, 13, 136, 44, 19, 12, 16, 153, 171, 190, 210, 231, 54, 253, 276, 300, 65, 325, 351, 77, 378, 90, 26, 406, 435, 104, 465, 119, 34, 496, 135, 43, 18, 528, 152, 53, 25, 17, 22, 561, 595, 630, 666, 703, 741, 170, 780, 820
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2016

Keywords

Crossrefs

Inverse: A265901.

Programs

  • Scheme
    (define (A267102 n) (let ((col (A265332 n)) (row (A162598 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 = A265332(n), and r = A162598(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.]

A265903 Square array read by descending antidiagonals: A(1,k) = A188163(k), and for n > 1, A(n,k) = A087686(1+A(n-1,k)).

Original entry on oeis.org

1, 3, 2, 5, 7, 4, 6, 12, 15, 8, 9, 14, 27, 31, 16, 10, 21, 30, 58, 63, 32, 11, 24, 48, 62, 121, 127, 64, 13, 26, 54, 106, 126, 248, 255, 128, 17, 29, 57, 116, 227, 254, 503, 511, 256, 18, 38, 61, 120, 242, 475, 510, 1014, 1023, 512, 19, 42, 86, 125, 247, 496, 978, 1022, 2037, 2047, 1024, 20, 45, 96, 192, 253, 502, 1006, 1992, 2046, 4084, 4095, 2048
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2015

Keywords

Comments

Square array A(n,k) [where n is row and k is column] is read by descending antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
For n >= 3, each row n lists the numbers that appear n times in A004001. See also A051135.

Examples

			The top left corner of the array:
     1,    3,    5,    6,     9,    10,    11,    13,    17,    18,    19
     2,    7,   12,   14,    21,    24,    26,    29,    38,    42,    45
     4,   15,   27,   30,    48,    54,    57,    61,    86,    96,   102
     8,   31,   58,   62,   106,   116,   120,   125,   192,   212,   222
    16,   63,  121,  126,   227,   242,   247,   253,   419,   454,   469
    32,  127,  248,  254,   475,   496,   502,   509,   894,   950,   971
    64,  255,  503,  510,   978,  1006,  1013,  1021,  1872,  1956,  1984
   128,  511, 1014, 1022,  1992,  2028,  2036,  2045,  3864,  3984,  4020
   256, 1023, 2037, 2046,  4029,  4074,  4083,  4093,  7893,  8058,  8103
   512, 2047, 4084, 4094,  8113,  8168,  8178,  8189, 16006, 16226, 16281
  1024, 4095, 8179, 8190, 16292, 16358, 16369, 16381, 32298, 32584, 32650
  ...
		

Crossrefs

Inverse permutation: A267104.
Transpose: A265901.
Row 1: A188163.
Row 2: A266109.
Row 3: A267103.
For the known and suspected columns, see the rows listed for transposed array A265901.
Cf. A265900 (main diagonal), A265909 (submain diagonal).
Cf. A162598 (column index of n in array), A265332 (row index of n in array).
Cf. also permutations A267111, A267112.

Programs

Formula

For the first row n=1, A(1,k) = A188163(k), for rows n > 1, A(n,k) = A087686(1+A(n-1,k)).

A188163 Smallest m such that A004001(m) = n.

Original entry on oeis.org

1, 3, 5, 6, 9, 10, 11, 13, 17, 18, 19, 20, 22, 23, 25, 28, 33, 34, 35, 36, 37, 39, 40, 41, 43, 44, 46, 49, 50, 52, 55, 59, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 84, 87, 88, 89, 91, 92, 94, 97, 98, 100, 103, 107, 108, 110, 113, 117, 122
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 03 2011

Keywords

Comments

How is this related to A088359? - R. J. Mathar, Jan 09 2013
It is not hard to show that a(n) exists for all n, and in particular a(n) < 2^n. - Charles R Greathouse IV, Jan 13 2013
From Antti Karttunen, Jan 10 & 18 2016: (Start)
Positions of records in A004001. After 1 the positions where A004001 increases (by necessity by one).
An answer to the question of R. J. Mathar above: This sequence is equal to A088359 with prepended 1. This follows because at each of its unique values (terms of A088359), A004001 must grow, but it can grow nowhere else. See Kubo and Vakil paper and especially the illustrations of Q and R-trees on pages 229-230 (pages 5 & 6 in PDF) and also in sequence A265332.
Obviously A004001 can obtain unique values only at points which form a subset (A266399) of this sequence.
(End)

Crossrefs

Equal to A088359 with prepended 1.
Column 1 of A265901, Row 1 of A265903.
Cf. A051135 (first differences).
Cf. A087686 (complement, apart from the initial 1).
Cf. A004001 (also the least monotonic left inverse of this sequence).
Cf. A266399 (a subsequence).

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a188163 n = succ $ fromJust $ elemIndex n a004001_list
    
  • Magma
    h:=[n le 2 select 1 else Self(Self(n-1)) + Self(n - Self(n-1)): n in [1..500]]; // h=A004001
    A188163:= function(n)
       for j in [1..2*n+1] do
           if h[j] eq n then return j; end if;
       end for;
    end function;
    [A188163(n): n in [1..100]]; // G. C. Greubel, May 20 2024
    
  • Maple
    A188163 := proc(n)
        for a from 1 do
            if A004001(a) = n then
                return a;
            end if;
        end do:
    end proc: # R. J. Mathar, May 15 2013
  • Mathematica
    h[1] = 1; h[2] = 1; h[n_] := h[n] = h[h[n-1]] + h[n - h[n-1]];
    a[n_] := For[m = 1, True, m++, If[h[m] == n, Return[m]]];
    Array[a, 64] (* Jean-François Alcover, Jan 27 2018 *)
  • 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+2):
            if h(j)==n: return j
    [A188163(n) for n in range(1,101)] # G. C. Greubel, May 20 2024
  • Scheme
    (define A188163 (RECORD-POS 1 1 A004001))
    ;; Code for A004001 given in that entry. Uses also my IntSeq-library. - Antti Karttunen, Jan 18 2016
    

Formula

Other identities. For all n >= 1:
A004001(a(n)) = n and A004001(m) < n for m < a(n).
A051135(n) = a(n+1) - a(n).

A267112 Permutation of natural numbers: a(1) = 1; a(2n) = A087686(1+a(n)), a(2n+1) = A088359(a(n)), where A088359 and A087686 = numbers that occur only once (resp. more than once) in A004001.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 6, 8, 9, 12, 10, 15, 13, 14, 11, 16, 17, 21, 18, 27, 22, 24, 19, 31, 28, 29, 23, 30, 25, 26, 20, 32, 33, 38, 34, 48, 39, 42, 35, 58, 49, 51, 40, 54, 43, 45, 36, 63, 59, 60, 50, 61, 52, 53, 41, 62, 55, 56, 44, 57, 46, 47, 37, 64, 65, 71, 66, 86, 72, 76, 67, 106, 87, 90, 73, 96, 77, 80, 68, 121, 107, 109, 88
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2016

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A087686(1+n), and each right hand child as A088359(n), when their parent contains n:
|
...................1...................
2 3
4......../ \........5 7......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
8 9 12 10 15 13 14 11
16 17 21 18 27 22 24 19 31 28 29 23 30 25 26 20
etc.
The level k of the tree contains all numbers of binary width k, like many base-2 related permutations (A003188, A054429, etc). For a proof, see A267110, which gives the contents of each parent node (for node containing n).
A276442 shows the mirror-image of the same tree.

Crossrefs

Inverse: A267111.
Similar or related permutations: A003188, A054429, A276442, A233276, A233278, A276344, A276346, A276446.
Cf. also permutations A266411, A266412 and arrays A265901, A265903.

Formula

a(1) = 1; after which, a(2n) = A087686(1+a(n)), a(2n+1) = A088359(a(n)).
As a composition of other permutations:
a(n) = A276442(A054429(n)).
a(n) = A276344(A233276(n)).
a(n) = A276346(A233278(n)).
a(n) = A276446(A003188(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.]
a(A000225(n)) = A006127(n), i.e., a((2^(n+1)) - 1) = 2^n + n. [Numbers at the right edge.]
Showing 1-10 of 14 results. Next