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

A162598 Ordinal transform of A265332.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is a fractal sequence.
It appears that each group of 2^k terms starts with 1 and ends with the remaining powers of two from 2^k down to 2^1.
From Antti Karttunen, Jan 09-12 2016: (Start)
This is ordinal transform of A265332, which is modified A051135 (with a(1) = 1, instead of 2). - after Franklin T. Adams-Watters' original definition for this sequence.
A000079 (powers of 2) indeed gives the positions of ones in this sequence. This follows from the properties (3) and (4) of A004001 given on page 227 of Kubo & Vakil paper (page 3 of PDF), which together also imply the pattern observed above, more clearly represented as:
a(2) = 1.
a(3..4) = 2, 1.
a(6..8) = 4, 2, 1.
a(13..16) = 8, 4, 2, 1.
a(28..31) = 16, 8, 4, 2, 1.
etc.
(End)

Crossrefs

Row index of A265901, column index of A265903.
Cf. A265332 (corresponding other index).
Cf. A000079 (positions of ones).
Cf. A000225 (from the term 3 onward the positions of 2's).
Cf. A000325 (from its third term 5 onward the positions of 3's, which occur always as the last term before the next descending subsequence of powers of two).

Programs

  • Mathematica
    terms = 100;
    h[1] = 1; h[2] = 1;
    h[n_] := h[n] = h[h[n - 1]] + h[n - h[n - 1]];
    t = Array[h, 2*terms];
    A051135 = Take[Transpose[Tally[t]][[2]], terms];
    b[_] = 1;
    a[n_] := a[n] = With[{t = If[n == 1, 1, A051135[[n]]]}, b[t]++];
    Array[a, terms] (* Jean-François Alcover, Dec 19 2021, after Robert G. Wilson v in A051135 *)

Formula

Let b(1) = 1, b(n) = A051135(n) for n > 1. Then a(n) is the number of b(k) that equal b(n) for 1 <= k <= n: sum( 1, 1<=k<=n and a(k)=a(n) ).
If A265332(n) = 1, then a(n) = A004001(n), otherwise a(n) = a(A080677(n)-1) = a(n - A004001(n)). - Antti Karttunen, Jan 09 2016

Extensions

Name amended by Antti Karttunen, Jan 09 2016

A265754 Reduced frequency counts for A004001: a(n) = A265332(n+1) - A036987(n).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 1, 2, 3, 4, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 5, 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, 6, 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, 5
Offset: 1

Views

Author

Antti Karttunen, Jan 10 2016

Keywords

Comments

Can be generated recursively by first setting R_1 = (1), after which each R_n is obtained by replacing in R_{n-1} each term k with terms 1 .. k, followed by final n. This sequence is then obtained by concatenating all levels R_1, R_2, ..., R_inf together. See page 230 in Kubo-Vakil paper (page 6 in PDF).
Deleting all 1's and decrementing the remaining terms by one gives the sequence back.
Comment from N. J. A. Sloane, Nov 05 2017: (Start)
The following simple Pascal-like triangle produces the same sequence. Construct a triangle T(n,k) of strings (with 0 <= k <= n), where T(0,0) = {1}, T(n,n) = {n+1}, and otherwise T(n,k) is the concatenation of T(n-1,k-1) and T(n-1,k). The first few rows of the triangle (where the strings T(n,k) are shown without spaces for legibility) are:
1
1,2
1,12,3
1,112,123,4
1,1112,112123,1234,5
1,11112,1112112123,1121231234,12345,6
...
Now read the strings across the rows to get the sequence. T(n,k) has length binomial(n,k). (End)

Examples

			Illustration of the sequence as a tree:
             1
            / \
           1   2
          /   /|\
         1   1 2 3_________
        /   / /| | \  \    \
       1   1 1 2 1  2  3__  4________
      /   / / /| | / \ |\ \  \ \ \ \ \
     1   1 1 1 2 1 1 2 1 2 3  1 2 3 4 5
etc.
Compare with the illustration in A265332.
		

Crossrefs

Cf. A000225 (positions of records, where n appears first time).
Cf. A266640 (obtained from the mirror image of the same tree).
See A293959 for another version.

Formula

a(n) = A265332(n+1) - A036987(n).
As a recurrence: If A036987(n) = 1 [when n is of the form 2^k -1], a(n) = A070939(n), else if a(n+1) = 1, a(n) = a(2^A000523(n) - A266349(n)), otherwise a(n) = a(n+1)-1.
Other identities. For all n >= 1:
a(n) = A266640(A054429(n)).
a(A000225(n)) = 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]

A088359 Numbers which occur only once in A004001.

Original entry on oeis.org

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, 129, 130, 131, 132
Offset: 1

Views

Author

Robert G. Wilson v, Sep 26 2003

Keywords

Comments

Out of the first one million terms (a(10^6) = 510403), 258661 occur only once.
Complement of A087686; A051135(a(n)) = 1. - Reinhard Zumkeller, Jun 03 2011
From Antti Karttunen, Jan 18 2016: (Start)
In general, out of the first 2^(n+1) terms of A004001, 2^(n-1) - 1 terms (a quarter) occur only once. See also illustration in A265332.
One more than the positions of ones in A093879.
(End)

Crossrefs

Positions of ones in A051135.
Cf. A188163 (same sequence with prepended 1).
Cf. A087686 (complement).
Cf. also A267110, A267111, A267112.

Programs

  • Haskell
    import Data.List (elemIndices)
    a088359 n = a088359_list !! (n-1)
    a088359_list = map succ $ elemIndices 1 a051135_list
    -- Reinhard Zumkeller, Jun 03 2011
    (Scheme, with Antti Karttunen's IntSeq-library)
    (define A088359 (ZERO-POS 1 1 (COMPOSE -1+ A051135)))
    ;; Antti Karttunen, Jan 18 2016
  • Mathematica
    a[1] = 1; a[2] = 1; a[n_] := a[n] = a[ a[n - 1]] + a[n - a[n - 1]]; hc = Table[ a[n], {n, 1, 261}]; RunLengthEncodeOne[x_List] := Length[ # ] == 1 & /@ Split[x]; r = RunLengthEncodeOne[hc]; Select[ Range[ Length[r]], r[[ # ]] == True &]

Formula

From Antti Karttunen, Jan 18 2016: (Start)
Other identities.
For all n >= 0, a(A000079(n)) = A000051(n+1), that is, a(2^n) = 2^(n+1) + 1.
For all n >= 1:
a(n) = A004001(A266399(n)).
(End)

A080677 a(n) = n + 1 - A004001(n).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 03 2003

Keywords

Comments

From Antti Karttunen, Jan 10 2016: (Start)
This is the sequence b(n) mentioned on page 229 (page 5 of PDF) in Kubo & Vakil paper, but using starting offset 1 instead of 2.
The recursive sum formula for A004001, a(n) = a(a(n-1)) + a(n-a(n-1)) can be written also as a(n) = a(a(n-1)) + a(A080677(n-1)).
This is the least monotonic left inverse for sequence A087686. Proof: Taking the first differences of this sequence yields the characteristic function for the complement of A188163, because A188163 gives the positions where A004001 increases, and this sequence increases by one whenever A004001 does not increase (and vice versa). Sequence A188163 is also 1 followed by A088359 (see comment in former), whose complement A087686 is, thus A087686 is also the complement of A188163, apart from the initial one. Note also how A087686 is closed with respect to A004001 (see A266188).
(End)

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.

Crossrefs

Programs

Formula

a(n) = n + 1 - A004001(n).
Other identities. For all n >= 1:
a(A087686(n)) = n. [See comments.] - Antti Karttunen, Jan 10 2016

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

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

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

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 18 2015

Keywords

Comments

Square array read by descending antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
The topmost row (row 1) of the array is A000079 (powers of 2), and in general each row 2^k contains the sequence (2^n - k), starting from the term (2^(k+1) - k). This follows from the properties (3) and (4) of A004001 given on page 227 of Kubo & Vakil paper (page 3 in PDF).
Moreover, each row 2^k - 1 (for k >= 2) contains the sequence 2^n - n - (k-2), starting from the term (2^(k+1) - (2k-1)). To see why this holds, consider the definitions of sequences A162598 and A265332, the latter which also illustrates how the frequency counts Q_n for A004001 are recursively constructed (in the Kubo & Vakil paper).

Examples

			The top left corner of the array:
   1,  2,   4,   8,  16,   32,   64,  128,  256,   512,  1024, ...
   3,  7,  15,  31,  63,  127,  255,  511, 1023,  2047,  4095, ...
   5, 12,  27,  58, 121,  248,  503, 1014, 2037,  4084,  8179, ...
   6, 14,  30,  62, 126,  254,  510, 1022, 2046,  4094,  8190, ...
   9, 21,  48, 106, 227,  475,  978, 1992, 4029,  8113, 16292, ...
  10, 24,  54, 116, 242,  496, 1006, 2028, 4074,  8168, 16358, ...
  11, 26,  57, 120, 247,  502, 1013, 2036, 4083,  8178, 16369, ...
  13, 29,  61, 125, 253,  509, 1021, 2045, 4093,  8189, 16381, ...
  17, 38,  86, 192, 419,  894, 1872, 3864, 7893, 16006, 32298, ...
  18, 42,  96, 212, 454,  950, 1956, 3984, 8058, 16226, 32584, ...
  19, 45, 102, 222, 469,  971, 1984, 4020, 8103, 16281, 32650, ...
  20, 47, 105, 226, 474,  977, 1991, 4028, 8112, 16291, 32661, ...
  22, 51, 112, 237, 490,  999, 2020, 4065, 8158, 16347, 32728, ...
  23, 53, 115, 241, 495, 1005, 2027, 4073, 8167, 16357, 32739, ...
  25, 56, 119, 246, 501, 1012, 2035, 4082, 8177, 16368, 32751, ...
  28, 60, 124, 252, 508, 1020, 2044, 4092, 8188, 16380, 32764, ...
  ...
		

Crossrefs

Inverse permutation: A267102.
Transpose: A265903.
Cf. A265900 (main diagonal).
Cf. A162598 (row index of n in array), A265332 (column index of n in array).
Column 1: A188163.
Column 2: A266109.
Row 1: A000079 (2^n).
Row 2: A000225 (2^n - 1, from 3 onward).
Row 3: A000325 (2^n - n, from 5 onward).
Row 4: A000918 (2^n - 2, from 6 onward).
Row 5: A084634 (?, from 9 onward).
Row 6: A132732 (2^n - 2n + 2, from 10 onward).
Row 7: A000295 (2^n - n - 1, from 11 onward).
Row 8: A036563 (2^n - 3).
Row 9: A084635 (?, from 17 onward).
Row 12: A048492 (?, from 20 onward).
Row 13: A249453 (?, from 22 onward).
Row 14: A183155 (2^n - 2n + 1, from 23 onward. Cf. also A244331).
Row 15: A000247 (2^n - n - 2, from 25 onward).
Row 16: A028399 (2^n - 4).
Cf. also permutations A267111, A267112.

Programs

Formula

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

A267110 If A051135(n) = 1, then a(n) = A004001(n) - 1, otherwise a(n) = n - A004001(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 16 2016

Keywords

Comments

For n > 1, a(n) gives the contents of the parent of the node which contains n in A267112-tree.
Each n > 0 occurs exactly twice, in positions A088359(n) and A087686(n+1).
The sequence maps each n > 1 to a number which is one digit shorter in binary system (cf. "Other identities"). This follows because A004001 is monotonic and A004001(2^n) = 2^(n-1) (see properties (2) and (3) given on page 227 of Kubo & Vakil paper, or page 3 in PDF), and also how the frequency counts Q_n for A004001 are recursively constructed (see Kubo & Vakil paper, p. 229 or A265332 for the illustration).

Crossrefs

Programs

Formula

If A051135(n) = 1 [Equally: if A265332(n) = 1], then a(n) = A004001(n) - 1, otherwise a(n) = n - A004001(n).
Other identities. For all n >= 2:
A070939(a(n)) = A070939(n) - 1. [See Comments section.]
Showing 1-10 of 14 results. Next