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

A002129 Generalized sum of divisors function: excess of sum of odd divisors of n over sum of even divisors of n.

Original entry on oeis.org

1, -1, 4, -5, 6, -4, 8, -13, 13, -6, 12, -20, 14, -8, 24, -29, 18, -13, 20, -30, 32, -12, 24, -52, 31, -14, 40, -40, 30, -24, 32, -61, 48, -18, 48, -65, 38, -20, 56, -78, 42, -32, 44, -60, 78, -24, 48, -116, 57, -31, 72, -70, 54, -40, 72, -104, 80, -30, 60, -120, 62, -32, 104, -125
Offset: 1

Views

Author

Keywords

Comments

Glaisher calls this zeta(n) or zeta_1(n). - N. J. A. Sloane, Nov 24 2018
Coefficients in expansion of Sum_{n >= 1} x^n/(1+x^n)^2 = Sum_{n >= 1} (-1)^(n-1)*n*x^n/(1-x^n).
Unsigned sequence is A113184. - Peter Bala, Dec 14 2020

Examples

			a(28) = 40 because the sum of the even divisors of 28 (2, 4, 14 and 28) = 48 and the sum of the odd divisors of 28 (1 and 7) = 8, their absolute difference being 40.
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 162, #16, (6), 3rd formula.
  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 259-262.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A060044.
a(2^n) = -A036563(n+1). a(3^n) = A003462(n+1).
First differences of -A024919(n).

Programs

  • Maple
    A002129 := proc(n) -add((-1)^d*d,d=numtheory[divisors](n)) ; end proc: # R. J. Mathar, Mar 05 2011
  • Mathematica
    f[n_] := Block[{c = Divisors@ n}, Plus @@ Select[c, EvenQ] - Plus @@ Select[c, OddQ]]; Array[f, 64] (* Robert G. Wilson v, Mar 04 2011 *)
    a[n_] := DivisorSum[n, -(-1)^#*#&]; Array[a, 80] (* Jean-François Alcover, Dec 01 2015 *)
    f[p_, e_] := If[p == 2, 3 - 2^(e + 1), (p^(e + 1) - 1)/(p - 1)]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]);  Array[a, 64] (* Amiram Eldar, Jul 20 2019 *)
  • PARI
    a(n)=if(n<1,0,-sumdiv(n,d,(-1)^d*d))
    
  • PARI
    {a(n)=n*polcoeff(log(sum(k=0,(sqrtint(8*n+1)-1)\2,x^(k*(k+1)/2))+x*O(x^n)),n)} \\ Paul D. Hanna, Jun 28 2008

Formula

Multiplicative with a(p^e) = 3-2^(e+1) if p = 2; (p^(e+1)-1)/(p-1) if p > 2. - David W. Wilson, Sep 01 2001
G.f.: Sum_{n>=1} n*x^n*(1-3*x^n)/(1-x^(2*n)). - Vladeta Jovovic, Oct 15 2002
L.g.f.: Sum_{n>=1} a(n)*x^n/n = log[ Sum_{n>=0} x^(n(n+1)/2) ], the log of the g.f. of A010054. - Paul D. Hanna, Jun 28 2008
Dirichlet g.f. zeta(s)*zeta(s-1)*(1-4/2^s). Dirichlet convolution of A000203 and the quasi-finite (1,-4,0,0,0,...). - R. J. Mathar, Mar 04 2011
a(n) = A000593(n)-A146076(n). - R. J. Mathar, Mar 05 2011
a(n) = Sum_{j = 1..n} Sum_{k = 1..j} (-1)^(j+1)*cos(2*k*n*Pi/j). - Peter Bala, Aug 24 2022
G.f.: Sum_{n>=1} n*(-x)^(n-1)/(1-x^n). - Mamuka Jibladze, Jun 03 2025

Extensions

Better description and more terms from Robert G. Wilson v, Dec 14 2000
More terms from N. J. A. Sloane, Mar 19 2001

A033484 a(n) = 3*2^n - 2.

Original entry on oeis.org

1, 4, 10, 22, 46, 94, 190, 382, 766, 1534, 3070, 6142, 12286, 24574, 49150, 98302, 196606, 393214, 786430, 1572862, 3145726, 6291454, 12582910, 25165822, 50331646, 100663294, 201326590, 402653182, 805306366, 1610612734, 3221225470
Offset: 0

Views

Author

Keywords

Comments

