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

A074050 Inverse permutation to A074049.

Original entry on oeis.org

1, 2, 3, 5, 4, 9, 6, 7, 17, 10, 11, 13, 8, 33, 18, 19, 21, 12, 25, 14, 15, 65, 34, 35, 37, 20, 41, 22, 23, 49, 26, 27, 29, 16, 129, 66, 67, 69, 36, 73, 38, 39, 81, 42, 43, 45, 24, 97, 50, 51, 53, 28, 57, 30, 31, 257, 130, 131, 133, 68, 137, 70, 71, 145, 74, 75, 77, 40, 161, 82, 83, 85, 44, 89, 46, 47, 193, 98
Offset: 1

Views

Author

Clark Kimberling, Aug 14 2002

Keywords

Crossrefs

Cf. A074049.

Extensions

Missing terms inserted by Sean A. Irvine, Jan 06 2025

A183079 Tree generated by the triangular numbers: a(1) = 1; a(2n) = nontriangular(a(n)), a(2n+1) = triangular(a(n+1)), where triangular = A000217, nontriangular = A014132.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 10, 7, 21, 9, 15, 8, 55, 14, 28, 11, 231, 27, 45, 13, 120, 20, 36, 12, 1540, 65, 105, 19, 406, 35, 66, 16, 26796, 252, 378, 34, 1035, 54, 91, 18, 7260, 135, 210, 26, 666, 44, 78, 17, 1186570, 1595, 2145, 76, 5565, 119, 190, 25, 82621, 434
Offset: 1

Views

Author

Clark Kimberling, Dec 23 2010

Keywords

Comments

A permutation of the positive integers.
In general, suppose that L and U are complementary sequences of positive integers such that
(1) L(1)=1; and
(2) if n>1, then n=L(k) or n=U(k) for some k
The tree generated by the sequence L is defined as follows:
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.
The numbers, taken in the order generated, form a permutation of the positive integers.

Examples

			First levels of the tree:
                                    1
                                    |
                 ...................2...................
                3                                       4
      6......../ \........5                   10......./ \........7
     / \                 / \                 / \                 / \
    /   \               /   \               /   \               /   \
   /     \             /     \             /     \             /     \
  21      9          15       8          55       14         28      11
231 27  45 13     120  20   36 12    1540  65  105  19    406  35  66  16
Beginning with 3 and 4, the numbers are generated in pairs, such as (3,4), (6,5), (10,7), (21,9),...
In all such pairs, the first number belongs to A000217; the second, to A014132.
		

Crossrefs

Cf. A220347 (inverse), A220348.
Cf. A183089, A183209 (similar permutations), also A257798.

Programs

  • Haskell
    a183079 n k = a183079_tabf !! (n-1) !! (k-1)
    a183079_row n = a183079_tabf !! n
    a183079_tabf = [1] : iterate (\row -> concatMap f row) [2]
       where f x = [a000217 x, a014132 x]
    a183079_list = concat a183079_tabf
    -- Reinhard Zumkeller, Dec 12 2012
    
  • Mathematica
    tr[n_]:=n*(n+1)/2; nt[n_]:= n+Round@ Sqrt[2*n];a[1]=1; a[n_Integer] := a[n] = If[ EvenQ@n, nt@a[n/2], tr@ a@ Ceiling[n/2]]; a/@Range[58] (* Giovanni Resta, May 20 2015 *)
  • Scheme
    ;; With memoizing definec-macro.
    (definec (A183079 n) (cond ((<= n 1) n) ((even? n) (A014132 (A183079 (/ n 2)))) (else (A000217 (A183079 (/ (+ n 1) 2))))))
    ;; Antti Karttunen, May 18 2015

Formula

Let L(n) be the n-th triangular number (A000217).
Let U(n) be the n-th non-triangular number (A014132).
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; after which: a(2n) = A014132(a(n)), a(2n+1) = A000217(a(n+1)). - Antti Karttunen, May 20 2015

Extensions

Formula added to the name and a new tree illustration to the Example section by Antti Karttunen, May 20 2015

A048680 Nonnegative integers A001477 expanded with rewrite 0->0, 01->1, then interpreted as Zeckendorffian expansions (as numbers of Fibonacci number system).

