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

A020988 a(n) = (2/3)*(4^n-1).

Original entry on oeis.org

0, 2, 10, 42, 170, 682, 2730, 10922, 43690, 174762, 699050, 2796202, 11184810, 44739242, 178956970, 715827882, 2863311530, 11453246122, 45812984490, 183251937962, 733007751850, 2932031007402, 11728124029610, 46912496118442, 187649984473770, 750599937895082
Offset: 0

Views

Author

Keywords

Comments

Numbers whose binary representation is 10, n times (see A163662(n) for n >= 1). - Alexandre Wajnberg, May 31 2005
Numbers whose base-4 representation consists entirely of 2's; twice base-4 repunits. - Franklin T. Adams-Watters, Mar 29 2006
Expected time to finish a random Tower of Hanoi problem with 2n disks using optimal moves, so (since 2n is even and A010684(2n) = 1) a(n) = A060590(2n). - Henry Bottomley, Apr 05 2001
a(n) is the number of derangements of [2n + 3] with runs consisting of consecutive integers. E.g., a(1) = 10 because the derangements of {1, 2, 3, 4, 5} with runs consisting of consecutive integers are 5|1234, 45|123, 345|12, 2345|1, 5|4|123, 5|34|12, 45|23|1, 345|2|1, 5|4|23|1, 5|34|2|1 (the bars delimit the runs). - Emeric Deutsch, May 26 2003
For n > 0, also smallest numbers having in binary representation exactly n + 1 maximal groups of consecutive zeros: A087120(n) = a(n-1), see A087116. - Reinhard Zumkeller, Aug 14 2003
Number of walks of length 2n + 3 between any two diametrically opposite vertices of the cycle graph C_6. Example: a(0) = 2 because in the cycle ABCDEF we have two walks of length 3 between A and D: ABCD and AFED. - Emeric Deutsch, Apr 01 2004
From Paul Barry, May 18 2003: (Start)
Row sums of triangle using cumulative sums of odd-indexed rows of Pascal's triangle (start with zeros for completeness):
0 0
1 1
1 4 4 1
1 6 14 14 6 1
1 8 27 49 49 27 8 1 (End)
a(n) gives the position of the n-th zero in A173732, i.e., A173732(a(n)) = 0 for all n and this gives all the zeros in A173732. - Howard A. Landman, Mar 14 2010
Smallest number having alternating bit sum -n. Cf. A065359. For n = 0, 1, ..., the last digit of a(n) is 0, 2, 0, 2, ... . - Washington Bomfim, Jan 22 2011
Number of toothpicks minus 1 in the toothpick structure of A139250 after 2^n stages. - Omar E. Pol, Mar 15 2012
For n > 0 also partial sums of the odd powers of 2 (A004171). - K. G. Stier, Nov 04 2013
Values of m such that binomial(4*m + 2, m) is odd. Cf. A002450. - Peter Bala, Oct 06 2015
For a(n) > 2, values of m such that m is two steps away from a power of 2 under the Collatz iteration. - Roderick MacPhee, Nov 10 2016
a(n) is the position of the first occurrence of 2^(n+1)-1 in A020986. See the Brillhart and Morton link, pp. 856-857. - John Keith, Jan 12 2021
a(n) is the number of monotone paths in the n-dimensional cross-polytope for a generic linear orientation. See the Black and De Loera link. - Alexander E. Black, Feb 15 2023

Crossrefs

Programs

Formula

a(n) = 4*a(n-1) + 2, a(0) = 0.
a(n) = A026644(2*n).
a(n) = A007583(n) - 1 = A039301(n+1) - 2 = A083584(n-1) + 1.
E.g.f. : (2/3)*(exp(4*x)-exp(x)). - Paul Barry, May 18 2003
a(n) = A007583(n+1) - 1 = A039301(n+2) - 2 = A083584(n) + 1. - Ralf Stephan, Jun 14 2003
G.f.: 2*x/((1-x)*(1-4*x)). - R. J. Mathar, Sep 17 2008
a(n) = a(n-1) + 2^(2n-1), a(0) = 0. - Washington Bomfim, Jan 22 2011
a(n) = A193652(2*n). - Reinhard Zumkeller, Aug 08 2011
a(n) = 5*a(n-1) - 4*a(n-2) (n > 1), a(0) = 0, a(1) = 2. - L. Edson Jeffery, Mar 02 2012
a(n) = (2/3)*A024036(n). - Omar E. Pol, Mar 15 2012
a(n) = 2*A002450(n). - Yosu Yurramendi, Jan 24 2017
From Seiichi Manyama, Nov 24 2017: (Start)
Zeta_{GL(2)/F_1}(s) = Product_{k = 1..4} (s-k)^(-b(2,k)), where Sum b(2,k)*t^k = t*(t-1)*(t^2-1). That is Zeta_{GL(2)/F_1}(s) = (s-3)*(s-2)/((s-4)*(s-1)).
Zeta_{GL(2)/F_1}(s) = Product_{n > 0} (1 - (1/s)^n)^(-A295521(n)) = Product_{n > 0} (1 - x^n)^(-A295521(n)) = (1-3*x)*(1-2*x)/((1-4*x)*(1-x)) = 1 + Sum_{k > 0} a(k-1)*x^k (x=1/s). (End)
From Oboifeng Dira, May 29 2020: (Start)
a(n) = A078008(2n+1) (second bisection).
a(n) = Sum_{k=0..n} binomial(2n+1, ((n+2) mod 3)+3k). (End)
From John Reimer Morales, Aug 04 2025: (Start)
a(n) = A000302(n) - A047849(n).
a(n) = A020522(n) + A000079(n) - A047849(n). (End)

