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

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

Original entry on oeis.org

1, 1, 2, 3, 1, 4, 5, 2, 6, 7, 3, 8, 9, 1, 10, 11, 4, 12, 13, 5, 14, 15, 2, 16, 17, 6, 18, 19, 7, 20, 21, 3, 22, 23, 8, 24, 25, 9, 26, 27, 1, 28, 29, 10, 30, 31, 11, 32, 33, 4, 34, 35, 12, 36, 37, 13, 38, 39, 5, 40, 41, 14, 42, 43, 15, 44, 45, 2, 46, 47, 16, 48, 49, 17, 50, 51, 6, 52, 53, 18, 54, 55, 19, 56, 57, 7
Offset: 1

Views

Author

Antti Karttunen, Jan 22 2015

Keywords

Comments

a(n) gives the row index of n in square array A191450, or equally, the column index of n in A254051.

Crossrefs

Odd bisection of A126760.
Cf. A254046 (the corresponding column index).

Programs

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

Formula

a(3n) = 2n, a(3n+1) = 2n+1, a(3n+2) = a(n+1).
a(n) = A126760(2n-1).
a(n) = A249746(A003602(A064216(n))). - Antti Karttunen, Feb 04 2015

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

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))))

A032766 Numbers that are congruent to 0 or 1 (mod 3).

Original entry on oeis.org

0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 21, 22, 24, 25, 27, 28, 30, 31, 33, 34, 36, 37, 39, 40, 42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 61, 63, 64, 66, 67, 69, 70, 72, 73, 75, 76, 78, 79, 81, 82, 84, 85, 87, 88, 90, 91, 93, 94, 96, 97, 99, 100, 102, 103
Offset: 0

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

Omitting the initial 0, a(n) is the number of 1's in the n-th row of the triangle in A118111. - Hans Havermann, May 26 2002
Binomial transform is A053220. - Michael Somos, Jul 10 2003
Smallest number of different people in a set of n-1 photographs that satisfies the following conditions: In each photograph there are 3 women, the woman in the middle is the mother of the person on her left and is a sister of the person on her right and the women in the middle of the photographs are all different. - Fung Cheok Yin (cheokyin_restart(AT)yahoo.com.hk), Sep 22 2006
Partial sums of A000034. - Richard Choulet, Jan 28 2010
Starting with 1 = row sums of triangle A171370. - Gary W. Adamson, Feb 15 2010
a(n) is the set of values for m in which 6k + m can be a perfect square (quadratic residues of 6 including trivial case of 0). - Gary Detlefs, Mar 19 2010
For n >= 2, a(n) is the smallest number with n as an anti-divisor. - Franklin T. Adams-Watters, Oct 28 2011
Sequence is also the maximum number of floors with 3 elevators and n stops in a "Convenient Building". See A196592 and Erich Friedman link below. - Robert Price, May 30 2013
a(n) is also the total number of coins left after packing 4-curves patterns (4c2) into a fountain of coins base n. The total number of 4c2 is A002620 and voids left is A000982. See illustration in links. - Kival Ngaokrajang, Oct 26 2013
Number of partitions of 6n into two even parts. - Wesley Ivan Hurt, Nov 15 2014
Number of partitions of 3n into exactly 2 parts. - Colin Barker, Mar 23 2015
Nonnegative m such that floor(2*m/3) = 2*floor(m/3). - Bruno Berselli, Dec 09 2015
For n >= 3, also the independence number of the n-web graph. - Eric W. Weisstein, Dec 31 2015
Equivalently, nonnegative numbers m for which m*(m+2)/3 and m*(m+5)/6 are integers. - Bruno Berselli, Jul 18 2016
Also the clique covering number of the n-Andrásfai graph for n > 0. - Eric W. Weisstein, Mar 26 2018
Maximum sum of degeneracies over all decompositions of the complete graph of order n+1 into three factors. The extremal decompositions are characterized in the Bickle link below. - Allan Bickle, Dec 21 2021
Also the Hadwiger number of the n-cocktail party graph. - Eric W. Weisstein, Apr 30 2022
The number of integer rectangles with a side of length n+1 and the property: the bisectors of the angles form a square within its limits. - Alexander M. Domashenko, Oct 17 2024
The maximum possible number of 5-cycles in an outerplanar graph on n+4 vertices. - Stephen Bartell, Jul 10 2025

Crossrefs

Cf. A006578 (partial sums), A000034 (first differences), A016789 (complement).
Essentially the same: A049624.
Column 1 (the second leftmost) of triangular table A026374.
Column 1 (the leftmost) of square array A191450.
Row 1 of A254051.
Row sums of A171370.
Cf. A066272 for anti-divisors.
Cf. A253888 and A254049 (permutations of this sequence without the initial zero).
Cf. A254103 and A254104 (pair of permutations based on this sequence and its complement).

