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

A220348 Index of row where n occurs in A183079.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 4, 5, 5, 4, 5, 6, 6, 5, 5, 6, 7, 7, 6, 6, 5, 7, 8, 8, 7, 7, 6, 5, 8, 9, 9, 8, 8, 7, 6, 6, 9, 10, 10, 9, 9, 8, 7, 7, 6, 10, 11, 11, 10, 10, 9, 8, 8, 7, 5, 11, 12, 12, 11, 11, 10, 9, 9, 8, 6, 6, 12, 13, 13, 12, 12, 11, 10, 10, 9, 7, 7, 7, 13
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2012

Keywords

Comments

A183079 seen as flattened sequence is a permutation of the natural numbers, therefore for each n there exists exactly 1 row in A183079 containing n.
In this sequence each n >= 2 occurs a total of 2^(n-2) times. - Antti Karttunen, May 18 2015

Crossrefs

Programs

  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a220348 n = fromJust (findIndex (elem n) a183079_tabf) + 1
    
  • Mathematica
    (* b is A220347 *) b[n_] := b[n] = With[{r = (-1 + Sqrt[8n + 1])/2}, Which[n <= 1, n, IntegerQ[r], 2b[Floor[Sqrt[2n] + 1/2]] - 1, True, 2b[n - Floor[r]]]];
    a[n_] := 1 + IntegerLength[b[n] - 1, 2];
    Array[a, 100] (* Jean-François Alcover, Dec 05 2021 *)
  • Scheme
    (define (A220348 n) (+ 1 (A029837 (A220347 n))))
    ;; Antti Karttunen, May 18 2015
    
  • Scheme
    (define (A220348 n) (A070941 (+ -1 (A220347 n))))
    ;; Antti Karttunen, May 18 2015

Formula

a(n) = 1 + A029837(A220347(n)) = A070941(A220347(n)-1). - Antti Karttunen, May 18 2015

Extensions

Name edited by Michel Marcus, Jan 26 2022

A183209 Tree generated by floor(3n/2): a(1) = 1, a(2n) = (3*a(n))-1, a(2n+1) = floor((3*a(n+1))/2).

Original entry on oeis.org

1, 2, 3, 5, 4, 8, 7, 14, 6, 11, 12, 23, 10, 20, 21, 41, 9, 17, 16, 32, 18, 35, 34, 68, 15, 29, 30, 59, 31, 62, 61, 122, 13, 26, 25, 50, 24, 47, 48, 95, 27, 53, 52, 104, 51, 101, 102, 203, 22, 44, 43, 86, 45, 89, 88, 176, 46, 92, 93, 185, 91, 182, 183, 365, 19, 38, 39, 77, 37
Offset: 1

Views

Author

Clark Kimberling, Dec 30 2010

Keywords

Comments

A permutation of the positive integers. See the comment at A183079. Leftmost branch of tree is essentially A061418. Rightmost: A007051.

Examples

			First levels of the tree:
                      1
                      2
            3                   5
          4   8               7   14
		

Crossrefs

Similar permutations: A048673, A254103.
Inverse permutation: A259431.

