The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A347945 To get {a(n)}, start with the nonnegative integers sequence f() and, for each y>=0, shift the f(y) to position f(2y) and reset indices. 0
 0, 2, 3, 1, 6, 7, 5, 10, 11, 8, 14, 15, 4, 18, 19, 13, 22, 23, 16, 26, 27, 12, 30, 31, 21, 34, 35, 24, 38, 39, 17, 42, 43, 29, 46, 47, 32, 50, 51, 9, 54, 55, 37, 58, 59, 40, 62, 63, 28, 66, 67, 45, 70, 71, 48, 74, 75, 33, 78, 79, 53, 82, 83, 56 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,2 COMMENTS To get {a(n)}, we use the working sequences f_x(y), where y is the index and x is both, the x-th working sequence and a control variable. x=0,1,2,3,... up to infinity. f_x(y) = f_(x-1)(x) if y = 2x, f_(x-1)(y+1) if x <= y < 2x, and s_(x-1)(y) otherwise. Start with the sequence of nonnegative integers {f(y)} = 0,1,2,3,4,5,6,7,8,9,10,11,12,... The first index is 0: For f(y=0), nothing is changed, since f(2*0=0), so we still have {f_0(y)} = 0,1,2,3,4,5,6,7,8,9,10,11,12,... For x=1: Shift f(1)=1 to f(2*1)=f(2), and all f(11 change position to f(2y) one or multiple times; e.g., for formula (2) t=3, k=1: f(y)=28=a(48) increases its position 2 times from its original y=28 up to n=48. The number of times that the terms f(y) for formula (1) change position to f(2y) is t. E.g., t=5: f(y)=20=a(120) changes positions 5 times, up to n=120. LINKS Table of n, a(n) for n=0..63. Index entries for sequences that are permutations of the nonnegative integers FORMULA To obtain all terms there are three formulas. For any t=1,2,3,... and k=0,1,2,3,... constellation: (1) a((3^t - 3)/2) = (2^(t+2) + (-1)^(t-1) - 9)/6. (2) a(k*3^t + (5*3^(t-1)-3)/2) = k*2^(t+1) + 2^t + (2^(t+2) + (-1)^(t-1) - 9)/6. (3) a(k*3^t + (7*3^(t-1)-3)/2) = k*2^(t+1) + 2^t + (2^(t+3) - (-1)^(t-1) - 9)/6. EXAMPLE Formula (1) has no control value "k" and produces small values (terms) for large index numbers n, compared to formulas (2) and (3). E.g.: For formula (1) t=5: a(363)=41. For formula (2) t=1, k=100: a(301)=402. Formula (1) produces the "Generalized Jacobsthal numbers" as a subsequence "s": s(A029858(t))=A084639(t), and the differences between those terms are the "Jacobsthal numbers" A001045. PROG (PARI) shiftv(v, n) = {my(w = v); for (i=1, n-1, w[i] = v[i]; ); for (i=n, 2*n-1, w[i] = v[i+1]; ); w[2*n] = v[n]; w; } lista(nn) = {my(v = [1..nn], va); for (n=1, nn\2, va = shiftv(v, n); v = va; ); concat(0, vector(#v\2, k, v[k])); } \\ Michel Marcus, Sep 21 2021 (PARI) a(n) = n++; my(c=1, r); while([n, r]=divrem(n, 3); r==1, c++); n<<(c+1) + (r<<1+1)<

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 23 03:30 EDT 2024. Contains 371906 sequences. (Running on oeis4.)