Extensions

Edited by N. J. A. Sloane, Sep 06 2006

A061547 Number of 132 and 213-avoiding derangements of {1,2,...,n}.

Original entry on oeis.org

1, 0, 1, 2, 6, 10, 26, 42, 106, 170, 426, 682, 1706, 2730, 6826, 10922, 27306, 43690, 109226, 174762, 436906, 699050, 1747626, 2796202, 6990506, 11184810, 27962026, 44739242, 111848106, 178956970, 447392426, 715827882, 1789569706, 2863311530, 7158278826
Offset: 0

Views

Author

Emeric Deutsch, May 16 2001

Keywords

Comments

Or, number of permutations with no fixed points avoiding 213 and 132.
Number of derangements of {1,2,...,n} having ascending runs consisting of consecutive integers. Example: a(4)=6 because we have 234/1, 34/12, 34/2/1, 4/123, 4/3/12, 4/3/2/1, the ascending runs being as indicated. - Emeric Deutsch, Dec 08 2004
Let c be twice the sequence A002450 interlaced with itself (from the second term), i.e., c = 2*(0, 1, 1, 5, 5, 21, 21, 85, 85, 341, 341, ...). Let d be powers of 4 interlaced with the zero sequence: d = (1, 0, 4, 0, 16, 0, 64, 0, 256, 0, ...). Then a(n+1) = c(n) + d(n). - Creighton Dement, May 09 2005
Inverse binomial transform of A094705 (0, 1, 4, 15). - Paul Curtz, Jun 15 2008
Equals row sums of triangle A177993. - Gary W. Adamson, May 16 2010
a(n-1) is also the number of order preserving partial isometries (of an n-chain) of fix 1 (fix of alpha equals the number of fixed points of alpha). - Abdullahi Umar, Dec 28 2010
a(n+1) <= A218553(n) is also the Moore lower bound on the order of a (5,n)-cage. - Jason Kimberley, Oct 31 2011
For n > 0, a(n) is the location of the n-th new number to make a first appearance in A087230. E.g., the 17th number to make its first appearance in A087230 is 18 and this occurs at A087230(43690) and a(17)=43690. - K D Pegrume, Jan 26 2022
Position in A002487 of 2 adjacent terms of A000045. E.g., 3/5 at 10, 5/8 at 26, 8/13 at 42, ... - Ed Pegg Jr, Dec 27 2022

Examples

			a(4)=6 because the only 132 and 213-avoiding permutations of {1,2,3,4} without fixed points are: 2341, 3412, 3421, 4123, 4312 and 4321.
		

Crossrefs

