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 12 results. Next

A254102 Square array A(row,col) = A253887(A254055(row,col)) = A126760(A254101(row,col)).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 4, 8, 3, 3, 6, 1, 6, 14, 1, 2, 9, 32, 68, 21, 2, 5, 20, 50, 24, 7, 122, 1, 10, 26, 4, 75, 284, 608, 183, 5, 12, 15, 39, 176, 446, 107, 456, 1094, 2, 7, 5, 86, 230, 132, 669, 2552, 5468, 1641, 1, 4, 38, 104, 129, 345, 1580, 4010, 1914, 2051, 9842
Offset: 1

Views

Author

Antti Karttunen, Jan 28 2015

Keywords

Comments

Starting with an odd number x = A135765(row,col), the result after one combined Collatz step (3x+1)/2 is found in A254051(row+1,col), and after iterated [i.e., we divide all powers of 2 out] Collatz step: x_new <- A139391(x) = A000265(3x+1) the resulting odd number x_new is located A135764(1,A254055(row+1,col)).
What the resulting odd number will be, is given by A254101(row+1,col) = A000265(A254051(row+1,col)).
That number's column index in array A135765 is then given by A(row+1,col).

Examples

			The top left corner of the array:
     1,    1,    1,    1,     3,     1,     2,    1,     5,     2,     1,
     1,    1,    4,    6,     2,     5,    10,   12,     7,     4,    16,
     2,    8,    1,    9,    20,    26,    15,    5,    38,    44,    12,
     3,    6,   32,   50,     4,    39,    86,  104,    57,    17,   140,
    14,   68,   24,   75,   176,   230,   129,   78,   338,   392,    53,
    21,    7,  284,  446,   132,   345,   770,  932,   507,   294,  1256,
   122,  608,  107,  669,  1580,  2066,  1155,   44,  3038,  3524,   942,
   183,  456, 2552, 4010,   593,  3099,  6926, 8384,  4557,   331, 11300,
  1094, 5468, 1914, 6015, 14216, 18590, 10389, 6288, 27338, 31712,   530,
etc.
		

Crossrefs

Programs

Formula

A(row,col) = A126760(A254051(row,col)) = A126760(A254101(row,col)).
A(row,col) = A253887(A254055(row,col)).
A(row+1,col) = A254048(A135765(row,col)).

A003602 Kimberling's paraphrases: if n = (2k-1)*2^m then a(n) = k.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Fractal sequence obtained from powers of 2.
k occurs at (2*k-1)*A000079(m), m >= 0. - Robert G. Wilson v, May 23 2006
Sequence is T^(oo)(1) where T is acting on a word w = w(1)w(2)..w(m) as follows: T(w) = "1"w(1)"2"w(2)"3"(...)"m"w(m)"m+1". For instance T(ab) = 1a2b3. Thus T(1) = 112, T(T(1)) = 1121324, T(T(T(1))) = 112132415362748. - Benoit Cloitre, Mar 02 2009
Note that iterating the post-numbering operator U(w) = w(1) 1 w(2) 2 w(3) 3... produces the same limit sequence except with an additional "1" prepended, i.e., 1,1,1,2,1,3,2,4,... - Glen Whitney, Aug 30 2023
In the binary expansion of n, first swallow all zeros from the right, then add 1, and swallow the now-appearing 0 bit as well. - Ralf Stephan, Aug 22 2013
Although A264646 and this sequence initially agree in their digit-streams, they differ after 48 digits. - N. J. A. Sloane, Nov 20 2015
"[This is a] fractal because we get the same sequence after we delete from it the first appearance of all positive integers" - see Cobeli and Zaharescu link. - Robert G. Wilson v, Jun 03 2018
From Peter Munn, Jun 16 2022: (Start)
The sequence is the list of positive integers interleaved with the sequence itself. Provided the offset is suitable (which is the case here) a term of such a self-interleaved sequence is determined by the odd part of its index. Putting some of the formulas given here into words, a(n) is the position of the odd part of n in the list of odd numbers.
Applying the interleaving transform again, we get A110963.
(End)
Omitting all 1's leaves A131987 + 1. - David James Sycamore, Jul 26 2022
a(n) is also the smallest positive number not among the terms between a(a(n-1)) and a(n-1) inclusive (with a(0)=1 prepended). - Neal Gersh Tolunsky, Mar 07 2023