Programs

  • Haskell
    import Data.List (transpose)
    a183209 n k = a183209_tabf !! (n-1) !! (k-1)
    a183209_row n = a183209_tabf !! (n-1)
    a183209_tabf = [1] : iterate (\xs -> concat $
       transpose [map a032766 xs, map (a016789 . subtract 1) xs]) [2]
    a183209_list = concat a183209_tabf
    -- Reinhard Zumkeller, Jun 27 2015
    
  • Maple
    f:= proc(n) option remember;
      if n::even then 3*procname(n/2)-1
      else floor(3*procname((n+1)/2)/2)
      fi
    end proc:
    f(1):= 1:
    seq(f(n), n=1..100); # Robert Israel, Jan 26 2015
  • Mathematica
    a[1]=1; a[n_] := a[n] = If[EvenQ[n], 3a[n/2]-1, Floor[3a[(n+1)/2]/2] ]; Array[a, 100] (* Jean-François Alcover, Feb 02 2018 *)
  • Python
    def a(n):
        if n==1: return 1
        if n%2==0: return 3*a(n//2) - 1
        else: return (3*a((n - 1)//2 + 1))//2
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 06 2017

Formula

Let L(n)=floor(3n/2).
Let U(n)=3n-1. U is the complement of L.
The tree-array T(n,k) is then given by rows:
T(0,0)=1; T(1,0)=2;
T(n,2j)=L(T(n-1),j);
T(n,2j+1)=U(T(n-1),j);
for j=0,1,...,2^(n-1)-1, n>=2.
From Antti Karttunen, Jan 26 2015: (Start)
a(1) = 1, a(2n) = (3*a(n))-1, a(2n+1) = A032766(a(n+1)) = floor((3*a(n+1))/2).
Other identities:
a(2^n) = A007051(n) for all n >= 0. [A property shared with A048673 and A254103.]
(End)

Extensions

Formula to the name-field added by Antti Karttunen, Jan 26 2015

A183089 Tree generated by the lucky numbers: a(1) = 1; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n+1)), where lucky = A000959, unlucky = A050505.

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 9, 6, 21, 11, 13, 8, 31, 14, 15, 10, 87, 29, 37, 17, 49, 19, 25, 12, 141, 42, 51, 20, 63, 22, 33, 16, 517, 112, 133, 40, 189, 50, 69, 24, 259, 64, 75, 27, 111, 35, 43, 18, 925, 177, 211, 56, 267, 66, 79, 28, 339, 83, 93, 30, 159, 45, 67, 23, 4129, 618, 685, 143, 855, 167, 201, 54, 1275, 234, 261, 65, 391, 90, 105, 34
Offset: 1

Views

Author

Clark Kimberling, Dec 24 2010

Keywords

Comments

A permutation of the positive integers. See the comment at A183079.

Examples

			Top 6 levels of the binary tree:
                                     1
                                     |
                  ...................2...................
                 3                                       4
       7......../ \........5                   9......../ \........6
      / \                 / \                 / \                 / \
     /   \               /   \               /   \               /   \
    /     \             /     \             /     \             /     \
  21       11         13       8          31       14         15       10
87  29   37  17     49  19   25 12     141  42   51  20     63  22   33  16
...
From the level 3 to the level 4: 3 --> (7,5) and 4 --> (9,6).
		

Crossrefs

Inverse permutation: A257690.
Cf. A257726 (similar permutation with a slightly different definition, resulting the first differing term at n=9, where a(9) = 21, while A257726(9) = 13), A257735 - A257738.
Cf. A183079, A237739 (other similar permutations).

Formula

Let L(n) = A000959(n), the n-th lucky number.
Let U(n) = A050505(n), the n-th unlucky numbers.
The tree-array T(n,k) is then given by rows:
T(0,0) = 1; T(1,0) = 2;
T(n,2j) = L(T(n-1),j);
T(n,2j+1) = U(T(n-1),j);
for j = 0, 1, ..., 2^(n-1) - 1, n >= 2.
a(1) = 1; a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n+1)). - Antti Karttunen, May 09 2015

Extensions

Added a formula to the Name field and more terms, edited Example section - Antti Karttunen, May 09 2015

A183231 First of two complementary trees generated by the triangular numbers. The second tree is A183232.

Original entry on oeis.org

1, 4, 3, 19, 7, 13, 6, 229, 25, 43, 11, 118, 18, 34, 10, 26794, 250, 376, 32, 1033, 52, 89, 16, 7258, 133, 208, 24, 664, 42, 76, 15, 359026204, 27025, 31876, 272, 71629, 403, 593, 40, 536128, 1078, 1483, 62, 4184, 102, 169, 22, 26357428
Offset: 1

Views

Author

Clark Kimberling, Jan 02 2011

Keywords

Comments

Begin with the main tree A183079 generated by the triangular numbers:
......................1
......................2
.............3.................4
.........6.......5........10........7
.......21..9...15..8....55..14....28..11
Every n>2 is in the subtree from 3 or the subtree from 4.
Therefore, on subtracting 2 from all entries of those subtrees, we obtain complementary trees: A183231 and A183232.

Examples

			First three levels:
............1
.......4.........3
....19...7.....13..6
		

Crossrefs