Number of nodes in rooted tree of height n in which every node (including the root) has valency 3.
Pascal diamond numbers: reflect Pascal's n-th triangle vertically and sum all elements. E.g., a(3)=1+(1+1)+(1+2+1)+(1+1)+1. - Paul Barry, Jun 23 2003
Number of 2 X n binary matrices avoiding simultaneously the right-angled numbered polyomino patterns (ranpp) (00;1), (10;0) and (11;0). An occurrence of a ranpp (xy;z) in a matrix A=(a(i,j)) is a triple (a(i1,j1), a(i1,j2), a(i2,j1)) where i1 < i2 and j1 < j2 and these elements are in the same relative order as those in the triple (x,y,z). - Sergey Kitaev, Nov 11 2004
Binomial and inverse binomial transform are in A001047 (shifted) and A122553. - R. J. Mathar, Sep 02 2008
a(n) = (Sum_{k=0..n-1} a(n)) + (2*n + 1); e.g., a(3) = 22 = (1 + 4 + 10) + 7. - Gary W. Adamson, Jan 21 2009
Let P(A) be the power set of an n-element set A and R be a relation on P(A) such that for all x, y of P(A), xRy if either 0) x is a proper subset of y or y is a proper subset of x and x and y are disjoint, or 1) x equals y. Then a(n) = |R|. - Ross La Haye, Mar 19 2009
Equals the Jacobsthal sequence A001045 convolved with (1, 3, 4, 4, 4, 4, 4, ...). - Gary W. Adamson, May 24 2009
Equals the eigensequence of a triangle with the odd integers as the left border and the rest 1's. - Gary W. Adamson, Jul 24 2010
An elephant sequence, see A175655. For the central square four A[5] vectors, with decimal values 58, 154, 178 and 184, lead to this sequence. For the corner squares these vectors lead to the companion sequence A097813. - Johannes W. Meijer, Aug 15 2010
a(n+2) is the integer with bit string "10" * "1"^n * "10".
a(n) = A027383(2n). - Jason Kimberley, Nov 03 2011
a(n) = A153893(n)-1 = A083416(2n+1). - Philippe Deléham, Apr 14 2013
a(n) = A082560(n+1,A000079(n)) = A232642(n+1,A128588(n+1)). - Reinhard Zumkeller, May 14 2015
a(n) is the sum of the entries in the n-th and (n+1)-st rows of Pascal's triangle minus 2. - Stuart E Anderson, Aug 27 2017
Also the number of independent vertex sets and vertex covers in the complete tripartite graph K_{n,n,n}. - Eric W. Weisstein, Sep 21 2017
Apparently, a(n) is the least k such that the binary expansion of A000045(k) ends with exactly n+1 ones. - Rémy Sigrist, Sep 25 2021
a(n) is the number of root ancestral configurations for a pair consisting of a matching gene tree and species tree with the modified lodgepole shape and n+1 cherry nodes. - Noah A Rosenberg, Jan 16 2025

Examples

			Binary: 1, 100, 1010, 10110, 101110, 1011110, 10111110, 101111110, 1011111110, 10111111110, 101111111110, 1011111111110, 10111111111110,
G.f. = 1 + 4*x + 10*x^2 + 22*x^3 + 46*x^4 + 94*x^5 + 190*x^6 + 382*x^7 + ...
		

References

  • J. Riordan, Series-parallel realization of the sum modulo 2 of n switching variables, in Claude Elwood Shannon: Collected Papers, edited by N. J. A. Sloane and A. D. Wyner, IEEE Press, NY, 1993, pp. 877-878.

Crossrefs

Programs

  • GAP
    List([0..35], n-> 3*2^n -2); # G. C. Greubel, Nov 18 2019
  • Haskell
    a033484 = (subtract 2) . (* 3) . (2 ^)
    a033484_list = iterate ((subtract 2) . (* 2) . (+ 2)) 1
    -- Reinhard Zumkeller, Apr 23 2013
    
  • Magma
    [3*2^n-2: n in [1..36]]; // Vincenzo Librandi, Nov 22 2010
    
  • Maple
    with(combinat):a:=n->stirling2(n,2)+stirling2(n+1,2): seq(a(n), n=1..35); # Zerinvary Lajos, Oct 07 2007
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=(a[n-1]+1)*2 od: seq(a[n], n=1..35); # Zerinvary Lajos, Feb 22 2008
  • Mathematica
    Table[3 2^n - 2, {n, 0, 35}] (* Vladimir Joseph Stephan Orlovsky, Dec 16 2008 *)
    (* Start from Eric W. Weisstein, Sep 21 2017 *)
    3*2^Range[0, 35] - 2
    LinearRecurrence[{3, -2}, {1, 4}, 36]
    CoefficientList[Series[(1+x)/(1-3x+2x^2), {x, 0, 35}], x] (* End *)
  • PARI
    a(n) = 3<Charles R Greathouse IV, Nov 02 2011
    
  • Sage
    [3*2^n -2 for n in (0..35)] # G. C. Greubel, Nov 18 2019
    

Formula