Examples

			From _Peter Munn_, Jun 14 2022: (Start)
Start of table showing the interleaving with the positive integers:
   n  a(n)  (n+1)/2  a(n/2)
   1    1      1
   2    1               1
   3    2      2
   4    1               1
   5    3      3
   6    2               2
   7    4      4
   8    1               1
   9    5      5
  10    3               3
  11    6      6
  12    2               2
(End)
		

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) is the index of the column in A135764 where n appears (see also A054582).
Cf. A000079, A000265, A001511, A003603, A003961, A014577 (with offset 1, reduction mod 2), A025480, A035528, A048673, A101279, A110963, A117303, A126760, A181988, A220466, A249745, A253887, A337821 (2-adic valuation).
Cf. also A349134 (Dirichlet inverse), A349135 (sum with it), A349136 (Möbius transform), A349431, A349371 (inverse Möbius transform).
Cf. A264646.

Programs

  • Haskell
    a003602 = (`div` 2) . (+ 1) . a000265
    -- Reinhard Zumkeller, Feb 16 2012, Oct 14 2010
    
  • Haskell
    import Data.List (transpose)
    a003602 = flip div 2 . (+ 1) . a000265
    a003602_list = concat $ transpose [[1..], a003602_list]
    -- Reinhard Zumkeller, Aug 09 2013, May 23 2013
    
  • Maple
    A003602:=proc(n) options remember: if n mod 2 = 1 then RETURN((n+1)/2) else RETURN(procname(n/2)) fi: end proc:
    seq(A003602(n), n=1..83); # Pab Ter
    nmax := 83: for m from 0 to ceil(simplify(log[2](nmax))) do for k from 1 to ceil(nmax/(m+2)) do a((2*k-1)*2^m) := k od: od: seq(a(k), k=1..nmax); # Johannes W. Meijer, Feb 04 2013
    A003602 := proc(n)
        a := 1;
        for p in ifactors(n)[2] do
            if op(1,p) > 2 then
                a := a*op(1,p)^op(2,p) ;
            end if;
        end do  :
        (a+1)/2 ;
    end proc: # R. J. Mathar, May 19 2016
  • Mathematica
    a[n_] := Block[{m = n}, While[ EvenQ@m, m /= 2]; (m + 1)/2]; Array[a, 84] (* or *)
    a[1] = 1; a[n_] := a[n] = If[OddQ@n, (n + 1)/2, a[n/2]]; Array[a, 84] (* Robert G. Wilson v, May 23 2006 *)
    a[n_] := Ceiling[NestWhile[Floor[#/2] &, n, EvenQ]/2]; Array[a, 84] (* Birkas Gyorgy, Apr 05 2011 *)
    a003602 = {1}; max = 7; Do[b = {}; Do[AppendTo[b, {k, a003602[[k]]}], {k, Length[a003602]}]; a003602 = Flatten[b], {n, 2, max}]; a003602 (* L. Edson Jeffery, Nov 21 2015 *)
  • PARI
    A003602(n)=(n/2^valuation(n,2)+1)/2; /* Joerg Arndt, Apr 06 2011 */
    
  • Python
    import math
    def a(n): return (n/2**int(math.log(n - (n & n - 1), 2)) + 1)/2 # Indranil Ghosh, Apr 24 2017
    
  • Python
    def A003602(n): return (n>>(n&-n).bit_length())+1 # Chai Wah Wu, Jul 08 2022
  • Scheme
    (define (A003602 n) (let loop ((n n)) (if (even? n) (loop (/ n 2)) (/ (+ 1 n) 2)))) ;; Antti Karttunen, Feb 04 2015
    

Formula

a(n) = (A000265(n) + 1)/2.
a((2*k-1)*2^m) = k, for m >= 0 and k >= 1. - Robert G. Wilson v, May 23 2006
Inverse Weigh transform of A035528. - Christian G. Bower
G.f.: 1/x * Sum_{k>=0} x^2^k/(1-2*x^2^(k+1) + x^2^(k+2)). - Ralf Stephan, Jul 24 2003
a(2*n-1) = n and a(2*n) = a(n). - Pab Ter (pabrlos2(AT)yahoo.com), Oct 25 2005
a(A118413(n,k)) = A002024(n,k); = a(A118416(n,k)) = A002260(n,k); a(A014480(n)) = A001511(A014480(n)). - Reinhard Zumkeller, Apr 27 2006
Ordinal transform of A001511. - Franklin T. Adams-Watters, Aug 28 2006
a(n) = A249745(A126760(A003961(n))) = A249745(A253887(A048673(n))). That is, this sequence plays the same role for the numbers in array A135764 as A126760 does for the odd numbers in array A135765. - Antti Karttunen, Feb 04 2015 & Jan 19 2016
G.f. satisfies g(x) = g(x^2) + x/(1-x^2)^2. - Robert Israel, Apr 24 2015
a(n) = A181988(n)/A001511(n). - L. Edson Jeffery, Nov 21 2015
a(n) = A025480(n-1) + 1. - R. J. Mathar, May 19 2016
a(n) = A110963(2n-1) = A349135(4*n). - Antti Karttunen, Apr 18 2022
a(n) = (1 + n)/2, for n odd; a(n) = a(n/2), for n even. - David James Sycamore, Jul 28 2022
a(n) = n/2^A001511(n) + 1/2. - Alan Michael Gómez Calderón, Oct 06 2023
a(n) = A123390(A118319(n)). - Flávio V. Fernandes, Mar 02 2025

Extensions

More terms from Pab Ter (pabrlos2(AT)yahoo.com), Oct 25 2005

A126760 a(0) = 0, a(2n) = a(n), a(3n) = a(n), a(6n+1) = 2n + 1, a(6n+5) = 2n + 2.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 3, 1, 1, 2, 4, 1, 5, 3, 2, 1, 6, 1, 7, 2, 3, 4, 8, 1, 9, 5, 1, 3, 10, 2, 11, 1, 4, 6, 12, 1, 13, 7, 5, 2, 14, 3, 15, 4, 2, 8, 16, 1, 17, 9, 6, 5, 18, 1, 19, 3, 7, 10, 20, 2, 21, 11, 3, 1, 22, 4, 23, 6, 8, 12, 24, 1, 25, 13, 9, 7, 26, 5, 27, 2, 1, 14, 28, 3, 29, 15, 10, 4, 30, 2
Offset: 0

Views

Author

N. J. A. Sloane, Feb 19 2007

Keywords

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

Crossrefs

One less than A126759.
Cf. A347233 (Möbius transform) and also A349390, A349393, A349395 for other Dirichlet convolutions.
Ordinal transform of A065331 and of A322026 (after the initial 0).
Related arrays: A135765, A254102.

Programs

  • 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 *)
  • PARI
    A126760(n)={n&&n\=3^valuation(n,3)<M. F. Hasler, Jan 19 2016

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(n) = A253887(A003602(n)).
a(6n-3) = a(4n-2) = a(2n-1) = A253887(n).
(End)
a(n) = A249746(A003602(A064989(n))). - Antti Karttunen, Feb 04 2015
a(n) = A323882(4*n). - Antti Karttunen, Apr 18 2022

Extensions

Name replaced with an independent recurrence and the old description moved to the Formula section - Antti Karttunen, Jan 28 2015

A191450 Dispersion of (3*n-1), read by antidiagonals.

Original entry on oeis.org

1, 2, 3, 5, 8, 4, 14, 23, 11, 6, 41, 68, 32, 17, 7, 122, 203, 95, 50, 20, 9, 365, 608, 284, 149, 59, 26, 10, 1094, 1823, 851, 446, 176, 77, 29, 12, 3281, 5468, 2552, 1337, 527, 230, 86, 35, 13, 9842, 16403, 7655, 4010, 1580, 689, 257, 104, 38, 15, 29525
Offset: 1

Views

Author

Clark Kimberling, Jun 05 2011

Keywords

Comments

Suppose that s is an increasing sequence of positive integers, that the complement t of s is infinite, and that t(1)=1. The dispersion of s is the array D whose n-th row is (t(n), s(t(n)), s(s(t(n))), s(s(s(t(n)))), ...). Every positive integer occurs exactly once in D, so that, as a sequence, D is a permutation of the positive integers. The sequence u given by u(n) = {index of the row of D that contains n} is a fractal sequence. In this case s(n) = A016789(n-1), t(n) = A032766(n) [from term A032766(1) onward] and u(n) = A253887(n). [Author's original comment edited by Antti Karttunen, Jan 24 2015]
For other examples of such sequences, please see the Crossrefs section.

Examples

			The northwest corner of the square array:
  1,  2,  5,  14,  41,  122,  365,  1094,  3281,   9842,  29525,   88574, ...
  3,  8, 23,  68, 203,  608, 1823,  5468, 16403,  49208, 147623,  442868, ...
  4, 11, 32,  95, 284,  851, 2552,  7655, 22964,  68891, 206672,  620015, ...
  6, 17, 50, 149, 446, 1337, 4010, 12029, 36086, 108257, 324770,  974309, ...
  7, 20, 59, 176, 527, 1580, 4739, 14216, 42647, 127940, 383819, 1151456, ...
  9, 26, 77, 230, 689, 2066, 6197, 18590, 55769, 167306, 501917, 1505750, ...
  etc.
The leftmost column is A032766, and each successive column to the right of it is obtained by multiplying the left neighbor on that row by three and subtracting one, thus the second column is (3*1)-1, (3*3)-1, (3*4)-1, (3*6)-1, (3*7)-1, (3*9)-1, ... = 2, 8, 11, 17, 20, 26, ...
		

Crossrefs

Inverse: A254047.
Transpose: A254051.
Column 1: A032766.
Cf. A007051, A057198, A199109, A199113 (rows 1-4).
Cf. A253887 (row index of n in this array) & A254046 (column index, see also A253786).
Examples of other arrays of dispersions: A114537, A035513, A035506, A191449, A191426-A191455.

Programs

  • Maple
    A191450 := proc(r, c)
        option remember;
        if c = 1 then
            A032766(r) ;
        else
            A016789(procname(r, c-1)-1) ;
        end if;
    end proc: # R. J. Mathar, Jan 25 2015
  • Mathematica
    (* Program generates the dispersion array T of increasing sequence f[n] *)
    r=40; r1=12; c=40; c1=12;
    f[n_] :=3n-1 (* complement of column 1 *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]]
    (* A191450 array *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191450 sequence *)
    (* Program by Peter J. C. Moses, Jun 01 2011 *)
  • PARI
    a(n,k)=3^(n-1)*(k*3\2*2-1)\2+1 \\ =3^(n-1)*(k*3\2-1/2)+1/2, but 30% faster. - M. F. Hasler, Jan 20 2015
    
  • Scheme
    (define (A191450 n) (A191450bi (A002260 n) (A004736 n)))
    (define (A191450bi row col) (if (= 1 col) (A032766 row) (A016789 (- (A191450bi row (- col 1)) 1))))
    (define (A191450bi row col) (/ (+ 3 (* (A000244 col) (- (* 2 (A032766 row)) 1))) 6)) ;; Another implementation based on L. Edson Jeffery's direct formula.
    ;; Antti Karttunen, Jan 21 2015

Formula

Conjecture: A(n,k) = (3 + (2*A032766(n) - 1)*A000244(k))/6. - L. Edson Jeffery, with slight changes by Antti Karttunen, Jan 21 2015
a(n) = A254051(A038722(n)). [When both this and transposed array A254051 are interpreted as one-dimensional sequences.] - Antti Karttunen, Jan 22 2015

Extensions

Example corrected and description clarified by Antti Karttunen, Jan 24 2015

A254051 Square array A by downward antidiagonals: A(n,k) = (3 + 3^n*(2*floor(3*k/2) - 1))/6, n,k >= 1; read as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

1, 3, 2, 4, 8, 5, 6, 11, 23, 14, 7, 17, 32, 68, 41, 9, 20, 50, 95, 203, 122, 10, 26, 59, 149, 284, 608, 365, 12, 29, 77, 176, 446, 851, 1823, 1094, 13, 35, 86, 230, 527, 1337, 2552, 5468, 3281, 15, 38, 104, 257, 689, 1580, 4010, 7655, 16403, 9842, 16, 44, 113, 311, 770, 2066, 4739, 12029, 22964, 49208, 29525, 18, 47
Offset: 1

Views

Author

Keywords

Comments

This is transposed dispersion of (3n-1), starting from its complement A032766 as the first row of square array A(row,col). Please see the transposed array A191450 for references and background discussion about dispersions.
For any odd number x = A135765(row,col), the result after one combined Collatz step (3x+1)/2 -> x (A165355) is found in this array at A(row+1,col).

Examples

			The top left corner of the array:
   1,   3,   4,   6,   7,   9,  10,  12,   13,   15,   16,   18,   19,   21
   2,   8,  11,  17,  20,  26,  29,  35,   38,   44,   47,   53,   56,   62
   5,  23,  32,  50,  59,  77,  86, 104,  113,  131,  140,  158,  167,  185
  14,  68,  95, 149, 176, 230, 257, 311,  338,  392,  419,  473,  500,  554
  41, 203, 284, 446, 527, 689, 770, 932, 1013, 1175, 1256, 1418, 1499, 1661
...
		

Crossrefs

Inverse: A254052.
Transpose: A191450.
Row 1: A032766.
Cf. A007051, A057198, A199109, A199113 (columns 1-4).
Cf. A254046 (row index of n in this array, see also A253786), A253887 (column index).
Array A135765(n,k) = 2*A(n,k) - 1.
Other related arrays: A254055, A254101, A254102.
Related permutations: A048673, A254053, A183209, A249745, A254103, A254104.

Formula

In A(n,k)-formulas below, n is the row, and k the column index, both starting from 1:
A(n,k) = (3 + ( A000244(n) * (2*A032766(k) - 1) )) / 6. - Antti Karttunen after L. Edson Jeffery's direct formula for A191450, Jan 24 2015
A(n,k) = A048673(A254053(n,k)). [Alternative formula.]
A(n,k) = (1/2) * (1 + A003961((2^(n-1)) * A254050(k))). [The above expands to this.]
A(n,k) = (1/2) * (1 + (A000244(n-1) * A007310(k))). [Which further reduces to this, equivalent to L. Edson Jeffery's original formula above.]
A(1,k) = A032766(k) and for n > 1: A(n,k) = (3 * A254051(n-1,k)) - 1. [The definition of transposed dispersion of (3n-1).]
A(n,k) = (1+A135765(n,k))/2, or when expressed one-dimensionally, a(n) = (1+A135765(n))/2.
A(n+1,k) = A165355(A135765(n,k)).
As a composition of related permutations. All sequences interpreted as one-dimensional:
a(n) = A048673(A254053(n)). [Proved above.]
a(n) = A191450(A038722(n)). [Transpose of array A191450.]

A254046 Column index of n in A191450: a(3n) = 1, a(3n+1) = 1, a(3n+2) = 1 + a(n+1).

Original entry on oeis.org

1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 5, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 6, 1, 1, 2, 1, 1, 2
Offset: 1

Views

Author

Antti Karttunen, Jan 24 2015

Keywords

Comments

Equally, the row index of n in A254051.
a(n) is the 3-adic valuation of A087289(n-1). - Fred Daniel Kline, Jan 11 2017

Crossrefs

One more than A253786.
Cf. A253887 (the corresponding row index).
Odd bisection of A051064.

Programs

  • Mathematica
    With[{nmax=200},IntegerExponent[6Range[nmax]-3,3]] (* Paolo Xausa, Nov 10 2023 *)

Formula

a(3n) = 1, a(3n+1) = 1, a(3n+2) = 1 + a(n+1).
a(n) = A253786(n) + 1.
a(n) = A253786(3n-1). - Cyril Damamme, Aug 04 2015
a(n) = A051064(2n-1), i.e., the 3-adic valuation of 6n-3. - Cyril Damamme, Aug 04 2015
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/2. - Amiram Eldar, Nov 16 2023

A253786 a(3n) = 0, a(3n+1) = 0, a(3n+2) = 1 + a(n+1).

Original entry on oeis.org

0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 4, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 5
Offset: 0

Views

Author

Antti Karttunen, Jan 22 2015

Keywords

Comments

For n >= 1, a(n) gives the distance of n in square array A191450 from its leftmost column.
The sequence 0,1,0,0,0,2,0,...,i.e., (a(n)) with the first term removed, is the unique fixed point of the constant length 3 morphism N -> 0 N+1 0 on the infinite alphabet {0,1,...,N,...}. - Michel Dekking, Sep 09 2022
a(n) is the number of trailing 1 digits of n-1 written in ternary, for n>=1. - Kevin Ryde, Sep 09 2022

Crossrefs

Programs

  • Mathematica
    With[{nmax=200},IntegerExponent[2Range[0,nmax]-1,3]] (* Paolo Xausa, Nov 09 2023 *)
  • PARI
    a(n) = n--; my(ret=0,r); while([n,r]=divrem(n,3); r==1, ret++); ret; \\ Kevin Ryde, Sep 13 2022

Formula

Other identities and observations. For all n >= 1:
a(n) = A254046(n)-1.
a(n) <= A254045(n) <= A253894(n).
a(3n-1) = A254046(n). - Cyril Damamme, Aug 04 2015
a(n) = A007949(2n-1), i.e., the 3-adic valuation of 2n-1. - Cyril Damamme, Aug 04 2015
From Antti Karttunen, Sep 12 2017: (Start)
For all n >= 1:
a(n) = A007814(A064216(n)) = A007814(A254104(n)) = A135523(A245611(n)).
a(A048673(n)) = a(A254103(n)) = A007814(n).
a(A244154(n)) = A007814(1+n).
a(A245612(n)) = A135523(n). (End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/2. - Amiram Eldar, Nov 16 2023

A254104 Permutation of natural numbers: a(0) = 0, a(3n) = 1 + 2*a(2n - 1), a(3n+1) = 1 + 2*a(2n), a(3n+2) = 2*a(n+1).

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 7, 11, 6, 9, 15, 10, 23, 13, 8, 19, 31, 14, 21, 47, 22, 27, 17, 12, 39, 63, 18, 29, 43, 30, 95, 45, 20, 55, 35, 46, 25, 79, 26, 127, 37, 16, 59, 87, 38, 61, 191, 62, 91, 41, 28, 111, 71, 42, 93, 51, 94, 159, 53, 44, 255, 75, 54, 33, 119, 34, 175, 77, 24, 123, 383, 78, 125, 183, 126, 83, 57, 36, 223, 143, 58, 85, 187, 86, 103, 189, 60
Offset: 0

Views

Author

Antti Karttunen, Jan 25 2015

Keywords

Crossrefs

Programs

  • Python
    def a(n):
        if n==0: return 0
        if n%3==0: return 1 + 2*a(2*n//3 - 1)
        elif n%3==1: return 1 + 2*a(2*(n - 1)//3)
        else: return 2*a((n - 2)//3 + 1)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 06 2017

Formula

a(0) = 0, a(3n) = 1 + 2*a(2n - 1), a(3n+1) = 1 + 2*a(2n), a(3n+2) = 2*a(n+1).
Other identities:
a(A007051(n)) = 2^n for all n >= 0. [A property shared with A064216.]

A254052 Inverse permutation to A254051.

Original entry on oeis.org

1, 3, 2, 4, 6, 7, 11, 5, 16, 22, 8, 29, 37, 10, 46, 56, 12, 67, 79, 17, 92, 106, 9, 121, 137, 23, 154, 172, 30, 191, 211, 13, 232, 254, 38, 277, 301, 47, 326, 352, 15, 379, 407, 57, 436, 466, 68, 497, 529, 18, 562, 596, 80, 631, 667, 93, 704, 742, 24, 781, 821, 107, 862, 904, 122, 947, 991, 14, 1036, 1082, 138, 1129, 1177, 155, 1226, 1276, 31
Offset: 1

Views

Author

Antti Karttunen, Jan 24 2015

Keywords

Crossrefs

Inverse: A254051.
Related permutations: A064216, A254054.

Programs

  • Scheme
    (define (A254052 n) (let ((x (A254046 n)) (y (A253887 n))) (* (/ 1 2) (- (expt (+ x y) 2) x y y y -2))))

Formula

As a composition of other permutations:
a(n) = A254054(A064216(n)).

A254047 Inverse permutation to A191450.

Original entry on oeis.org

1, 2, 3, 6, 4, 10, 15, 5, 21, 28, 9, 36, 45, 7, 55, 66, 14, 78, 91, 20, 105, 120, 8, 136, 153, 27, 171, 190, 35, 210, 231, 13, 253, 276, 44, 300, 325, 54, 351, 378, 11, 406, 435, 65, 465, 496, 77, 528, 561, 19, 595, 630, 90, 666, 703, 104, 741, 780, 26, 820, 861, 119, 903, 946, 135, 990, 1035, 12, 1081, 1128, 152, 1176, 1225, 170, 1275, 1326, 34
Offset: 1

Views

Author

Antti Karttunen, Jan 24 2015

Keywords

Crossrefs

Programs

  • Scheme
    (define (A254047 n) (let ((x (A253887 n)) (y (A254046 n))) (* (/ 1 2) (- (expt (+ x y) 2) x y y y -2))))
Showing 1-10 of 12 results. Next