Original entry on oeis.org

0, 1, 2, 4, 3, 6, 7, 12, 5, 9, 10, 17, 11, 19, 20, 33, 8, 14, 15, 25, 16, 27, 28, 46, 18, 30, 31, 51, 32, 53, 54, 88, 13, 22, 23, 38, 24, 40, 41, 67, 26, 43, 44, 72, 45, 74, 75, 122, 29, 48, 49, 80, 50, 82, 83, 135, 52, 85, 86, 140, 87, 142, 143, 232, 21, 35, 36, 59, 37, 61
Offset: 0

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

A permutation of the nonnegative integers (A001477). Inverse permutation to A048679, i.e. A048679[ A048680[ n ] ] = n for all n and vice versa.

Crossrefs

Equals A074049(n+1) - 1.

Programs

  • Maple
    rewrite_0to0_1to01 := proc(n) option remember; if(n < 2) then RETURN(n); else RETURN(((2^(1+(n mod 2))) * rewrite_0to0_1to01(floor(n/2))) + (n mod 2)); fi; end; interpret_as_zeckendorf_expansion := n -> sum('(bit_i(n,i)*fib(i+2))','i'=0..floor_log_2(n));
  • PARI
    a(n)=my(k=1,s);while(n,if(n%2,s+=fibonacci(k++));k++;n>>=1);s \\ Charles R Greathouse IV, Nov 17 2013

Formula

a(n) = interpret_as_zeckendorf_expansion(rewrite_0to0_1to01(n)) (where rewrite_0to0_1to01(n)=A048678[ n ])

A026242 a(n) = j if n is L(j), else a(n) = k if n is U(k), where L = A000201, U = A001950 (lower and upper Wythoff sequences).

Original entry on oeis.org

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

Keywords

Comments

Every positive integer occurs exactly twice. a(n) is the parent of n in the tree at A074049. - Clark Kimberling, Dec 24 2010
Apparently, if n=F(m) (a Fibonacci number), one of two circumstances arise:
I. a(n)=F(m-1) and a(n-1)=F(m-2). When this happens, a(n) occurs for the first time and a(n-1) occurs for the second time;
II. a(n)=F(m-2) and a(n-1)=F(m-1). When this happens, a(n) occurs for the second time and a(n-1) occurs for the first time. - Bob Selcoe, Sep 18 2014
These are the numerators when all fractions, j/r and k/r^2, are arranged in increasing order (where r = golden ratio and j,k are positive integers). - Clark Kimberling, Mar 02 2015

Crossrefs

Cf. A000045 (Fibonacci numbers).

