OFFSET
0,6
COMMENTS
For further information see A126759, which provided the original motivation for this sequence.
From Antti Karttunen, Jan 28 2015: (Start)
The odd bisection of the sequence gives A253887, and the even bisection gives the sequence itself.
A254048 gives the sequence obtained when this sequence is restricted to A007494 (numbers congruent to 0 or 2 mod 3).
For all odd numbers k present in square array A135765, a(k) = the column index of k in that array. (End)
A322026 and this sequence (without the initial zero) are ordinal transforms of each other. - Antti Karttunen, Feb 09 2019
Also ordinal transform of A065331 (after the initial 0). - Antti Karttunen, Sep 08 2024
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..19683
FORMULA
a(n) = A126759(n)-1. [The original definition.]
From Antti Karttunen, Jan 28 2015: (Start)
a(0) = 0, a(2n) = a(n), a(3n) = a(n), a(6n+1) = 2n + 1, a(6n+5) = 2n + 2.
Or with the last clause represented in another way:
a(0) = 0, a(2n) = a(n), a(3n) = a(n), a(6n+1) = 2n + 1, a(6n-1) = 2n.
Other identities. For all n >= 1:
a(6n-3) = a(4n-2) = a(2n-1) = A253887(n).
(End)
a(n) = A323882(4*n). - Antti Karttunen, Apr 18 2022
MATHEMATICA
f[n_] := Block[{a}, a[0] = 0; a[1] = a[2] = a[3] = 1; a[x_] := Which[EvenQ@ x, a[x/2], Mod[x, 3] == 0, a[x/3], Mod[x, 6] == 1, 2 (x - 1)/6 + 1, Mod[x, 6] == 5, 2 (x - 5)/6 + 2]; Table[a@ i, {i, 0, n}]] (* Michael De Vlieger, Feb 03 2015 *)
PROG
(Scheme, with memoizing macro definec)
(definec (A126760 n) (cond ((zero? n) n) ((even? n) (A126760 (/ n 2))) ((zero? (modulo n 3)) (A126760 (/ n 3))) ((= 1 (modulo n 6)) (+ 1 (/ (- n 1) 3))) (else (/ (+ n 1) 3))))
;; Antti Karttunen, Jan 28 2015
(PARI) A126760(n)={n&&n\=3^valuation(n, 3)<<valuation(n, 2); n%3+n\6*2} \\ M. F. Hasler, Jan 19 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 19 2007
EXTENSIONS
Name replaced with an independent recurrence and the old description moved to the Formula section - Antti Karttunen, Jan 28 2015
STATUS
approved