Cf. A183079, A183232 (second tree), A183233.

Formula

See the formulas at A183079 and A183233.

A220347 Permutation of natural numbers: a(1) = 1, a(triangular(n)) = (2*a(n))-1, a(nontriangular(n)) = 2*n, where triangular = A000217, nontriangular = A014132.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 12, 10, 7, 16, 24, 20, 14, 11, 32, 48, 40, 28, 22, 9, 64, 96, 80, 56, 44, 18, 15, 128, 192, 160, 112, 88, 36, 30, 23, 256, 384, 320, 224, 176, 72, 60, 46, 19, 512, 768, 640, 448, 352, 144, 120, 92, 38, 13, 1024, 1536, 1280, 896, 704, 288
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2012

Keywords

Comments

Inverse permutation of A183079, when seen as a flattened sequence.

Crossrefs

Inverse: A183079.
Cf. also a similar permutation A257797 from which this differs for the first time at n=15, where a(15) = 11, while A257797(15) = 9.

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a220347 =  (+ 1) . fromJust . (`elemIndex` a183079_list)
    
  • Mathematica
    a[n_] := a[n] = With[{r = (-1 + Sqrt[8n + 1])/2}, Which[n <= 1, n, IntegerQ[r], 2 a[Floor[Sqrt[2n] + 1/2]] - 1, True, 2 a[n - Floor[r]]]];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Dec 05 2021 *)
  • Scheme
    ;; With memoizing definec-macro.
    (definec (A220347 n) (cond ((<= n 1) n) ((zero? (A010054 n)) (* 2 (A220347 (A083920 n)))) (else (+ -1 (* 2 (A220347 (A002024 n)))))))
    ;; Antti Karttunen, May 18 2015

Formula

a(1) = 1; for n > 1: if A010054(n) = 1 [i.e., if n is triangular], then a(n) = (2*a(A002024(n)))-1, otherwise a(n) = 2*a(A083920(n)). - Antti Karttunen, May 18 2015

Extensions

Old name moved to comments by Antti Karttunen, May 18 2015

A183169 Tree generated by the squares.

Original entry on oeis.org

1, 2, 4, 3, 16, 6, 9, 5, 256, 20, 36, 8, 81, 12, 25, 7, 65536, 272, 400, 24, 1296, 42, 64, 11, 6561, 90, 144, 15, 625, 30, 49, 10, 4294967296, 65792, 73984, 288, 160000, 420, 576, 29, 1679616, 1332, 1764, 48, 4096, 72, 121, 14
Offset: 1

Views

Author

Clark Kimberling, Dec 28 2010

Keywords

Comments

A permutation of the positive integers. See the comment at A183079 (tree generated by the triangular numbers). The leftmost numbers (1,2,4,16,...) are, after the initial 1, given by A001146. The rightmost numbers (1,2,3,5,7,10,...) are, after the initial 1, the iterates of the nonsquare function; see a comment at A033638.

Examples

			First levels of the tree:
......................1
......................2
...........4.....................3
.......16.......6...........9..........5
...256...20...36..8......81...12....25...7
		

Crossrefs

Formula

Let L(n) be the n-th square (A000290).
Let U(n) be the n-th nonsquare (A000037).
The tree-array T(n,k) is then given by rows:
T(0,0)=1; T(1,0)=2;
T(n,2j)=L(T(n-1),j);
T(n,2j+1)=U(T(n-1),j);
for j=0,1,...,2^(n-1)-1, n>=2.

A183232 Second of two complementary trees generated by the triangular numbers. The other tree is A183231.

Original entry on oeis.org

2, 8, 5, 53, 12, 26, 9, 1538, 63, 103, 17, 404, 33, 64, 14, 1186568, 1593, 2143, 74, 5563, 117, 188, 23, 82619, 432, 628, 41, 2209, 75, 134, 20, 703974775733, 1188108, 1272808, 1649, 2301583, 2208, 2924, 86, 15487393
Offset: 1

Views

Author

Clark Kimberling, Jan 02 2011

Keywords

Comments

See A183231 (first tree).

Examples

			First 3 levels:
....................2
...............8...........5
............53...12.....26...9
		

Crossrefs

Formula

