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.

A244154 Permutation of natural numbers: a(0) = 1, a(1) = 2, a(2n) = A254049(a(n)), a(2n+1) = 3*a(n)-1; composition of A048673 and A005940.

Original entry on oeis.org

1, 2, 3, 5, 4, 8, 13, 14, 6, 11, 18, 23, 25, 38, 63, 41, 7, 17, 28, 32, 39, 53, 88, 68, 61, 74, 123, 113, 172, 188, 313, 122, 9, 20, 33, 50, 46, 83, 138, 95, 72, 116, 193, 158, 270, 263, 438, 203, 85, 182, 303, 221, 424, 368, 613, 338, 666, 515, 858, 563, 1201, 938, 1563, 365, 10, 26, 43, 59, 60
Offset: 0

Views

Author

Antti Karttunen, Jun 27 2014

Keywords

Comments

Note the indexing: the domain starts from 0, while the range excludes zero.
From Antti Karttunen, May 30 2017: (Start)
This sequence can be represented as a binary tree. Each left hand child is obtained by applying A254049(n) when the parent contains n, and each right hand child is obtained by applying A016789(n-1) (i.e., multiply by 3, subtract one) to the parent's contents:
1
|
...................2...................
3 5
4......../ \........8 13......../ \........14
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
6 11 18 23 25 38 63 41
7 17 28 32 39 53 88 68 61 74 123 113 172 188 313 122
etc.
This is a mirror image of the tree depicted in A245612.
(End)

Crossrefs

Programs

Formula

a(n) = A048673(A005940(n+1)).
From Antti Karttunen, May 30 2017: (Start)
a(0) = 1, a(1) = 2, a(2n) = A254049(a(n)), a(2n+1) = 3*a(n)-1.
a(n) = A245612(A054429(n)).
(End)

A285712 a(1) = 0, and for n > 1, if n = 3k-1, then a(n) = k, otherwise a(n) = (A064216(n)+1)/2.

Original entry on oeis.org

0, 1, 2, 3, 2, 4, 6, 3, 7, 9, 4, 10, 5, 5, 12, 15, 6, 8, 16, 7, 19, 21, 8, 22, 13, 9, 24, 11, 10, 27, 30, 11, 17, 31, 12, 34, 36, 13, 18, 37, 14, 40, 20, 15, 42, 28, 16, 26, 45, 17, 49, 51, 18, 52, 54, 19, 55, 29, 20, 33, 25, 21, 14, 57, 22, 64, 43, 23, 66, 69, 24, 39, 35, 25, 70, 75, 26, 44, 76, 27, 48, 79, 28, 82, 61, 29, 84, 23, 30, 87, 90, 31, 47, 46, 32
Offset: 1

Views

Author

Antti Karttunen, Apr 25 2017

Keywords

Comments

For n >= 2, a(n) gives the contents of the parent node of the node containing n in binary trees like A245612.
Every positive integer greater than one occurs exactly twice in this sequence.

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; Array[a, 95] (* Michael De Vlieger, Sep 22 2017 *)
  • Scheme
    (define (A285712 n) (cond ((<= n 1) (- n 1)) ((= 2 (modulo n 3)) (A002264 (+ 1 n))) (else (/ (+ 1 (A064216 n)) 2))))

Formula

a(1) = 0, and for n > 1, if n = 3*k-1, then a(n) = k, otherwise a(n) = (A064216(n)+1)/2.
a(n) = (n+1)/3 + (3*A064216(n) - 2*n + 1)*( (n+1)^2 mod 3 )/6, for n>1. - Ammar Khatab, Sep 21 2020

A291763 Binary encoding of 2-digits in ternary representation of A245612(n).

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 3, 0, 1, 8, 1, 6, 5, 4, 1, 2, 1, 10, 23, 16, 1, 2, 13, 10, 9, 2, 7, 0, 1, 0, 3, 2, 1, 70, 21, 24, 45, 4, 33, 52, 1, 36, 3, 20, 25, 10, 21, 0, 17, 18, 5, 0, 13, 16, 3, 12, 1, 8, 1, 4, 5, 2, 5, 0, 1, 32, 139, 74, 41, 208, 49, 0, 89, 108, 11, 130, 65, 18, 103, 4, 1, 8, 73, 4, 5, 112, 41, 16, 49, 72, 19, 38, 41, 20, 1, 8, 33, 0, 35, 86, 9, 38
Offset: 0

Views

Author

Antti Karttunen, Sep 12 2017

Keywords

Crossrefs

Formula

a(n) = A289814(A245612(n)).

A285715 a(n) = A000120(A245611(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 25 2017

Keywords

Crossrefs

Cf. A007051 (positions of 0 and 1's).

Programs

Formula

a(1) = 0, a(2) = 1, for n > 2, a(n) = a(A285712(n)) + [n <> 2 mod 3]. (Where [] is Iverson bracket, giving here 1 if n is of the form 3k or 3k+1, and 0 if it is of the form 3k+2.)
a(n) = A000120(A245611(n)).

A285716 a(n) = A080791(A245611(n)).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 2, 0, 0, 1, 1, 0, 1, 0, 0, 2, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 0, 2, 1, 0, 3, 0, 1, 1, 0, 1, 1, 1, 0, 2, 0, 0, 2, 0, 0, 1, 0, 1, 2, 1, 1, 1, 2, 0, 1, 0, 1, 3, 0, 0, 1, 1, 1, 2, 0, 0, 2, 1, 0, 1, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0, 0, 1, 1, 1, 3, 0, 0, 2, 0, 0, 1, 1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 0, 3, 0, 0, 2, 0, 1, 1, 0
Offset: 1

Views

Author

Antti Karttunen, Apr 25 2017

Keywords

Crossrefs

One less than A091304 after the initial term.
Cf. A006254 (gives the positions of zeros after initial a(1)=0.)

Programs

  • Mathematica
    a[n_] := PrimeOmega[2*n - 1] - 1; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jul 23 2023 *)
  • Scheme
    ;; First implementation uses memoization-macro definec:
    (definec (A285716 n) (if (<= n 2) 0 (+ (if (= 2 (modulo n 3)) 1 0) (A285716 (A285712 n)))))
    (define (A285716 n) (A080791 (A245611 n)))

Formula

a(1) = 0, a(2) = 1, for n > 2, a(n) = a(A285712(n)) + [n == 2 mod 3]. (Where [] is Iverson bracket, giving here 1 only if n is of the form 3k+2, and 0 otherwise.)
a(n) = A080791(A245611(n)).
For all n >= 2, a(n) = A091304(n)-1 = A000120(A244153(n))-1. - Antti Karttunen, May 31 2017
Showing 1-5 of 5 results.