Cf. A177993. - Gary W. Adamson, May 16 2010
Cf. A183158, A183159. - Abdullahi Umar, Dec 28 2010
Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), A027383 (k=3), A062318 (k=4), this sequence (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 31 2011

Programs

Formula

a(n) = (3/8)*2^n + (1/24)*(-2)^n - 2/3 for n>=1.
a(n) = 4*a(n-2) + 2, a(0)=1, a(1)=0, a(2)=1.
G.f: (5*z^3-3*z^2-z+1)/((z-1)*(4*z^2-1)).
a(n) = A020989((n-2)/2) for n=2, 4, 6, ... and A020988((n-3)/2) for n=3, 5, 7, ... .
a(n+1)-2*a(n) = A078008 signed. Differences: doubled A000302. - Paul Curtz, Jun 15 2008
a(2i+1) = 2*Sum_{j=0..i-1} 4^j = string "2"^i read in base 4.
a(2i+2) = 4^i + 2*Sum_{j=0..i-1} 4^j = string "1"*"2"^i read in base 4.
a(n+2) = Sum_{k=0..n} A144464(n,k)^2 = Sum_{k=0..n} A152716(n,k). - Philippe Deléham and Michel Marcus, Feb 26 2014
a(2*n-1) = A176965(2*n), a(2*n) = A176965(2*n-1) for n>0. - Yosu Yurramendi, Dec 23 2016
a(2*n-1) = A020988(k-1), a(2*n)= A020989(n-1) for n>0. - Yosu Yurramendi, Jan 03 2017
a(n+2) = 2*A086893(n), n > 0. - Yosu Yurramendi, Mar 07 2017
E.g.f.: (15 - 8*cosh(x) + 5*cosh(2*x) - 8*sinh(x) + 4*sinh(2*x))/12. - Stefano Spezia, Apr 07 2022

Extensions

a(0)=1 prepended by Alois P. Heinz, Jan 27 2022

A112468 Riordan array (1/(1-x), x/(1+x)).

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, -1, 1, 1, 0, 2, -2, 1, 1, 1, -2, 4, -3, 1, 1, 0, 3, -6, 7, -4, 1, 1, 1, -3, 9, -13, 11, -5, 1, 1, 0, 4, -12, 22, -24, 16, -6, 1, 1, 1, -4, 16, -34, 46, -40, 22, -7, 1, 1, 0, 5, -20, 50, -80, 86, -62, 29, -8, 1, 1, 1, -5, 25, -70, 130, -166, 148, -91, 37, -9, 1, 1, 0, 6, -30, 95, -200, 296, -314, 239, -128, 46, -10, 1
Offset: 0

Views

Author

Paul Barry, Sep 06 2005

Keywords

Comments

Row sums are A040000. Diagonal sums are A112469. Inverse is A112467. Row sums of k-th power are 1, k+1, k+1, k+1, .... Note that C(n,k) = Sum_{j=0..n-k} C(n-j-1, n-k-j).
Equals row reversal of triangle A112555 up to sign, where log(A112555) = A112555 - I. Unsigned row sums equals A052953 (Jacobsthal numbers + 1). Central terms of even-indexed rows are a signed version of A072547. Sums of squared terms in rows yields A112556, which equals the first differences of the unsigned central terms. - Paul D. Hanna, Jan 20 2006
Sum_{k=0..n} T(n,k)*x^k = A000012(n), A040000(n), A005408(n), A033484(n), A048473(n), A020989(n), A057651(n), A061801(n), A238275(n), A238276(n), A138894(n), A090843(n), A199023(n) for x = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 respectively (see the square array in A112739). - Philippe Deléham, Feb 22 2014

Examples

			Triangle starts
  1;
  1,  1;
  1,  0,  1;
  1,  1, -1,  1;
  1,  0,  2, -2,  1;
  1,  1, -2,  4, -3,  1;
  1,  0,  3, -6,  7, -4,  1;
Matrix log begins:
  0;
  1,  0;
  1,  0,  0;
  1,  1, -1,  0;
  1,  1,  1, -2,  0;
  1,  1,  1,  1, -3,  0; ...
Production matrix begins
  1,  1,
  0, -1,  1,
  0,  0, -1,  1,
  0,  0,  0, -1,  1,
  0,  0,  0,  0, -1,  1,
  0,  0,  0,  0,  0, -1,  1,
  0,  0,  0,  0,  0,  0, -1,  1.
- _Paul Barry_, Apr 08 2011
		

Crossrefs

Cf. A174294, A174295, A174296, A174297. - Mats Granvik, Mar 15 2010
Cf. A072547 (central terms), A112555 (reversed rows), A112465, A052953, A112556, A112739, A119258.
See A279006 for another version.

Programs

  • GAP
    T:= function(n,k)
        if k=0 or k=n then return 1;
        else return T(n-1,k-1) - T(n-1,k);
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Nov 13 2019
  • Haskell
    a112468 n k = a112468_tabl !! n !! k
    a112468_row n = a112468_tabl !! n
    a112468_tabl = iterate (\xs -> zipWith (-) ([2] ++ xs) (xs ++ [0])) [1]
    -- Reinhard Zumkeller, Jan 03 2014
    
  • Magma
    function T(n,k)
      if k eq 0 or k eq n then return 1;
      else return T(n-1,k-1) - T(n-1,k);
      end if;
      return T;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 13 2019
    
  • Maple
    T := (n,k,m) -> (1-m)^(-n+k)-m^(k+1)*pochhammer(n-k,k+1)*hypergeom( [1,n+1],[k+2],m)/(k+1)!; A112468 := (n,k) -> T(n,n-k,-1);
    seq(print(seq(simplify(A112468(n,k)),k=0..n)),n=0..10); # Peter Luschny, Jul 25 2014
  • Mathematica
    T[n_, 0] = 1; T[n_, n_] = 1; T[n_, k_ ]:= T[n, k] = T[n-1, k-1] - T[n-1, k]; Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* Jean-François Alcover, Mar 06 2013 *)
  • PARI
    {T(n,k)=local(m=1,x=X+X*O(X^n),y=Y+Y*O(Y^k)); polcoeff(polcoeff((1+(m-1)*x)*(1+m*x)/(1+m*x-x*y)/(1-x),n,X),k,Y)} \\ Paul D. Hanna, Jan 20 2006
    
  • PARI
    T(n,k) = if(k==0 || k==n, 1, T(n-1, k-1) - T(n-1, k)); \\ G. C. Greubel, Nov 13 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k<0 or n<0): return 0
        elif (k==0 or k==n): return 1
        else: return T(n-1, k-1) - T(n-1, k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 13 2019
    

Formula

Triangle T(n,k) read by rows: T(n,0)=1, T(n,k) = T(n-1,k-1) - T(n-1,k). - Mats Granvik, Mar 15 2010
Number triangle T(n, k)= Sum_{j=0..n-k} C(n-j-1, n-k-j)*(-1)^(n-k-j).
G.f. of matrix power T^m: (1+(m-1)*x)*(1+m*x)/(1+m*x-x*y)/(1-x). G.f. of matrix log: x*(1-2*x*y+x^2*y)/(1-x*y)^2/(1-x). - Paul D. Hanna, Jan 20 2006
T(n, k) = R(n,n-k,-1) where R(n,k,m) = (1-m)^(-n+k)-m^(k+1)*Pochhammer(n-k,k+1)*hyper2F1([1,n+1],[k+2],m)/(k+1)!. - Peter Luschny, Jul 25 2014

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

Original entry on oeis.org

1, 7, 37, 187, 937, 4687, 23437, 117187, 585937, 2929687, 14648437, 73242187, 366210937, 1831054687, 9155273437, 45776367187, 228881835937, 1144409179687, 5722045898437, 28610229492187, 143051147460937, 715255737304687, 3576278686523437, 17881393432617187, 89406967163085937
Offset: 0

Views

Author

N. J. A. Sloane, Oct 13 2000

Keywords

Comments

Sum of n-th row of triangle of powers of 5: 1; 1 5 1; 1 5 25 5 1 ; 1 5 25 125 25 5 1; ... - Philippe Deléham, Feb 23 2014

Examples

			a(0) = 1;
a(1) = 1 + 5 + 1 = 7;
a(2) = 1 + 5 + 25 + 5 + 1 = 37;
a(3) = 1 + 5 + 25 + 125 + 25 + 5 + 1 = 187; etc. - _Philippe Deléham_, Feb 23 2014
G.f. = 1 + 7*x + 37*x^2 + 187*x^3 + 937*x^4 + 4687*x^5 + 23437*x^6 + ...
		

Crossrefs

Programs

Formula

G.f.: (1+x)/(1 - 6*x + 5*x^2).
a(0)=1, a(n) = 5*a(n-1) + 2; a(n) = a(n-1) + 6*(5^(n-1)). - Amarnath Murthy, May 27 2001
a(n) = 6*a(n-1) - 5*a(n-2), n > 1. - Vincenzo Librandi, Oct 30 2011
a(n) = Sum_{k=0..n} A112468(n,k)*6^k. - Philippe Deléham, Feb 23 2014
From Elmo R. Oliveira, Mar 29 2025: (Start)
E.g.f.: exp(x)*(3*exp(4*x) - 1)/2.
a(n) = A097162(2*n) = A198762(n)/2. (End)

A016127 Expansion of g.f. 1/((1-2*x)*(1-5*x)).

Original entry on oeis.org

1, 7, 39, 203, 1031, 5187, 25999, 130123, 650871, 3254867, 16275359, 81378843, 406898311, 2034499747, 10172515119, 50862608363, 254313107351, 1271565667827, 6357828601279, 31789143530683, 158945718701991, 794728595607107, 3973642982229839, 19868214919537803, 99341074614466231
Offset: 0

Views

Author

Keywords

Comments

With leading zero, binomial transform of A002450. - Paul Barry, Apr 11 2003
The sequence of fractions a(n)/(n+1) is the 3rd binomial transform of the sequence of fractions J(n+1)/(n+1) where J(n) is A001045(n). - Paul Barry, Aug 05 2005
Equals term (1,2) in M^n, M = the 3 X 3 matrix [1, 1, 3; 1, 3, 1; 3, 1, 1]. a(n)/a(n-1) tends to 5, a root to the charpoly x^3 - 5*x^2 - 4*x + 20. - Gary W. Adamson, Mar 12 2009

Crossrefs

Programs

Formula

a(n) = (5^(n+1) - 2^(n+1))/3 = Sum_{i=0..n} 5^i*2^(n-1) = 5*a(n-1) + 2^n = 2*a(n-1) + 5^n. - Henry Bottomley, Apr 07 2003
Binomial transform of A020989. - Paul Barry, May 18 2003
From Paul Barry, Aug 05 2005: (Start)
a(n) = Sum_{k=0..n} Sum_{j=0..n} 5^(n-j)*binomial(j,k).
a(n) = Sum_{k=0..n} 2^k*5^(n-k) = Sum_{k=0..n} 5^k*2^(n-k). (End)
For n > 2, a(n) = 9*a(n-1) - 24*a(n-2) + 20*a(n-3). - Gary W. Adamson, Dec 26 2007
From Elmo R. Oliveira, Mar 31 2025: (Start)
E.g.f.: exp(2*x)*(5*exp(3*x) - 2)/3.
a(n) = A005057(n+1)/3.
a(n) = 7*a(n-1) - 10*a(n-2). (End)

A081254 Numbers k such that A081252(m)/m^2 has a local maximum for m = k.

Original entry on oeis.org

1, 3, 6, 13, 26, 53, 106, 213, 426, 853, 1706, 3413, 6826, 13653, 27306, 54613, 109226, 218453, 436906, 873813, 1747626, 3495253, 6990506, 13981013, 27962026, 55924053, 111848106, 223696213, 447392426, 894784853, 1789569706, 3579139413
Offset: 1

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Comments

The limit of the local maxima, lim_{m->inf} A081252(m)/m^2 = 1/10. For local minima cf. A081253.
Row sums of the triangle A181971. - Reinhard Zumkeller, Jul 09 2012

Examples

			13 is a term since A081252(12)/12^2 = 15/144 = 0.104..., A081252(13)/13^2 = 18/169 = 0.106..., A081252(14)/14^2 = 20/196 = 0.102....
		

Crossrefs

Programs

  • Magma
    [Floor(2^(n-1)*5/3): n in [1..40]]; // Vincenzo Librandi, Apr 04 2012
    
  • Maple
    seq(floor(2^(n-1)*5/3),n=1..35); # Muniru A Asiru, Sep 20 2018
  • Mathematica
    Rest@CoefficientList[Series[-(x^2 - x - 1)*x/((x - 1)*(x + 1)*(2*x - 1)), {x, 0, 32}], x] (* Vincenzo Librandi, Apr 04 2012 *)
    a[n_]:=Floor[2^(n-1)*5/3]; Array[a,33,1] (* Stefano Spezia, Sep 01 2018 *)
  • PARI
    a(n) = 2^(n-1)*5\3; \\ Altug Alkan, Sep 21 2018

Formula

a(n) = floor(2^(n-1)*5/3). [corrected by Michel Marcus, Sep 21 2018]
a(n) = a(n-2) + 5*2^(n-3) for n > 2;
a(n+2) - a(n) = A020714(n-1);
a(n) + a(n-1) = A052549(n-1) for n > 1;
a(2*n+1) = A020989(n); a(2n) = A072197(n-1);
a(n+1) - a(n) = A048573(n-1).
G.f.: -(x^2 - x - 1)*x/((x - 1)*(x + 1)*(2*x - 1)).
a(n) = 5*2^(n-1)/3 + (-1)^n/6-1/2. a(n) = 2*a(n-1) + (1+(-1)^n)/2, a(1)=1. - Paul Barry, Mar 24 2003
a(2n) = 2*a(2*n-1) + 1, a(2*n+1) = 2*a(2*n), a(1)=1. a(n) = A000975(n-1) + 2^(n-1). - Philippe Deléham, Oct 15 2006
a(n) = A005578(n) + A000225(n-1). - Yuchun Ji, Sep 21 2018
a(n) - a(n-2) = 2 * (a(n-1) - a(n-3)), with a(0..2)=[1,3,6]. - Yuchun Ji, Mar 18 2020

A084214 Inverse binomial transform of a math magic problem.

Original entry on oeis.org

1, 1, 4, 6, 14, 26, 54, 106, 214, 426, 854, 1706, 3414, 6826, 13654, 27306, 54614, 109226, 218454, 436906, 873814, 1747626, 3495254, 6990506, 13981014, 27962026, 55924054, 111848106, 223696214, 447392426, 894784854, 1789569706, 3579139414, 7158278826, 14316557654
Offset: 0

Views

Author

Paul Barry, May 19 2003

Keywords

Comments

Inverse binomial transform of A060816.

Crossrefs

Programs

  • Haskell
    a084214 n = a084214_list !! n
    a084214_list = 1 : xs where
       xs = 1 : 4 : zipWith (+) (map (* 2) xs) (tail xs)
    -- Reinhard Zumkeller, Aug 01 2011
    
  • Magma
    [(5*2^n-3*0^n+4*(-1)^n)/6: n in [0..35]]; // Vincenzo Librandi, Jun 15 2011
    
  • Maple
    A084214 := proc(n)
        (5*2^n - 3*0^n + 4*(-1)^n)/6 ;
    end proc:
    seq(A084214(n),n=0..60) ; # R. J. Mathar, Aug 18 2024
  • Mathematica
    f[n_]:=2/(n+1);x=3;Table[x=f[x];Numerator[x],{n,0,5!}] (* Vladimir Joseph Stephan Orlovsky, Mar 12 2010 *)
    LinearRecurrence[{1,2},{1,1,4},50] (* Harvey P. Dale, Mar 05 2021 *)
  • PARI
    a(n) = 5<<(n-1)\3 + bitnegimply(1,n); \\ Kevin Ryde, Dec 20 2023

Formula

a(n) = (5*2^n - 3*0^n + 4*(-1)^n)/6.
G.f.: (1+x^2)/((1+x)*(1-2*x)).
E.g.f.: (5*exp(2*x) - 3*exp(0) + 4*exp(-x))/6.
From Paul Barry, May 04 2004: (Start)
The binomial transform of a(n+1) is A020989(n).
a(n) = A001045(n-1) + A001045(n+1) - 0^n/2. (End)
a(n) = Sum_{k=0..n} A001045(n+1)*C(1, k/2)*(1+(-1)^k)/2. - Paul Barry, Oct 15 2004
a(n) = a(n-1) + 2*a(n-2) for n > 2. - Klaus Brockhaus, Dec 01 2009
From Yuchun Ji, Mar 18 2019: (Start)
a(n+1) = Sum_{i=0..n} a(i) + 1 - (-1)^n, a(0)=1.
a(n) = A000975(n-3)*10 + 5 + (-1)^(n-3), a(0)=1, a(1)=1, a(2)=4. (End)
a(n) = A081254(n) + (n-1 mod 2). - Kevin Ryde, Dec 20 2023
a(n) = 2*A048573(n-2) for n>=2. - Alois P. Heinz, May 20 2025

A162911 Numerators of drib tree fractions, where drib is the bit-reversal permutation tree of the Bird tree.

Original entry on oeis.org

1, 1, 2, 2, 3, 1, 3, 3, 5, 1, 4, 3, 4, 2, 5, 5, 8, 2, 7, 4, 5, 3, 7, 4, 7, 1, 5, 5, 7, 3, 8, 8, 13, 3, 11, 7, 9, 5, 12, 5, 9, 1, 6, 7, 10, 4, 11, 7, 11, 3, 10, 5, 6, 4, 9, 7, 12, 2, 9, 8, 11, 5, 13, 13, 21, 5, 18, 11, 14, 8, 19, 9, 16, 2, 11, 12, 17, 7, 19, 9, 14, 4, 13, 6, 7, 5, 11, 10, 17, 3, 13
Offset: 1

Views

Author

Ralf Hinze (ralf.hinze(AT)comlab.ox.ac.uk), Aug 05 2009

Keywords

Comments

The drib tree is an infinite binary tree labeled with rational numbers. It is generated by the following iterative process: start with the rational 1; for the left subtree increment and then reciprocalize the current rational; for the right subtree interchange the order of the two steps: the rational is first reciprocalized and then incremented. Like the Stern-Brocot and the Bird tree, the drib tree enumerates all the positive rationals (A162911(n)/A162912(n)).
From Yosu Yurramendi, Jul 11 2014: (Start)
If the terms (n>0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
1,
1, 2,
2, 3,1, 3,
3, 5,1, 4, 3, 4,2, 5,
5, 8,2, 7, 4, 5,3, 7,4, 7,1, 5, 5, 7,3, 8,
...
then the sum of the m-th row is 3^m (m = 0,1,2,), each column k is a Fibonacci-type sequence.
If the rows are written in a right-aligned fashion:
1
1, 2
2, 3,1, 3
3, 5,1, 4, 3, 4,2, 5
5, 8,2, 7,4, 5,3, 7, 4, 7,1, 5, 5, 7,3, 8
...
then each column k also is a Fibonacci-type sequence.
If the sequence is considered by blocks of length 2^m, m = 0,1,2,..., the blocks of this sequence are the reverses of blocks of A162912 (a(2^m+k) = A162912(2^(m+1)-1-k), m = 0,1,2,..., k = 0..2^m-1).
(End)
From Yosu Yurramendi, Jan 12 2017: (Start)
a(2^(m+2m' ) + A020988(m')) = A000045(m+1), m>=0, m'>=0
a(2^(m+2m'+1) + A020989(m')) = A000045(m+3), m>=0, m'>=0
a(2^(m+2m' ) - 1 - A002450(m')) = A000045(m+1), m>=0, m'>=0
a(2^(m+2m'+1) - 1 - A072197(m'-1)) = A000045(m+3), m>=0, m'>0
a(2^(m+1) -1) = A000045(m+2), m>=0. (End)

Examples

			The first four levels of the drib tree:
  [1/1],
  [1/2, 2/1],
  [2/3, 3/1, 1/3, 3/2],
  [3/5, 5/2, 1/4, 4/3, 3/4, 4/1, 2/5, 5/3].
		

Crossrefs

This sequence is the composition of A162909 and A059893: a(n) = A162909(A059893(n)). This sequence is a permutation of A002487(n+1).

Programs

  • Haskell
    import Ratio; drib :: [Rational]; drib = 1 : map (recip . succ) drib \/ map (succ . recip) drib; (a : as) \/ bs = a : (bs \/ as); a162911 = map numerator drib; a162912 = map denominator drib
    
  • PARI
    a(n) = my(x = 0, y = 1); forstep(i = logint(n, 2), 0, -1, [x, y] = if(bittest(n, i), [y, x + y], [x + y, x])); y \\ Mikhail Kurkov, Oct 12 2023
  • R
    blocklevel <- 6 # arbitrary
    a <- 1
    for(m in 0:blocklevel) for(k in 0:(2^m-1)){
      a[2^(m+1)+2*k  ] <- a[2^(m+1)-1-k]
      a[2^(m+1)+2*k+1] <- a[2^(m+1)-1-k] + a[2^m+k]
    }
    a
    # Yosu Yurramendi, Jul 11 2014
    

Formula

a(n) where a(1) = 1; a(2n) = b(n); a(2n+1) = a(n) + b(n); and b(1) = 1; b(2n) = a(n) + b(n); b(2n+1) = a(n).
a(2^(m+1)+2*k) = a(2^(m+1)-k-1), a(2^(m+1)+2*k+1) = a(2^(m+1)-k-1) + a(2^m+k), a(1) = 1, m>=0, k=0..2^m-1. - Yosu Yurramendi, Jul 11 2014
a(2^(m+1) + 2*k) = A162912(2^m + k), m >= 0, 0 <= k < 2^m.
a(2^(m+1) + 2*k + 1) = a(2^m + k) + A162912(2^m + k), m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Mar 30 2016
a(n*2^m + A176965(m)) = A268087(n), n > 0, m > 0. - Yosu Yurramendi, Feb 20 2017
a(n) = A002487(A258996(n)), n > 0. - Yosu Yurramendi, Jun 23 2021

A087230 a(n) is the 2-adic valuation of 6*n + 4.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Aug 28 2003

Keywords

Comments

In Collatz-algorithm if initiated with m=odd value, the first 3x+1 step is followed by a(n) step corresponding to division by 2. Compare to A085058 and A087229. Each 2nd term is either =1 or equals corresponding term of A087229, depending on whether the odd number congruent to 1 or 3 modulo 4.
From K. G. Stier, Aug 19 2014: (Start)
Sequence exhibits a "pseudo" ruler function (A001511) behavior. It is similar to the latter in repeating equal terms m>0 after each 2^m steps. However, the first occurrence of m in the mentioned ruler function is simply at n=log_2(m), while in the given sequence this property develops two distinct (odd and even) strands:
First occurrence of
m=1 at a(1); m=2 at a(0)
m=3 at a(6); m=4 at a(2)
m=5 at a(26); m=6 at a(10)
m=7 at a(106); m=8 at a(42)
m=9 at a(426); m=10 at a(170)
...
where values n in the odd strand (1,6,26,106,426,...) equal sequence A020989, and values n in the even strand (0,2,10,42,170,...) equal sequence A020988. (End)

Examples

			n=85: m = 6*85+4 = 514 and Collatz-iteration goes on by one dividing step, a(85)=1.
		

Crossrefs

Programs

  • Maple
    a:= n-> padic[ordp](6*n+4, 2):
    seq(a(n), n=0..120);  # Alois P. Heinz, Mar 16 2021
  • Mathematica
    Table[Part[Part[FactorInteger[6*w+4], 1], 2], {w, 0, 100}]
    Table[IntegerExponent[6*n + 4, 2], {n, 0, 100}] (* Amiram Eldar, Jan 27 2022 *)
  • PARI
    forstep(n=0, 1000, 1, m=6*n+4; print1(valuation(m, 2), ", ") ) \\ K. G. Stier, Aug 19 2014
    
  • Perl
    sub a {
      my $nv= ((shift() << 1) | 1);
      my $bp= 1;
      while (($nv & 1) xor ($nv & 2)) {
        $nv>>= 1;
        $bp++;
      }
      return $bp;
    } # Ruud H.G. van Tol, Nov 16 2021
  • Python
    n=100; N=3*n+2; val=[1]*(N+1); exp=2
    while exp <= N:
        for j in range(exp,N+1,exp): val[j] += 1
        exp *= 2
    for i in range(n+1): print(i,val[3*i+2])
    # Kenny Lau, Jun 09 2018
    
  • Python
    def A087230(n): return (~(m:=6*n+4) & m-1).bit_length() # Chai Wah Wu, Jul 02 2022
    

Formula

a(n) = A007814(A016957(n)). - Michel Marcus, Jan 27 2022
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Sep 10 2024

Extensions

a(0) = 2 prepended by Andrey Zabolotskiy, Jan 27 2022, based on Ihar Senkevich's contribution

A112739 Array counting nodes in rooted trees of height n in which the root and internal nodes have valency k (and the leaf nodes have valency one).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 5, 2, 1, 1, 5, 10, 7, 2, 1, 1, 6, 17, 22, 9, 2, 1, 1, 7, 26, 53, 46, 11, 2, 1, 1, 8, 37, 106, 161, 94, 13, 2, 1, 1, 9, 50, 187, 426, 485, 190, 15, 2, 1, 1, 10, 65, 302, 937, 1706, 1457, 382, 17, 2, 1, 1, 11, 82, 457, 1814, 4687, 6826, 4373, 766, 19
Offset: 0

Views

Author

Paul Barry, Sep 16 2005

Keywords

Comments

Rows of the square array have g.f. (1+x)/((1-x)(1-kx)). They are the partial sums of the coordination sequences for the infinite tree of valency k. Row sums are A112740.
Rows of the square array are successively: A000012, A040000, A005408, A033484, A048473, A020989, A057651, A061801, A238275, A238276, A138894, A090843, A199023. - Philippe Deléham, Feb 22 2014

Examples

			As a square array, rows begin
1,1,1,1,1,1,... (A000012)
1,2,2,2,2,2,... (A040000)
1,3,5,7,9,11,... (A005408)
1,4,10,22,46,94,... (A033484)
1,5,17,53,161,485,... (A048473)
1,6,26,106,426,1706,... (A020989)
1,7,37,187,937,4687,... (A057651)
1,8,50,302,1814,10886,... (A061801)
As a number triangle, rows start
1;
1,1;
1,2,1;
1,3,2,1;
1,4,5,2,1;
1,5,10,7,2,1;
		

References

  • L. He, X. Liu and G. Strang, (2003) Trees with Cantor Eigenvalue Distribution. Studies in Applied Mathematics 110 (2), 123-138.
  • L. He, X. Liu and G. Strang, Laplacian eigenvalues of growing trees, Proc. Conf. on Math. Theory of Networks and Systems, Perpignan (2000).

Crossrefs

Formula

As a square array read by antidiagonals, T(n, k)=sum{j=0..k, (2-0^j)*(n-1)^(k-j)}; T(n, k)=(n(n-1)^k-2)/(n-2), n<>2, T(2, n)=2n+1; T(n, k)=sum{j=0..k, (n(n-1)^j-0^j)/(n-1)}, j<>1. As a triangle read by rows, T(n, k)=if(k<=n, sum{j=0..k, (2-0^j)*(n-k-1)^(k-j)}, 0).
Showing 1-10 of 29 results. Next