Programs

  • Haskell
    a032766 n = div n 2 + n  -- Reinhard Zumkeller, Dec 13 2014
    (MIT/GNU Scheme) (define (A032766 n) (+ n (floor->exact (/ n 2)))) ;; Antti Karttunen, Jan 24 2015
    
  • Magma
    &cat[ [n, n+1]: n in [0..100 by 3] ]; // Vincenzo Librandi, Nov 16 2014
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=a[n-2]+3 od: seq(a[n], n=0..69); # Zerinvary Lajos, Mar 16 2008
    seq(floor(n/2)+n, n=0..69); # Gary Detlefs, Mar 19 2010
    select(n->member(n mod 3,{0,1}), [$0..103]); # Peter Luschny, Apr 06 2014
  • Mathematica
    a[n_] := a[n] = 2a[n - 1] - 2a[n - 3] + a[n - 4]; a[0] = 0; a[1] = 1; a[2] = 3; a[3] = 4; Array[a, 60, 0] (* Robert G. Wilson v, Mar 28 2011 *)
    Select[Range[0, 200], MemberQ[{0, 1}, Mod[#, 3]] &] (* Vladimir Joseph Stephan Orlovsky, Feb 11 2012 *)
    Flatten[{#,#+1}&/@(3Range[0,40])] (* or *) LinearRecurrence[{1,1,-1}, {0,1,3}, 100] (* or *) With[{nn=110}, Complement[Range[0,nn], Range[2,nn,3]]] (* Harvey P. Dale, Mar 10 2013 *)
    CoefficientList[Series[x (1 + 2 x) / ((1 - x) (1 - x^2)), {x, 0, 100}], x] (* Vincenzo Librandi, Nov 16 2014 *)
    Floor[3 Range[0, 69]/2] (* L. Edson Jeffery, Jan 14 2017 *)
    Drop[Range[0,110],{3,-1,3}] (* Harvey P. Dale, Sep 02 2023 *)
  • PARI
    {a(n) = n + n\2}
    
  • PARI
    concat(0, Vec(x*(1+2*x)/((1-x)*(1-x^2)) + O(x^100))) \\ Altug Alkan, Dec 09 2015
    
  • SageMath
    [int(3*n//2) for n in range(101)] # G. C. Greubel, Jun 23 2024

Formula

G.f.: x*(1+2*x)/((1-x)*(1-x^2)).
a(-n) = -A007494(n).
a(n) = A049615(n, 2), for n > 2.
From Paul Barry, Sep 04 2003: (Start)
a(n) = (6n - 1 + (-1)^n)/4.
a(n) = floor((3n + 2)/2) - 1 = A001651(n) - 1.
a(n) = sqrt(2) * sqrt( (6n-1) (-1)^n + 18n^2 - 6n + 1 )/4.
a(n) = Sum_{k=0..n} 3/2 - 2*0^k + (-1)^k/2. (End)
a(n) = 3*floor(n/2) + (n mod 2) = A007494(n) - A000035(n). - Reinhard Zumkeller, Apr 04 2005
a(n) = 2 * A004526(n) + A004526(n+1). - Philippe Deléham, Aug 07 2006
a(n) = 1 + ceiling(3*(n-1)/2). - Fung Cheok Yin (cheokyin_restart(AT)yahoo.com.hk), Sep 22 2006
Row sums of triangle A133083. - Gary W. Adamson, Sep 08 2007
a(n) = (cos(Pi*n) - 1)/4 + 3*n/2. - Bart Snapp (snapp(AT)coastal.edu), Sep 18 2008
A004396(a(n)) = n. - Reinhard Zumkeller, Oct 30 2009
a(n) = floor(n/2) + n. - Gary Detlefs, Mar 19 2010
a(n) = 3n - a(n-1) - 2, for n>0, a(0)=0. - Vincenzo Librandi, Nov 19 2010
a(n) = n + (n-1) - (n-2) + (n-3) - ... 1 = A052928(n) + A008619(n-1). - Jaroslav Krizek, Mar 22 2011
a(n) = a(n-1) + a(n-2) - a(n-3). - Robert G. Wilson v, Mar 28 2011
a(n) = Sum_{k>=0} A030308(n,k) * A003945(k). - Philippe Deléham, Oct 17 2011
a(n) = 2n - ceiling(n/2). - Wesley Ivan Hurt, Oct 25 2013
a(n) = A000217(n) - 2 * A002620(n-1). - Kival Ngaokrajang, Oct 26 2013
a(n) = Sum_{i=1..n} gcd(i, 2). - Wesley Ivan Hurt, Jan 23 2014
a(n) = 2n + floor((-n - (n mod 2))/2). - Wesley Ivan Hurt, Mar 31 2014
A092942(a(n)) = n for n > 0. - Reinhard Zumkeller, Dec 13 2014
a(n) = floor(3*n/2). - L. Edson Jeffery, Jan 18 2015
a(n) = A254049(A249745(n)) = (1+A007310(n)) / 2 for n >= 1. - Antti Karttunen, Jan 24 2015
E.g.f.: (3*x*exp(x) - sinh(x))/2. - Ilya Gutkovskiy, Jul 18 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/(6*sqrt(3)) + log(3)/2. - Amiram Eldar, Dec 04 2021

Extensions

Better description from N. J. A. Sloane, Aug 01 1998

A191655 Dispersion of (2,5,8,11,14,17,...), by antidiagonals.

Original entry on oeis.org

1, 3, 2, 6, 4, 5, 10, 7, 9, 8, 16, 12, 15, 13, 11, 25, 19, 24, 21, 18, 14, 39, 30, 37, 33, 28, 22, 17, 60, 46, 57, 51, 43, 34, 27, 20, 91, 70, 87, 78, 66, 52, 42, 31, 23, 138, 106, 132, 118, 100, 79, 64, 48, 36, 26, 208, 160, 199, 178, 151, 120, 97, 73, 55
Offset: 1

Views

Author

Clark Kimberling, Jun 10 2011

Keywords

Comments

Row 1: A152009.
For a background discussion of dispersions, see A191426.
...
Each of the sequences (3n, n>0), (3n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191449=dispersion of A008583 (0 mod 3)
A191451=dispersion of A016777 (1 mod 3)
A191450=dispersion of A016789 (2 mod 3)
A191656=dispersion of A001651 (1 or 2 mod 3)
A083044=dispersion of A007494 (0 or 2 mod 3)
A191655=dispersion of A032766 (0 or 1 mod 3)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191449 has 1st col A001651, all else A008583
A191451 has 1st col A007494, all else A016777
A191450 has 1st col A032766, all else A016789
A191656 has 1st col A008583, all else A001651
A083044 has 1st col A016777, all else A083044
A191655 has 1st col A016789, all else A032766
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.

Examples

			Northwest corner:
1...3...6....10...16
2...4...7....12...19
5...9...15...24...37
8...13..21...33...51
11..18..28...43...66
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 3; b = 4; m[n_] := If[Mod[n, 2] == 0, 1, 0];
    f[n_] := a*m[n + 1] + b*m[n] + 3*Floor[(n - 1)/2]
    Table[f[n], {n, 1, 30}]  (* A032766: (3+5k,4+5k, k>=0) *)
    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}]]          (* A191655 array *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]]   (* A191655 sequence *)

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

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 8, 6, 14, 9, 11, 7, 23, 13, 17, 10, 41, 22, 26, 15, 32, 18, 20, 12, 68, 36, 38, 21, 50, 27, 29, 16, 122, 63, 65, 34, 77, 40, 44, 24, 95, 49, 53, 28, 59, 31, 35, 19, 203, 103, 107, 55, 113, 58, 62, 33, 149, 76, 80, 42, 86, 45, 47, 25, 365, 184, 188, 96, 194, 99, 101, 52, 230, 117, 119, 61, 131, 67, 71, 37, 284, 144, 146, 75, 158, 81, 83, 43
Offset: 0

Views

Author

Antti Karttunen, Jan 25 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each child to the left is obtained by multiplying the parent by three and subtracting one, and each child to the right is obtained by adding one to parent, multiplying by three, and then halving the result (discarding a possible remainder):
0
|
...................1...................
2 3
5......../ \........4 8......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
14 9 11 7 23 13 17 10
41 22 26 15 32 18 20 12 68 36 38 21 50 27 29 16
etc.

Crossrefs

Inverse: A254104.
Similar permutations: A048673, A183209.

Programs

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

Formula

a(0) = 0, a(2n) = A016789(a(n)-1), a(2n+1) = A032766(1+a(n)).
a(0) = 0, a(2n) = (3*a(n))-1, a(2n+1) = floor((3*(1+a(n)))/2).
Other identities:
a(2^n) = A007051(n) for all n >= 0. [A property shared with A048673 and A183209.]

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.]

A057198 a(n) = (5*3^(n-1)+1)/2.

Original entry on oeis.org

3, 8, 23, 68, 203, 608, 1823, 5468, 16403, 49208, 147623, 442868, 1328603, 3985808, 11957423, 35872268, 107616803, 322850408, 968551223, 2905653668, 8716961003, 26150883008, 78452649023, 235357947068, 706073841203, 2118221523608
Offset: 1

Views

Author

Colin Mallows and N. J. A. Sloane, Sep 16 2000

Keywords

Comments

It appears that if s(n) is a first-order rational sequence of the form s(0)=4, s(n) = (2*s(n-1)+1)/(s(n-1)+2), n > 0, then s(n) = a(n)/(a(n)-1), n > 0.

Examples

			G.f. = 3*x + 8*x^2 + 23*x^3 + 68*x^4 + 203*x^5 + 608*x^6 + 1823*x^7 + 5468*x^8 + ...
		

Crossrefs

Related to A046901.
Equals A060816 + 1.
Cf. A135423 (bisection), A191450 (2nd row).

Programs

Formula

a(n+1) = 3*a(n) - 1 for n > 1. - Reinhard Zumkeller, Jan 22 2011
G.f.: (5/2)*U(0) where U(k) = 1 + 2/(5*3^k + 5*3^k/(1 - 30*x*3^k/(15*x*3^k - 1/U(k+1)))); (continued fraction, 4-step). - Sergei N. Gladkovskii, Nov 01 2012
E.g.f.: (5/2)*U(0) where U(k) = 1 + 2/(5*3^k + 5*3^k/(1 - 30*x*3^k/(15*x*3^k - (k+1)/U(k+1)))); (continued fraction, 4-step). - Sergei N. Gladkovskii, Nov 01 2012
G.f.: x*(3-4*x) / ( (3*x-1)*(x-1) ). - R. J. Mathar, Jan 25 2015
E.g.f.: (5*exp(3*x) + 3*exp(x) - 8)/6. - Stefano Spezia, Aug 28 2023

Extensions

Incorrect zeroth term removed by Jon Perry, Oct 11 2012

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

A254105 Dispersion of A055938; starting from its complementary sequence A005187 as the first column of square array A(row,col), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

1, 2, 3, 5, 6, 4, 12, 13, 9, 7, 27, 28, 20, 14, 8, 58, 59, 43, 29, 17, 10, 121, 122, 90, 60, 36, 21, 11, 248, 249, 185, 123, 75, 44, 24, 15, 503, 504, 376, 250, 154, 91, 51, 30, 16, 1014, 1015, 759, 505, 313, 186, 106, 61, 33, 18, 2037, 2038, 1526, 1016, 632, 377, 217, 124, 68, 37, 19, 4084, 4085, 3061, 2039, 1271, 760, 440, 251, 139, 76, 40, 22
Offset: 1

Views

Author

Antti Karttunen, Jan 26 2015

Keywords

Comments

This sequence is one instance of Clark Kimberling's generic dispersion arrays. Paraphrasing his explanation in A191450, mutatis mutandis, we have the following definition:
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) = A055938(n), t(n) = A005187(n) [from term A005187(1) onward] and u(n) = A254112(n).
For other examples of such sequences, see the Crossrefs section. For a general introduction, please follow the Kimberling references.
The main diagonal: 1, 6, 20, 60, 154, 377, 887, 2040, 4598, 10229, 22515, 49139, ...

Examples

			The top left corner of the array:
   1,  2,  5,  12,  27,  58,  121,  248,  503,  1014,  2037,  4084
   3,  6, 13,  28,  59, 122,  249,  504, 1015,  2038,  4085,  8180
   4,  9, 20,  43,  90, 185,  376,  759, 1526,  3061,  6132, 12275
   7, 14, 29,  60, 123, 250,  505, 1016, 2039,  4086,  8181, 16372
   8, 17, 36,  75, 154, 313,  632, 1271, 2550,  5109, 10228, 20467
  10, 21, 44,  91, 186, 377,  760, 1527, 3062,  6133, 12276, 24563
  11, 24, 51, 106, 217, 440,  887, 1782, 3573,  7156, 14323, 28658
  15, 30, 61, 124, 251, 506, 1017, 2040, 4087,  8182, 16373, 32756
  16, 33, 68, 139, 282, 569, 1144, 2295, 4598,  9205, 18420, 36851
  18, 37, 76, 155, 314, 633, 1272, 2551, 5110, 10229, 20468, 40947
etc.
		

Crossrefs

Inverse: A254106.
Transpose: A254107.
Column 1: A005187.
Cf. also A000325, A095768, A123720 (Seem to be rows 1 - 3, the last one from its second term onward.)
Columnd index of n: A254111, Row index: A254112.
Examples of other arrays of dispersions: A114537, A035513, A035506, A191449, A191450, A191426-A191455.

Programs

Formula

If col = 1, then A(row,col) = A005187(row), otherwise A(row,col) = A055938(A(row,col-1)).
Showing 1-10 of 17 results. Next