G.f.: (1+x)/(1-3*x+2*x^2).
a(n) = 2*(a(n-1) + 1) for n>0, with a(0)=1.
a(n) = A007283(n) - 2.
G.f. is equivalent to (1-2*x-3*x^2)/((1-x)*(1-2*x)*(1-3*x)). - Paul Barry, Apr 28 2004
From Reinhard Zumkeller, Oct 09 2004: (Start)
A099257(a(n)) = A099258(a(n)) = a(n).
a(n) = 2*A055010(n) = (A068156(n) - 1)/2. (End)
Row sums of triangle A130452. - Gary W. Adamson, May 26 2007
Row sums of triangle A131110. - Gary W. Adamson, Jun 15 2007
Binomial transform of (1, 3, 3, 3, ...). - Gary W. Adamson, Oct 17 2007
Row sums of triangle A051597 (a triangle generated from Pascal's rule given right and left borders = 1, 2, 3, ...). - Gary W. Adamson, Nov 04 2007
Equals A132776 * [1/1, 1/2, 1/3, ...]. - Gary W. Adamson, Nov 16 2007
a(n) = Sum_{k=0..n} A112468(n,k)*3^k. - Philippe Deléham, Feb 23 2014
a(n) = -(2^n) * A036563(1-n) for all n in Z. - Michael Somos, Jul 04 2017
E.g.f.: 3*exp(2*x) - 2*exp(x). - G. C. Greubel, Nov 18 2019

A083329 a(0) = 1; for n > 0, a(n) = 3*2^(n-1) - 1.

Original entry on oeis.org

1, 2, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303, 196607, 393215, 786431, 1572863, 3145727, 6291455, 12582911, 25165823, 50331647, 100663295, 201326591, 402653183, 805306367, 1610612735, 3221225471, 6442450943
Offset: 0

Views

Author

Paul Barry, Apr 27 2003

Keywords

Comments

Apart from leading term (which should really be 3/2), same as A055010.
Binomial transform of A040001. Inverse binomial transform of A053156.
a(n) = A105728(n+1,2). - Reinhard Zumkeller, Apr 18 2005
Row sums of triangle A133567. - Gary W. Adamson, Sep 16 2007
Row sums of triangle A135226. - Gary W. Adamson, Nov 23 2007
a(n) = number of partitions Pi of [n+1] (in standard increasing form) such that the permutation Flatten[Pi] avoids the patterns 2-1-3 and 3-1-2. Example: a(3)=11 counts all 15 partitions of [4] except 13/24, 13/2/4 which contain a 2-1-3 and 14/23, 14/2/3 which contain a 3-1-2. Here "standard increasing form" means the entries are increasing in each block and the blocks are arranged in increasing order of their first entries. - David Callan, Jul 22 2008
An elephant sequence, see A175654. For the corner squares four A[5] vectors, with decimal values 42, 138, 162, 168, lead to this sequence. For the central square these vectors lead to the companion sequence A003945. - Johannes W. Meijer, Aug 15 2010
The binary representation of a(n) has n+1 digits, where all digits are 1's except digit n-1. For example: a(4) = 23 = 10111 (2). - Omar E. Pol, Dec 02 2012
Row sums of triangle A209561. - Reinhard Zumkeller, Dec 26 2012
If a Stern's sequence based enumeration system of positive irreducible fractions is considered (for example, A007305/A047679, A162909/A162910, A071766/A229742, A245325/A245326, ...), and if it is organized by blocks or levels (n) with 2^n terms (n >= 0), and the fractions, term by term, are summed at each level n, then the resulting sequence of integers is a(n) + 1/2, apart from leading term (which should be 1/2). - Yosu Yurramendi, May 23 2015
For n >= 2, A083329(n) in binary representation is a string [101..1], also 10 followed with (n-1) 1's. For n >= 3, A036563(n) in binary representation is a string [1..101], also (n-2) 1's followed with 01. Thus A083329(n) is a reflection of the binary representation of A036563(n+1). Example: A083329(5) = 101111 in binary, A036563(6) = 111101 in binary. - Ctibor O. Zizka, Nov 06 2018
For n > 0, a(n) is the minimum number of turns in (n+1)-dimensional Euclidean space needed to visit all 2^(n+1) vertices of the (n+1)-cube (e.g., {0,1}^(n+1)) and return to the starting point, moving along straight-line segments between turns (turns may occur elsewhere in R^(n+1)). - Marco Ripà, Aug 14 2025

Examples

			a(0) = (3*2^0 - 2 + 0^0)/2 = 2/2 = 1 (use 0^0=1).
		

Crossrefs

Essentially the same as A055010 and A052940.
Cf. A007505 (primes).
Cf. A266550 (independence number of the n-Mycielski graph).

Programs

  • Haskell
    a083329 n = a083329_list !! n
    a083329_list = 1 : iterate ((+ 1) . (* 2)) 2
    -- Reinhard Zumkeller, Dec 26 2012, Feb 22 2012
    
  • Magma
    [1] cat [3*2^(n-1)-1: n in [1..40]]; // Vincenzo Librandi, Jan 01 2016
  • Maple
    seq(ceil((2^i+2^(i+1)-2)/2), i=0..31); # Zerinvary Lajos, Oct 02 2007
  • Mathematica
    a[1] = 2; a[n_] := 2a[n - 1] + 1; Table[ a[n], {n, 31}] (* Robert G. Wilson v, May 04 2004 *)
    Join[{1}, LinearRecurrence[{3, -2}, {2, 5}, 40]] (* Vincenzo Librandi, Jan 01 2016 *)
  • PARI
    a(n)=(3*2^n-2+0^n)/2 \\ Charles R Greathouse IV, Sep 24 2015
    

Formula

a(n) = (3*2^n - 2 + 0^n)/2.
G.f.: (1-x+x^2)/((1-x)*(1-2*x)). [corrected by Martin Griffiths, Dec 01 2009]
E.g.f.: (3*exp(2*x) - 2*exp(x) + exp(0))/2.
a(0) = 1, a(n) = sum of all previous terms + n. - Amarnath Murthy, Jun 20 2004
a(n) = 3*a(n-1) - 2*a(n-2) for n > 2, a(0)=1, a(1)=2, a(2)=5. - Philippe Deléham, Nov 29 2013
From Bob Selcoe, Apr 25 2014: (Start)
a(n) = (...((((((1)+1)*2+1)*2+1)*2+1)*2+1)...), with n+1 1's, n >= 0.
a(n) = 2*a(n-1) + 1, n >= 2.
a(n) = 2^n + 2^(n-1) - 1, n >= 2. (End)
a(n) = A086893(n) + A061547(n+1), n > 0. - Yosu Yurramendi, Jan 16 2017

A027960 'Lucas array': triangular array T read by rows.

Original entry on oeis.org

1, 1, 3, 1, 1, 3, 4, 4, 1, 1, 3, 4, 7, 8, 5, 1, 1, 3, 4, 7, 11, 15, 13, 6, 1, 1, 3, 4, 7, 11, 18, 26, 28, 19, 7, 1, 1, 3, 4, 7, 11, 18, 29, 44, 54, 47, 26, 8, 1, 1, 3, 4, 7, 11, 18, 29, 47, 73, 98, 101, 73, 34, 9, 1, 1, 3, 4, 7, 11, 18, 29, 47, 76, 120, 171, 199, 174, 107, 43, 10, 1
Offset: 0

Views

Author

Keywords

Comments

The k-th row contains 2k+1 numbers.
Columns in the right half consist of convolutions of the Lucas numbers with the natural numbers.
T(n,k) = number of strings s(0),...,s(n) such that s(n)=n-k. s(0) in {0,1,2}, s(1)=1 if s(0) in {1,2}, s(1) in {0,1,2} if s(0)=0 and for 1 <= i <= n, s(i) = s(i-1)+d, with d in {0,2} if s(i)=2i, in {0,1,2} if s(i)=2i-1, in {0,1} if 0 <= s(i) <= 2i-2.

Examples

			                           1
                       1,  3,  1
                   1,  3,  4,  4,  1
               1,  3,  4,  7,  8,  5,   1
           1,  3,  4,  7, 11, 15, 13,   6,  1
        1, 3,  4,  7, 11, 18, 26, 28,  19,  7,  1
     1, 3, 4,  7, 11, 18, 29, 44, 54,  47, 26,  8, 1
  1, 3, 4, 7, 11, 18, 29, 47, 73, 98, 101, 73, 34, 9, 1
		

Crossrefs

Central column is the Lucas numbers without initial 2: A000204.
Columns in the right half include A027961, A027962, A027963, A027964, A053298.
Bisection triangles are in A026998 and A027011.
Row sums: A036563, A153881 (alternating sign).
Diagonals of the form T(n, 2*n-p): A000012 (p=0), A000027 (p=1), A034856 (p=2), A027965 (p=3), A027966 (p=4), A027967 (p=5), A027968 (p=6), A027969 (p=7), A027970 (p=8), A027971 (p=9), A027972 (p=10).
Diagonals of the form T(n, n+p): A000032 (p=0), A027961 (p=1), A023537 (p=2), A027963 (p=3), A027964 (p=4), A053298 (p=5), A027002 U A027018 (p=6), A027007 U A027014 (p=7), A027003 U A027019 (p=8).

Programs

  • Magma
    function T(n,k) // T = A027960
          if k le n then return Lucas(k+1);
          elif k gt 2*n then return 0;
          else return T(n-1, k-2) + T(n-1, k-1);
          end if;
    end function;
    [T(n,k): k in [0..2*n], n in [0..12]]; // G. C. Greubel, Jun 08 2025
  • Maple
    T:=proc(n,k)option remember:if(k=0 or k=2*n)then return 1:elif(k=1)then return 3:else return T(n-1,k-2) + T(n-1,k-1):fi:end:
    for n from 0 to 6 do for k from 0 to 2*n do print(T(n,k));od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    (* First program *)
    t[, 0] = 1; t[, 1] = 3; t[n_, k_] /; (k == 2*n) = 1; t[n_, k_] := t[n, k] = t[n-1, k-2] + t[n-1, k-1]; Table[t[n, k], {n, 0, 8}, {k, 0, 2*n}] // Flatten (* Jean-François Alcover, Dec 27 2013 *)
    (* Second program *)
    f[n_, k_]:= f[n,k]= Sum[Binomial[2*n-k+j,j]*LucasL[2*(k-n-j)], {j,0,k-n-1}];
    A027960[n_, k_]:= LucasL[k+1] - f[n,k]*Boole[k>n];
    Table[A027960[n,k], {n,0,12}, {k,0,2*n}]//Flatten (* G. C. Greubel, Jun 08 2025 *)
  • PARI
    T(r,n)=if(r<0||n>2*r,return(0)); if(n==0||n==2*r,return(1)); if(n==1,3,T(r-1,n-1)+T(r-1,n-2)) /* Ralf Stephan, May 04 2005 */
    
  • SageMath
    @CachedFunction
    def T(n, k): # T = A027960
        if (k>2*n): return 0
        elif (kG. C. Greubel, Jun 01 2019; Jun 08 2025
    

Formula

T(n, k) = Lucas(k+1) for k <= n, otherwise the (2n-k)th coefficient of the power series for (1+2*x)/{(1-x-x^2)*(1-x)^(k-n)}.
Recurrence: T(n, 0)=T(n, 2n)=1 for n >= 0; T(n, 1)=3 for n >= 1; and for n >= 2, T(n, k) = T(n-1, k-2) + T(n-1, k-1) for 2 <= k <= 2*n-1.
From G. C. Greubel, Jun 08 2025: (Start)
T(n, k) = A000032(k+1) - f(n, k)*[k > n], where f(n, k) = Sum_{j=0..k-n-1} binomial(2*n -k+j, j)*A000032(2*(k-n-j)).
Sum_{k=0..A004396(n+1)} T(n-k, k) = A027975(n).
Sum_{k=0..n} T(n, k) = A027961(n).
Sum_{k=0..2*n} T(n, k) = A168616(n+2) + 2.
Sum_{k=n+1..2*n} (-1)^k*T(n, k) = A075193(n-1), n >= 1. (End)

Extensions

Edited by Ralf Stephan, May 04 2005

A175655 Eight bishops and one elephant on a 3 X 3 chessboard. G.f.: (1+x-5*x^2)/(1-3*x-x^2+6*x^3).

Original entry on oeis.org

1, 4, 8, 22, 50, 124, 290, 694, 1628, 3838, 8978, 21004, 48962, 114022, 265004, 615262, 1426658, 3305212, 7650722, 17697430, 40911740, 94528318, 218312114, 503994220, 1163124866, 2683496134, 6189647948, 14273690782
Offset: 0

Views

Author

Johannes W. Meijer, Aug 06 2010, Aug 10 2010

Keywords

Comments

a(n) represents the number of n-move routes of a fairy chess piece starting in the central square (m = 5) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the central square the bishop turns into a raging elephant, see A175654.
For the central square the 512 elephants lead to 46 different elephant sequences, see the cross-references for examples.
The sequence above corresponds to 16 A[5] vectors with decimal values 71, 77, 101, 197, 263, 269, 293, 323, 326, 329, 332, 353, 356, 389, 449 and 452. These vectors lead for the side squares to A000079 and for the corner squares to A175654.

Crossrefs

Cf. Elephant sequences central square [decimal value A[5]]: A000007 [0], A000012 [16], A000045 [1], A011782 [2], A000079 [3], A003945 [42], A099036 [11], A175656 [7], A105476 [69], A168604 [26], A045891 [19], A078057 [21], A151821 [170], A175657 [43], 4*A172481 [15; n>=-1], A175655 [71, this sequence], 4*A026597 [325; n>=-1], A033484 [58], A087447 [27], A175658 [23], A026150 [85], A175661 [171], A036563 [186], A098156 [59], A046717 [341], 2*A001792 [187; n>=1 with a(0)=1], A175659 [343].

Programs

  • Magma
    I:=[1, 4, 8]; [n le 3 select I[n] else 3*Self(n-1)+Self(n-2)-6*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jul 21 2013
    
  • Maple
    with(LinearAlgebra): nmax:=27; m:=5; A[5]:= [0,0,1,0,0,0,1,1,1]: A:=Matrix([[0,0,0,0,1,0,0,0,1], [0,0,0,1,0,1,0,0,0], [0,0,0,0,1,0,1,0,0], [0,1,0,0,0,0,0,1,0], A[5], [0,1,0,0,0,0,0,1,0], [0,0,1,0,1,0,0,0,0], [0,0,0,1,0,1,0,0,0], [1,0,0,0,1,0,0,0,0]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    CoefficientList[Series[(1 + x - 5 x^2) / (1 - 3 x - x^2 + 6 x^3), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 21 2013 *)
    LinearRecurrence[{3,1,-6},{1,4,8},40] (* Harvey P. Dale, Dec 25 2024 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -6,1,3]^n*[1;4;8])[1,1] \\ Charles R Greathouse IV, Oct 03 2016

Formula

G.f.: (1+x-5*x^2)/(1-3*x-x^2+6*x^3).
a(n) = 3*a(n-1) + a(n-2) - 6*a(n-3) with a(0)=1, a(1)=4 and a(2)=8.
a(n) = ((10+8*A)*A^(-n-1) + (10+8*B)*B^(-n-1))/13 - 2^n with A = (-1+sqrt(13))/6 and B = (-1-sqrt(13))/6.
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n)*2*A000244(n)/(A075118(n)-A006130(n-1)*sqrt(13)).
E.g.f.: 2*exp(x/2)*(13*cosh(sqrt(13)*x/2) + 5*sqrt(13)*sinh(sqrt(13)*x/2))/13 - cosh(2*x) - sinh(2*x). - Stefano Spezia, Jan 31 2023

A285332 a(0) = 1, a(1) = 2, a(2n) = A019565(a(n)), a(2n+1) = A065642(a(n)).

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 5, 8, 15, 12, 14, 27, 10, 25, 7, 16, 210, 45, 35, 18, 105, 28, 462, 81, 21, 20, 154, 125, 30, 49, 11, 32, 10659, 420, 910, 75, 78, 175, 33, 24, 3094, 315, 385, 56, 780045, 924, 374, 243, 110, 63, 55, 40, 4389, 308, 170170, 625, 1155, 60, 286, 343, 42, 121, 13, 64, 54230826, 31977, 28405, 630, 1330665, 1820, 714
Offset: 0

Views

Author

Antti Karttunen, Apr 17 2017

Keywords

Comments

Note the indexing: the domain starts from 0, while the range excludes zero.
This sequence can be represented as a binary tree. Each left hand child is produced as A019565(n), and each right hand child as A065642(n), when the parent node contains n >= 2:
1
|
...................2...................
3 4
6......../ \........9 5......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
15 12 14 27 10 25 7 16
210 45 35 18 105 28 462 81 21 20 154 125 30 49 11 32
etc.
Where will 38 appear in this tree? It is a reasonable assumption that by iterating A087207 starting from 38, as A087207(38) = 129, A087207(129) = 8194, A087207(8194) = 1501199875790187, ..., we will eventually hit a prime A000040(k), most likely with a largish index k. This prime occurs at the penultimate edge at right, as a(A000918(k)) = a((2^k)-2), and thus 38 occurs somewhere below it as a(m) = 38, m > k. All the numbers that share prime factors with 38, namely 76, 152, 304, 608, 722, ..., occur similarly late in this tree, as they form the rightward branch starting from 38. Alternatively, by iterating A285330 (each iteration moves one step towards the root) starting from 38, we might instead first hit some power of 3, or say, one of the terms of A033845 (the rightward branch starting from 6), in which case the first prime encountered would be a(2)=3 and 38 would appear on the left-hand side instead of the right-hand side subtree.
As long as it remains conjecture that A019565 has no cycles, it is certainly also an open question whether this is a permutation of the natural numbers: If A019565 has any cycles, then neither any of the terms in those cycles nor any A065642-trajectories starting from those terms (that is, numbers sharing same prime factors) may occur in this tree.
Sequence exhibits some outrageous swings, for example, a(703) = 224, but a(704) is 1427 decimal digits (4739 binary digits) long, thus it no longer fits into a b-file.
However, the scatter plot of A286543 gives some flavor of the behavior of this sequence even after that point. - Antti Karttunen, Dec 25 2017

Crossrefs

Inverse: A285331.
Compare also to permutation A285112 and array A285321.

Programs

  • Mathematica
    Block[{a = {1, 2}}, Do[AppendTo[a, If[EvenQ[i], Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[a[[i/2 + 1]], 2], If[# == 1, 1, Function[{n, c}, SelectFirst[Range[n + 1, n^2], Times @@ FactorInteger[#][[All, 1]] == c &]] @@ {#, Times @@ FactorInteger[#][[All, 1]]}] &[a[[(i - 1)/2 + 1]] ] ]], {i, 2, 70}]; a] (* Michael De Vlieger, Mar 12 2021 *)
  • PARI
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014
    A065642(n) = { my(r=A007947(n)); if(1==n,n,n = n+r; while(A007947(n) <> r, n = n+r); n); };
    A285332(n) = { if(n<=1,n+1,if(!(n%2),A019565(A285332(n/2)),A065642(A285332((n-1)/2)))); };
    for(n=0, 4095, write("b285332.txt", n, " ", A285332(n)));
    
  • Python
    from operator import mul
    from sympy import prime, primefactors
    def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
    def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # This function from Chai Wah Wu
    def a065642(n):
        if n==1: return 1
        r=a007947(n)
        n = n + r
        while a007947(n)!=r:
            n+=r
        return n
    def a(n):
        if n<2: return n + 1
        if n%2==0: return a019565(a(n//2))
        else: return a065642(a((n - 1)//2))
    print([a(n) for n in range(51)]) # Indranil Ghosh, Apr 18 2017
  • Scheme
    ;; With memoization-macro definec.
    (definec (A285332 n) (cond ((<= n 1) (+ n 1)) ((even? n) (A019565 (A285332 (/ n 2)))) (else (A065642 (A285332 (/ (- n 1) 2))))))
    

Formula

a(0) = 1, a(1) = 2, a(2n) = A019565(a(n)), a(2n+1) = A065642(a(n)).
For n >= 0, a(2^n) = A109162(2+n). [The left edge of the tree.]
For n >= 0, a(A000225(n)) = A000079(n). [Powers of 2 occur at the right edge of the tree.]
For n >= 2, a(A000918(n)) = A000040(n). [And the next vertices inwards contain primes.]
For n >= 2, a(A036563(1+n)) = A001248(n). [Whose right children are their squares.]
For n >= 0, a(A055010(n)) = A000244(n). [Powers of 3 are at the rightmost edge of the left subtree.]
For n >= 2, a(A129868(n-1)) = A062457(n).
A048675(a(n)) = A285333(n).
A046523(a(n)) = A286542(n).

A159741 a(n) = 8*(2^n - 1).

Original entry on oeis.org

8, 24, 56, 120, 248, 504, 1016, 2040, 4088, 8184, 16376, 32760, 65528, 131064, 262136, 524280, 1048568, 2097144, 4194296, 8388600, 16777208, 33554424, 67108856, 134217720, 268435448, 536870904, 1073741816, 2147483640, 4294967288, 8589934584, 17179869176, 34359738360
Offset: 1

Views

Author

Al Hakanson (hawkuu(AT)gmail.com), Apr 20 2009

Keywords

Comments

Fifth diagonal of the array which contains m-acci numbers in the m-th row.
The base array is constructed from m-acci numbers starting each with 1, 1, and 2 and filling one row of the table (see the examples).
The main and the upper diagonals of the table are the powers of 2, A000079.
The first subdiagonal is essentially A000225, followed by essentially A036563.
The next subdiagonal is this sequence here, followed by A159742, A159743, A159744, A159746, A159747, A159748.
a(n) written in base 2: 1000, 11000, 111000, 1111000, ..., i.e., n times 1 and 3 times 0 (A161770). - Jaroslav Krizek, Jun 18 2009
Also numbers for which n^8/(n+8) is an integer. - Vicente Izquierdo Gomez, Jan 03 2013

Examples

			From _R. J. Mathar_, Apr 22 2009: (Start)
The base table is
.1..1....1....1....1....1....1....1....1....1....1....1....1....1
.1..1....1....1....1....1....1....1....1....1....1....1....1....1
.2..2....2....2....2....2....2....2....2....2....2....2....2....2
.0..2....3....4....4....4....4....4....4....4....4....4....4....4
.0..2....5....7....8....8....8....8....8....8....8....8....8....8
.0..2....8...13...15...16...16...16...16...16...16...16...16...16
.0..2...13...24...29...31...32...32...32...32...32...32...32...32
.0..2...21...44...56...61...63...64...64...64...64...64...64...64
.0..2...34...81..108..120..125..127..128..128..128..128..128..128
.0..2...55..149..208..236..248..253..255..256..256..256..256..256
.0..2...89..274..401..464..492..504..509..511..512..512..512..512
.0..2..144..504..773..912..976.1004.1016.1021.1023.1024.1024.1024
.0..2..233..927.1490.1793.1936.2000.2028.2040.2045.2047.2048.2048
.0..2..377.1705.2872.3525.3840.3984.4048.4076.4088.4093.4095.4096
Columns: A000045, A000073, A000078, A001591, A001592 etc. (End)
		

Crossrefs

Programs

Formula

From R. J. Mathar, Apr 22 2009: (Start)
a(n) = 3*a(n-1) - 2*a(n-2).
a(n) = 8*(2^n-1).
G.f.: 8*x/((2*x-1)*(x-1)). (End)
From Jaroslav Krizek, Jun 18 2009: (Start)
a(n) = Sum_{i=3..(n+2)} 2^i.
a(n) = Sum_{i=1..n} 2^(i+2).
a(n) = a(n-1) + 2^(n+2) for n >= 2. (End)
a(n) = A173787(n+3,3) = A175166(2*n)/A175161(n). - Reinhard Zumkeller, Feb 28 2010
From Elmo R. Oliveira, Jun 15 2025: (Start)
E.g.f.: 8*exp(x)*(exp(x) - 1).
a(n) = 8*A000225(n) = 4*A000918(n+1) = 2*A028399(n+2). (End)

Extensions

More terms from R. J. Mathar, Apr 22 2009
Edited by Al Hakanson (hawkuu(AT)gmail.com), May 11 2009
Comments claiming negative entries deleted by R. J. Mathar, Aug 24 2009

A030130 Binary expansion contains a single 0.

Original entry on oeis.org

0, 2, 5, 6, 11, 13, 14, 23, 27, 29, 30, 47, 55, 59, 61, 62, 95, 111, 119, 123, 125, 126, 191, 223, 239, 247, 251, 253, 254, 383, 447, 479, 495, 503, 507, 509, 510, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1535, 1791, 1919, 1983, 2015, 2031, 2039
Offset: 1

Views

Author

Toby Donaldson (tjdonald(AT)uwaterloo.ca)

Keywords

Comments

From Reinhard Zumkeller, Aug 29 2009: (Start)
A023416(a(n)) = 1;
apart from the initial term the sequence can be seen as a triangle read by rows, see A164874;
A055010 and A086224 are subsequences, see also A000918 and A036563. (End)
Zero and numbers of form 2^m-2^k-1, 2 <= m, 0 <= k <= m-2. - Zak Seidov, Aug 06 2010

Examples

			23 is OK because it is '10111' in base 2.
		

Crossrefs

Programs

  • C
    long int element (long int i) { return (pow(2,g(i))-1-pow(2,(pow(2*g(i)-1,2)-1-8*i)/8));} long int g(long int m) {if (m==0) return(1); return ((sqrt(8*m-7)+3)/2);}
    
  • Haskell
    a030130 n = a030130_list !! (n-1)
    a030130_list = filter ((== 1) . a023416) [0..]
    -- Reinhard Zumkeller, Mar 31 2015, Dec 07 2012
    
  • Magma
    [0] cat [k:k in [0..2050]| Multiplicity(Intseq(k,2),0) eq 1]; // Marius A. Burtea, Feb 06 2020
    
  • Mathematica
    Sort[Flatten[{{0}, Table[2^n - 2^m - 1, {n, 2, 50}, {m, 0, n - 2}]}]] (* Zak Seidov, Aug 06 2010 *)
    Select[Range[0,2100],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Dec 19 2021 *)
  • PARI
    print1("0, ");for(k=1,2039,my(v=digits(k,2));if(vecsum(v)==#v-1,print1(k,", "))) \\ Hugo Pfoertner, Feb 06 2020
    
  • Python
    from math import isqrt, comb
    def A030130(n): return (1<<(a:=(isqrt(n-1<<3)+1>>1)+1))-(1<Chai Wah Wu, Dec 19 2024

Formula

a(n) = 2^(g(n))-1-2^(((2*g(n)-1)^2-1-8*n)/8) with g(n)=int((sqrt(8*n-7)+3)/2) for all n>0 and g(0)=1. - Ulrich Schimke (ulrschimke(AT)aol.com)
a(n+1) = A140977(a(n)) for any n > 1. - Rémy Sigrist, Feb 06 2020
Sum_{n>=2} 1/a(n) = A160502. - Amiram Eldar, Oct 06 2020
a(n) = (A190620(n-1)-1)/2. - Chai Wah Wu, Dec 19 2024

Extensions

More terms from Erich Friedman
Offset fixed by Reinhard Zumkeller, Aug 24 2009

A265901 Square array read by descending antidiagonals: A(n,1) = A188163(n), and for k > 1, A(n,k) = A087686(1+A(n,k-1)).

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 8, 15, 12, 6, 16, 31, 27, 14, 9, 32, 63, 58, 30, 21, 10, 64, 127, 121, 62, 48, 24, 11, 128, 255, 248, 126, 106, 54, 26, 13, 256, 511, 503, 254, 227, 116, 57, 29, 17, 512, 1023, 1014, 510, 475, 242, 120, 61, 38, 18, 1024, 2047, 2037, 1022, 978, 496, 247, 125, 86, 42, 19, 2048, 4095, 4084, 2046, 1992, 1006, 502, 253, 192, 96, 45, 20
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2015

Keywords

Comments

Square array read by descending antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
The topmost row (row 1) of the array is A000079 (powers of 2), and in general each row 2^k contains the sequence (2^n - k), starting from the term (2^(k+1) - k). This follows from the properties (3) and (4) of A004001 given on page 227 of Kubo & Vakil paper (page 3 in PDF).
Moreover, each row 2^k - 1 (for k >= 2) contains the sequence 2^n - n - (k-2), starting from the term (2^(k+1) - (2k-1)). To see why this holds, consider the definitions of sequences A162598 and A265332, the latter which also illustrates how the frequency counts Q_n for A004001 are recursively constructed (in the Kubo & Vakil paper).

Examples

			The top left corner of the array:
   1,  2,   4,   8,  16,   32,   64,  128,  256,   512,  1024, ...
   3,  7,  15,  31,  63,  127,  255,  511, 1023,  2047,  4095, ...
   5, 12,  27,  58, 121,  248,  503, 1014, 2037,  4084,  8179, ...
   6, 14,  30,  62, 126,  254,  510, 1022, 2046,  4094,  8190, ...
   9, 21,  48, 106, 227,  475,  978, 1992, 4029,  8113, 16292, ...
  10, 24,  54, 116, 242,  496, 1006, 2028, 4074,  8168, 16358, ...
  11, 26,  57, 120, 247,  502, 1013, 2036, 4083,  8178, 16369, ...
  13, 29,  61, 125, 253,  509, 1021, 2045, 4093,  8189, 16381, ...
  17, 38,  86, 192, 419,  894, 1872, 3864, 7893, 16006, 32298, ...
  18, 42,  96, 212, 454,  950, 1956, 3984, 8058, 16226, 32584, ...
  19, 45, 102, 222, 469,  971, 1984, 4020, 8103, 16281, 32650, ...
  20, 47, 105, 226, 474,  977, 1991, 4028, 8112, 16291, 32661, ...
  22, 51, 112, 237, 490,  999, 2020, 4065, 8158, 16347, 32728, ...
  23, 53, 115, 241, 495, 1005, 2027, 4073, 8167, 16357, 32739, ...
  25, 56, 119, 246, 501, 1012, 2035, 4082, 8177, 16368, 32751, ...
  28, 60, 124, 252, 508, 1020, 2044, 4092, 8188, 16380, 32764, ...
  ...
		

Crossrefs

Inverse permutation: A267102.
Transpose: A265903.
Cf. A265900 (main diagonal).
Cf. A162598 (row index of n in array), A265332 (column index of n in array).
Column 1: A188163.
Column 2: A266109.
Row 1: A000079 (2^n).
Row 2: A000225 (2^n - 1, from 3 onward).
Row 3: A000325 (2^n - n, from 5 onward).
Row 4: A000918 (2^n - 2, from 6 onward).
Row 5: A084634 (?, from 9 onward).
Row 6: A132732 (2^n - 2n + 2, from 10 onward).
Row 7: A000295 (2^n - n - 1, from 11 onward).
Row 8: A036563 (2^n - 3).
Row 9: A084635 (?, from 17 onward).
Row 12: A048492 (?, from 20 onward).
Row 13: A249453 (?, from 22 onward).
Row 14: A183155 (2^n - 2n + 1, from 23 onward. Cf. also A244331).
Row 15: A000247 (2^n - n - 2, from 25 onward).
Row 16: A028399 (2^n - 4).
Cf. also permutations A267111, A267112.

Programs

Formula

For the first column k=1, A(n,1) = A188163(n), for columns k > 1, A(n,k) = A087686(1+A(n,k-1)).

A118654 Square array T(n,k) read by antidiagonals: T(n,k) = 2^n*Fibonacci(k) - Fibonacci(k-2).

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 3, 2, 1, 1, 7, 4, 3, 2, 1, 15, 8, 7, 5, 3, 1, 31, 16, 15, 11, 8, 5, 1, 63, 32, 31, 23, 18, 13, 8, 1, 127, 64, 63, 47, 38, 29, 21, 13, 1, 255, 128, 127, 95, 78, 61, 47, 34, 21, 1, 511, 256, 255, 191, 158, 125, 99, 76, 55, 34
Offset: 0

Views

Author

Ross La Haye, May 17 2006

Keywords

Comments

Inverse binomial transform (by columns) of A090888.

Examples

			T(2,3) = 7 because 2^2(Fibonacci(3)) - Fibonacci(3-2) = 4*2 - 1 = 7.
{1};
{1,  0};
{1,  1,  1};
{1,  3,  2,  1};
{1,  7,  4,  3,  2};
{1, 15,  8,  7,  5,  3};
{1, 31, 16, 15, 11,  8,  5};
{1, 63, 32, 31, 23, 18, 13,  8};
		

Crossrefs

Rows: T(0,k) = A000045(k-1), for k > 0; T(1,k) = A000045(k+1); T(2,k) = A000032(k+1); T(3,k) = A022097(k); T(4,k) = A022105(k); T(5,k) = A022401(k).
Columns: T(n,1) = A000225(n); T(n,2) = A000079(n); T(n,3) = A000225(n+1); T(n,4) = A055010(n+1); T(n,5) = A051633(n); a(T,6) = A036563(n+3).

Formula

T(n,k) = 2^n*Fibonacci(k) - Fibonacci(k-2).
T(n,k) = (2^n-2)*Fibonacci(k) + Fibonacci(k+1).
T(n,0) = 1; T(n,1) = 2^n - 1; T(n,k) = T(n,k-1) + T(n,k-2), for k > 1.
T(0,k) = Fibonacci(k-1); T(1,k) = Fibonacci(k+1); T(n,k) = 3T(n-1,k) - 2T(n-2,k), for n > 1.
T(n,k) = 2T(n-1,k) + Fibonacci(k-2), for n > 0.
T(n,k) = A109754(2^n-2, k+1) = A101220(2^n-2, 0, k+1), for n > 0.
O.g.f. (by rows) = (1+(-2+2^n)x)/(1-x-x^2).
Sum_{k=0..n} T(n-k,k) = A119587(n+1). - Ross La Haye, May 31 2006
Showing 1-10 of 72 results. Next