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-5 of 5 results.

A257735 Permutation of natural numbers: a(n) = A257725(A183089(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 17, 10, 9, 12, 25, 14, 13, 16, 57, 34, 33, 20, 49, 18, 11, 24, 105, 50, 19, 28, 29, 26, 15, 32, 153, 114, 113, 68, 385, 66, 65, 40, 769, 98, 97, 36, 81, 22, 21, 48, 609, 210, 209, 100, 133, 38, 37, 56, 1537, 58, 35, 52, 257, 30, 27, 64, 1953, 306, 163, 228, 1409, 226, 225, 136, 13313, 770, 99
Offset: 1

Views

Author

Antti Karttunen, May 09 2015

Keywords

Crossrefs

Inverse: A257736.

Programs

Formula

a(n) = A257725(A183089(n)).

A257737 Permutation of natural numbers: a(n) = A183089(A257725(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 14, 31, 16, 17, 18, 29, 20, 87, 42, 23, 24, 13, 26, 40, 28, 112, 56, 141, 32, 15, 34, 19, 36, 517, 54, 39, 143, 74, 177, 49, 44, 22, 46, 27, 48, 925, 618, 37, 71, 53, 179, 96, 220, 64, 58, 30, 60, 38, 62, 63, 1088, 737, 50, 51, 92, 4129, 70, 222, 122, 259, 271, 8037, 84, 77, 41
Offset: 1

Views

Author

Antti Karttunen, May 09 2015

Keywords

Crossrefs

Inverse: A257738.

Programs

Formula

a(n) = A183089(A257725(n)).

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

A257726 a(0)=0; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n)+1), where lucky = A000959, unlucky = A050505.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 5, 9, 6, 13, 11, 25, 8, 15, 14, 33, 10, 21, 19, 51, 17, 43, 35, 115, 12, 31, 22, 67, 20, 63, 45, 163, 16, 37, 29, 93, 27, 79, 66, 273, 24, 73, 57, 223, 47, 171, 146, 723, 18, 49, 42, 151, 30, 99, 88, 385, 28, 87, 83, 349, 59, 235, 203, 1093, 23, 69, 50, 193, 40, 135, 119, 559, 38, 129, 102, 475, 86, 367, 335, 1983, 34, 111
Offset: 0

Author

Antti Karttunen, May 06 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A050505(n), and each right hand child as A000959(1+n), when a parent contains n >= 1:
0
|
...................1...................
2 3
4......../ \........7 5......../ \........9
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
6 13 11 25 8 15 14 33
10 21 19 51 17 43 35 115 12 31 22 67 20 63 45 163
etc.
Because all lucky numbers are odd, it means that even terms can only occur in even positions (together with odd unlucky numbers, for each one of which there is a separate infinite cycle), while terms in odd positions are all odd.

Crossrefs

Inverse: A257725.
Related or similar permutations: A237126, A246378, A257728, A257731, A257733, A257801.
Cf. also A183089 (another similar permutation, but with a slightly different definition, resulting the first differing term at n=9, where a(9) = 13, while A183089(9) = 21).
Cf. also A257735 - A257738.

Formula

a(0)=0; after which, a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n)+1).
As a composition of other permutations. For all n >= 1:
a(n) = A257731(A246378(n)).
a(n) = A257733(A237126(n)).
a(n) = A257801(A257728(n)).

A257690 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = (2*a(n))-1, a(unlucky(n)) = 2*n, where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 5, 12, 7, 16, 10, 24, 11, 14, 15, 32, 20, 48, 22, 28, 9, 30, 64, 40, 23, 96, 44, 56, 18, 60, 13, 128, 31, 80, 46, 192, 19, 88, 112, 36, 120, 26, 47, 256, 62, 160, 92, 384, 21, 38, 27, 176, 224, 72, 240, 52, 94, 512, 124, 320, 184, 768, 29, 42, 76, 54, 63, 352, 39, 448, 144, 480, 95, 104, 43, 188, 1024, 248, 55
Offset: 1

Author

Antti Karttunen, May 09 2015

Keywords

Crossrefs

Inverse permutation: A183089.
Cf. also A257725 (similar permutation with a slightly different definition, resulting the first differing term at n=13, where a(13) = 11, while A257725(13) = 9).
Cf. also A257735 - A257738.

Formula

a(1) = 1; for n > 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = (2*a(A109497(n)))-1, otherwise a(n) = 2*a(n-A109497(n)). [Where A109497(n) gives the number of lucky numbers <= n.]
Showing 1-5 of 5 results.