Programs

  • Mathematica
    mx = 100; gr = GoldenRatio; LW[n_] := Floor[n*gr]; UW[n_] := Floor[n*gr^2]; alw = Array[LW, Ceiling[mx/gr]]; auw = Array[UW, Ceiling[mx/gr^2]]; f[n_] := If[ MemberQ[alw, n], Position[alw, n][[1, 1]], Position[auw, n][[1, 1]]]; Array[f, mx] (* Robert G. Wilson v, Sep 17 2014 *)
  • PARI
    my(A=vector(10^4),i,j=0); while(#A>=i=A000201(j++), A[i]=j; (i=A001950(j))>#A || A[i]=j); A026242=A \\ M. F. Hasler, Sep 16 2014 and Sep 18 2014
    
  • PARI
    A026242=vector(#A002251,n,abs(A002251[n]-n)) \\ M. F. Hasler, Sep 17 2014

Formula

a(n) = a(m) if a(m) has already occurred exactly once and n = a(m) + m; otherwise, a(n) = least positive integer that has not yet occurred.
a(n) = abs(A002251(n) - n).
n = a(n) + a(n-1) unless n = A089910(m); if n = A089910(m), then n = a(n) + a(n-1) - m. - Bob Selcoe, Sep 20 2014
There is a 17-state automaton that accepts the Zeckendorf (Fibonacci) representation of n and a(n), in parallel. See the file a026242.pdf. - Jeffrey Shallit, Dec 21 2023

A178528 Tree generated by the Beatty sequence of sqrt(3).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 6, 9, 8, 11, 12, 16, 10, 14, 15, 21, 13, 18, 19, 26, 20, 28, 27, 37, 17, 23, 24, 33, 25, 35, 36, 49, 22, 30, 31, 42, 32, 44, 45, 61, 34, 47, 48, 66, 46, 63, 64, 87, 29, 40, 39, 54, 41, 56, 57, 78, 43, 59, 60, 82, 62, 85, 84, 115
Offset: 1

Author

Clark Kimberling, Dec 23 2010

Keywords

Comments

A permutation of the positive integers.

Examples

			First levels of the tree:
.....................1
.....................2
..............3..............4
..........5.......7......6.......9
........8..11..12..16..10..14..15..21
		

Crossrefs

Cf. A022838 (Beatty sequence of sqrt(3)), A054406, A074049.

Programs

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

Formula

Let r=sqrt(3) 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,2*j)=floor(r*T(n-1,j));
T(n,2*j+1)=floor(s*T(n-1,j));
for j=0,1,...,2^(n-1)-1, n>=2.

A183170 First of two trees generated by the Beatty sequence of sqrt(2).

Original entry on oeis.org

1, 3, 4, 10, 5, 13, 14, 34, 7, 17, 18, 44, 19, 47, 48, 116, 9, 23, 24, 58, 25, 61, 62, 150, 26, 64, 66, 160, 67, 163, 164, 396, 12, 30, 32, 78, 33, 81, 82, 198, 35, 85, 86, 208, 87, 211, 212, 512, 36, 88, 90, 218, 93, 225, 226, 546, 94, 228
Offset: 1

Author

Clark Kimberling, Dec 28 2010

Keywords

Comments

This tree grows from (L(1),U(1))=(1,3). The other tree, A183171, grows from (L(2),U(2))=(2,6). Here, L is the Beatty sequence A001951 of r=sqrt(2); U is the Beatty sequence A001952 of s=r/(r-1). The two trees are complementary; that is, every positive integer is in exactly one tree. (L and U are complementary, too.) The sequence formed by taking the terms of this tree in increasing order is A183172.

Examples

			First levels of the tree:
.......................1
.......................3
..............4...................10
.........5..........13........14........34
.......7..17......18..44....19..47....48..116
		

Programs

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

Formula

See the formula at A178528, but use r=sqrt(2) instead of r=sqrt(3).

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

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.

A183543 Second of two complementary trees generated by the Wythoff sequences.

Original entry on oeis.org

3, 6, 11, 10, 18, 19, 32, 17, 29, 30, 50, 31, 52, 53, 87, 28, 47, 48, 79, 49, 81, 82, 134, 51, 84, 85, 139, 86, 141, 142, 231, 46, 76, 77, 126, 78, 128, 129, 210, 80, 131, 132, 215, 133, 217, 218, 354, 83, 136, 137, 223, 138, 225, 226, 367, 140, 228, 229, 372, 230, 374, 375, 608
Offset: 1

Author

Clark Kimberling, Jan 05 2011

Keywords

Comments

See A183542.

Examples

			First three levels:
...............3
.......6.............11
....10...18.......19....32
		

Crossrefs

Formula

See the formulas as A074049 and A183545.

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

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.

A183081 Tree generated by the Beatty sequence of 4-sqrt(5).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 8, 11, 10, 13, 12, 16, 15, 20, 14, 18, 19, 25, 17, 23, 22, 30, 21, 27, 28, 36, 26, 34, 35, 46, 24, 32, 31, 41, 33, 43, 44, 57, 29, 39, 40, 53, 38, 50, 52, 69, 37, 48, 47, 62, 49, 64, 63, 83, 45, 60, 59, 78, 61, 80, 81
Offset: 1

Author

Clark Kimberling, Dec 23 2010

Keywords

Comments

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

Examples

			Top 5 rows:
1
2
3 4
5 6 7 9
8 11 10 13 12 16 15 20
		

Crossrefs

Programs

  • Mathematica
    a = {1, 2}; row = {a[[-1]]}; r = 4 - Sqrt[5]; 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=4-sqrt(5) 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 14 results. Next