See the formulas at A183231 and A183244.

A183542 First of two complementary trees generated by the Wythoff sequences.

Original entry on oeis.org

1, 2, 5, 4, 8, 9, 16, 7, 13, 14, 24, 15, 26, 27, 45, 12, 21, 22, 37, 23, 39, 40, 66, 25, 42, 43, 71, 44, 73, 74, 121, 20, 34, 55, 58, 36, 60, 61, 100, 38, 63, 64, 105, 65, 107, 108, 176, 41, 68, 69, 113, 70, 115, 116, 189, 72, 118, 119, 194, 120, 196, 197, 320
Offset: 1

Views

Author

Clark Kimberling, Jan 05 2011

Keywords

Comments

Begin with the main tree A074049 generated by the Wythoff sequences:
...................1
...................2
...........3.................5
.......4.......7........8........13
.....6..10...11..18....12..20...21..34
Every n >2 is in the subtree from 3 or the subtree from 5. Therefore, on subtracting 2 from all entries in those subtrees, we obtain complementary trees: A183342 and A183543.

Examples

			First three levels:
...................1
.............2............3
..........4.....8......9.....16
		

Crossrefs

A183079 (definition of tree generated by a sequence).

Formula

See the formulas at A074049 and A183544.

A257798 Permutation of natural numbers: a(1) = 1; a(2n) = nontriangular(a(n)), a(2n+1) = triangular(1+a(n)), where triangular = A000217, nontriangular = A014132.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 10, 7, 15, 9, 28, 8, 21, 14, 66, 11, 36, 20, 136, 13, 55, 35, 435, 12, 45, 27, 253, 19, 120, 77, 2278, 16, 78, 44, 703, 26, 231, 152, 9453, 18, 105, 65, 1596, 43, 666, 464, 95266, 17, 91, 54, 1081, 34, 406, 275, 32385, 25, 210, 135, 7381, 89, 3081, 2345, 2598060, 22, 153, 90, 3160, 53, 1035, 740, 248160, 33
Offset: 1

Views

Author

Antti Karttunen, May 18 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A014132(n) and each right hand child as A000217(1+n), when a parent contains n >= 1:
1
................../ \..................
2 3
4......../ \........6 5......../ \.......10
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 15 9 28 8 21 14 66
11 36 20 136 13 55 35 435 12 45 27 253 19 120 77 2278
etc.

Crossrefs

Inverse: A257797.
Cf. also permutation A183079.

Formula

a(1)=1; after which: a(2n) = A014132(a(n)), a(2n+1) = A000217(a(n)+1).

A183080 Tree generated by the Beatty sequence of 3-sqrt(2).

Original entry on oeis.org

1, 2, 3, 5, 4, 8, 7, 13, 6, 10, 12, 21, 11, 18, 20, 35, 9, 16, 15, 27, 19, 32, 33, 56, 17, 29, 28, 48, 31, 54, 55, 94, 14, 24, 25, 43, 23, 40, 42, 73, 30, 51, 50, 86, 52, 89, 88, 151, 26, 46, 45, 78, 44, 75, 76, 129, 49, 83, 85, 146, 87, 148, 149, 254
Offset: 1

Views

Author

Clark Kimberling, Dec 23 2010

Keywords

Comments

A permutation of the positive integers. See the note at A183079.

Examples

			First five rows:
1
2
3 5
4 8 7 13
6 10 12 21 11 18 20 35
		

Crossrefs

Programs

  • Mathematica
    a = {1, 2}; row = {a[[-1]]}; r = 3 - Sqrt[2]; s = r/(r - 1); Do[a = Join[a, row = Flatten[{Floor[#*{r, s}]} & /@ row]], {n, 5}]; a (* Ivan Neretin, Nov 09 2015 *)

Formula

Let L(n)=floor(n*r), U(n)=floor(n*s), where r=3-sqrt(2) and s=r/(r-1).
The tree-array T(n,k) is then given by rows: T(0,0) = 1; T(1,0) = 2; T(n,2j) = L(T(n-1),j); T(n,2j+1) = U(T(n-1),j); for j=0,1,...,2^(n-1)-1, n>=2.
Showing 1-10 of 16 results. Next