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.

Previous Showing 11-20 of 21 results. Next

A006014 a(n+1) = (n+1)*a(n) + Sum_{k=1..n-1} a(k)*a(n-k).

Original entry on oeis.org

1, 2, 7, 32, 178, 1160, 8653, 72704, 679798, 7005632, 78939430, 965988224, 12762344596, 181108102016, 2748049240573, 44405958742016, 761423731533286, 13809530704348160, 264141249701936818, 5314419112717217792, 112201740111374359516, 2480395343617443024896
Offset: 1

Views

Author

Keywords

Examples

			G.f. = x + 2*x^2 + 7*x^3 + 32*x^4 + 178*x^5 + 1160*x^6 + 8653*x^7 + 72704*x^8 + ...
		

References

  • D. E. Knuth, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Similar recurrences: A124758, A243499, A284005, A329369, A341392.

Programs

  • Mathematica
    Nest[Append[#1, #1[[-1]] (#2 + 1) + Total@ Table[#1[[k]] #1[[#2 - k]], {k, #2 - 1}]] & @@ {#, Length@ #} &, {1}, 17] (* Michael De Vlieger, Aug 22 2018 *)
    (* or *)
    a[1] = 1; a[n_] := a[n] = n a[n-1] + Sum[a[k] a[n-1-k], {k, n-2}]; Array[a, 18] (* Giovanni Resta, Aug 23 2018 *)
  • PARI
    {a(n) = local(A); if( n<1, 0, A = vector(n); A[1] = 1; for( k=2, n, A[k] = k * A[k-1] + sum( j=1, k-2, A[j] * A[k-1-j])); A[n])} /* Michael Somos, Jul 24 2011 */
    
  • Python
    from sage.all import *
    @CachedFunction
    def a(n): # a = A006014
        if n<5: return (pow(5,n-1) + 3)//4
        else: return n*a(n-1) + 2*sum(a(k)*a(n-k-1) for k in range(1,(n//2))) + (n%2)*pow(a((n-1)//2),2)
    print([a(n) for n in range(1,61)]) # G. C. Greubel, Jan 10 2025

Formula

G.f. A(x) satisfies A(x) = x * (1 + A(x) + A(x)^2 + x * A'(x)). - Michael Somos, Jul 24 2011
Conjecture: a(n) = Sum_{k=0..2^(n-1) - 1} b(k) for n > 0 where b(2n+1) = b(n), b(2n) = b(n) + b(n - 2^f(n)) + b(2n - 2^f(n)) + b(A025480(n-1)) for n > 0 with b(0) = b(1) = 1 and where f(n) = A007814(n). - Mikhail Kurkov, Nov 19 2021
a(n) ~ cosh(sqrt(3)*Pi/2) * n! / Pi = A073017 * n!. - Vaclav Kotesovec, Nov 21 2024

A284002 a(n) = A072411(A283477(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 6, 1, 2, 2, 6, 2, 6, 6, 12, 1, 2, 2, 6, 2, 6, 6, 12, 2, 6, 6, 12, 6, 12, 12, 60, 1, 2, 2, 6, 2, 6, 6, 12, 2, 6, 6, 12, 6, 12, 12, 60, 2, 6, 6, 12, 6, 12, 12, 60, 6, 12, 12, 60, 12, 60, 60, 60, 1, 2, 2, 6, 2, 6, 6, 12, 2, 6, 6, 12, 6, 12, 12, 60, 2, 6, 6, 12, 6, 12, 12, 60, 6, 12, 12, 60, 12, 60, 60, 60, 2, 6, 6, 12, 6, 12, 12, 60, 6, 12, 12
Offset: 0

Views

Author

Antti Karttunen, Mar 18 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[LCM @@ FactorInteger[#][[All, -1]] &[Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e == 1 :> {Times @@ Prime@ Range@ PrimePi@p, e}] &[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2]]], {n, 0, 90}] (* Michael De Vlieger, Mar 18 2017 *)
  • Scheme
    (define (A284002 n) (A072411 (A283477 n)))

Formula

a(n) = A072411(A283477(n)).

A290615 Number of maximal independent vertex sets (and minimal vertex covers) in the n-triangular honeycomb bishop graph.

Original entry on oeis.org

1, 2, 5, 14, 45, 164, 661, 2906, 13829, 70736, 386397, 2242118, 13759933, 88975628, 604202693, 4296191090, 31904681877, 246886692680, 1986631886029, 16592212576862, 143589971363981, 1285605080403332, 11891649654471285, 113491862722958474, 1116236691139398565
Offset: 1

Views

Author

Eric W. Weisstein, Aug 07 2017

Keywords

Comments

From Andrew Howroyd, Aug 09 2017: (Start)
See A146304 for algorithm and PARI code to produce this sequence.
The total number of independent vertex sets is given by Bell(n+1) where Bell=A000110.
A bishop can move along two axes in the triangular honeycomb grid.
Equivalently, the number of arrangements of non-attacking rooks on an n X n right triangular board with every square controlled by at least one rook. (End)

Crossrefs

Row sums of A290724.
Cf. A000110 (independent vertex sets), A007814, A146304.
Similar recurrences: A124758, A243499, A284005, A329369, A341392.

Programs

  • Mathematica
    Table[Sum[k! StirlingS2[m, k] StirlingS2[n + 1 - m, k + 1], {m, 0, n}, {k, 0, Min[m, n - m]}], {n, 20}] (* Eric W. Weisstein, Feb 01 2024 *)
  • PARI
    { A290615(n) = sum(m=0, n, sum(k=0, min(m,n-m), k! * stirling(m,k,2) * stirling(n+1-m,k+1,2) )); } \\ Max Alekseyev, Oct 14 2021

Formula

Conjecture: a(n) = Sum_{k=0..2^(n-1) - 1} b(k) for n > 0 where b(2n+1) = b(n - 2^f(n)), b(2n) = b(n) + b(2n - 2^f(n)) for n > 0 with b(0) = b(1) = 1 and where f(n) = A007814(n). Also b((4^n - 1)/3) = (floor((n+1)/2)!)^3. - Mikhail Kurkov, Sep 18 2021
a(n) = Sum_{m=0..n} Sum_{k=0..min(m,n-m)} k! * S(m,k) * S(n+1-m,k+1), where S(,) are Stirling numbers of second kind. - Max Alekseyev, Oct 14 2021

Extensions

Terms a(10) and beyond from Andrew Howroyd, Aug 09 2017

A092920 Number of strongly monotone partitions of [n].

Original entry on oeis.org

1, 1, 2, 4, 9, 22, 58, 164, 496, 1601, 5502, 20075, 77531, 315947, 1354279, 6087421, 28611385, 140239297, 715116827, 3785445032, 20760746393, 117759236340, 689745339984, 4165874930885, 25911148634728, 165775085602106, 1089773992530717, 7353740136527305
Offset: 0

Views

Author

Ralf Stephan, Apr 17 2004

Keywords

Comments

A partition is strongly monotone if its blocks can be written in increasing order of their least element and increasing order of their greatest element, simultaneously.
a(n) is the number of strongly nonoverlapping partitions of [n] where "strongly nonoverlapping" means nonoverlapping (see A006789 for definition) and, in addition, no singleton block is a subset of the span (interval from minimum to maximum) of another block. For example, 13-24 is nonnesting and 14-23 is strongly nonoverlapping but neither has the other property. The Motzkin number M_n (A001006) counts strongly noncrossing partitions of [n]. - David Callan, Sep 20 2007
Strongly monotone partitions can also be described as partitions in which no block is contained in the span of another, where span denotes the interval from smallest to largest entries. For example, 134/25/6 is strongly monotone but 135/24/6 is not because the block 24 is contained in the interval [1,5]. - David Callan, Aug 27 2014

Crossrefs

Similar recurrences: A284005, A329369, A341392.

Programs

  • Maple
    G:=1/(1-x-x^2/(1-x-x^2/(1-2*x-x^2/(1-3*x-x^2/(1-4*x-x^2/(1-5*x-x^2/(1-6*x-x^2/(1-7*x-x^2/(1-8*x-x^2/(1-9*x-x^2/(1-10*x-x^2/(1-11*x-x^2/(1-12*x-x^2/(1-13*x-x^2/(1-14*x-x^2/(1-15*x-x^2/(1-16*x-x^2/(1-17*x-x^2)))))))))))))))))): Gser:=series(G,x=0,32): seq(coeff(Gser, x, n), n=0..28);  # Emeric Deutsch, Apr 13 2005
  • Mathematica
    terms = 26;
    f[1] = 1; f[k_ /; k>1] = -x^2;
    g[1] = 1-x; g[k_ /; k>1] := 1-(k-1)x;
    A[x_] = ContinuedFractionK[f[k], g[k], {k, 1, Ceiling[terms/2]}];
    CoefficientList[A[x] + O[x]^terms, x] (* Jean-François Alcover, Aug 07 2018 *)

Formula

G.f.: Sum_{n>=0} a(n)*x^n = 1/(1-x-x^2/(1-x-x^2/(1-2*x-x^2/(1-3*x-x^2/...)))) = 1/(1-x-x^2*B(x)) where B(x) is g.f. for the Bessel numbers A006789.
a(n) = leftmost column terms of M^n*V, where M = an infinite tridiagonal matrix with all 1's in the super and subdiagonals and (1,1,2,3,4,5,...) as the main diagonal; and the rest zeros. V = vector [1,0,0,0,...]. - Gary W. Adamson, Jun 16 2011
G.f.: 1/Q(0) where Q(k) = 1-x*(k+2)+x/(1+x/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 17 2013
Conjecture: a(n) = Sum_{k=0..2^(n-1) - 1} b(k) for n > 0 with a(0) = 1 where b(2^m*(2n+1)) = Sum_{k=0..[m > 0]*(m-1)} binomial(m-1, k)*b(2^k*n) for m >= 0, n >= 0 with b(0) = 1. - Mikhail Kurkov, Apr 24 2023

Extensions

More terms from Emeric Deutsch, Apr 13 2005

A329718 The number of open tours by a biased rook on a specific f(n) X 1 board, where f(n) = A070941(n) and cells are colored white or black according to the binary representation of 2n.

Original entry on oeis.org

1, 2, 4, 4, 8, 6, 14, 8, 16, 10, 24, 10, 46, 24, 46, 16, 32, 18, 44, 14, 84, 34, 68, 18, 146, 68, 138, 44, 230, 84, 146, 32, 64, 34, 84, 22, 160, 54, 112, 22, 276, 106, 224, 54, 376, 106, 192, 34, 454, 192, 406, 112, 690, 224, 406, 84, 1066, 376, 690, 160
Offset: 0

Views

Author

Mikhail Kurkov, Nov 19 2019 [verification needed]

Keywords

Comments

A cell is colored white if the binary digit is 0 and a cell is colored black if the binary digit is 1. A biased rook on a white cell moves only to the left and otherwise moves only to the right.

Examples

			a(1) = 2 because the binary expansion of 2 is 10 and there are 2 open biased rook's tours, namely 12 and 21.
a(2) = 4 because the binary expansion of 4 is 100 and there are 4 open biased rook's tours, namely 132, 213, 231 and 321.
a(3) = 4 because the binary expansion of 6 is 110 and there are 4 open biased rook's tours, namely 123, 132, 231 and 312.
		

Crossrefs

Formula

a(n) = f(n) + f(A059894(n)) = f(n) + f(2*A053645(n)) for n > 0 with a(0) = 1 where f(n) = A329369(n).
Sum_{k=0..2^n-1} a(k) = 2*(n+1)! - 1 for n >= 0.
a((4^n-1)/3) = 2*A110501(n+1) for n > 0.
a(2^1*(2^n-1)) = A027649(n),
a(2^2*(2^n-1)) = A027650(n),
a(2^3*(2^n-1)) = A027651(n),
a(2^4*(2^n-1)) = A283811(n),
and more generally, a(2^m*(2^n-1)) = T(n,m+1) for n >= 0, m >= 0 where T(n,m) = Sum_{k=0..n} k!*(k+1)^m*Stirling2(n,k)*(-1)^(n-k).

A347204 a(n) = a(f(n)/2) + a(floor((n+f(n))/2)) for n > 0 with a(0) = 1 where f(n) = A129760(n).

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 10, 15, 5, 9, 13, 20, 17, 27, 37, 52, 6, 11, 16, 25, 21, 34, 47, 67, 26, 43, 60, 87, 77, 114, 151, 203, 7, 13, 19, 30, 25, 41, 57, 82, 31, 52, 73, 107, 94, 141, 188, 255, 37, 63, 89, 132, 115, 175, 235, 322, 141, 218, 295, 409, 372, 523, 674
Offset: 0

Views

Author

Mikhail Kurkov, Aug 23 2021 [verification needed]

Keywords

Comments

Modulo 2 binomial transform of A243499(n).

Crossrefs

Programs

  • MATLAB
    function a = A347204(max_n)
        a(1) = 1;
        a(2) = 2;
        for nloop = 3:max_n
            n = nloop-1;
            s = 0;
            for k = 0:floor(log2(n))-1
                s = s + a(1+A053645(n)-2^k*(mod(floor(n/(2^k)),2)));
            end
            a(nloop) = 2*a(A053645(n)+1) + s;
        end
    end
    function a_n = A053645(n)
        a_n = n - 2^floor(log2(n));
    end % Thomas Scheuerle, Oct 25 2021
  • Mathematica
    f[n_] := BitAnd[n, n - 1]; a[0] = 1; a[n_] := a[n] = a[f[n]/2] + a[Floor[(n + f[n])/2]]; Array[a, 100, 0] (* Amiram Eldar, Nov 19 2021 *)
  • PARI
    f(n) = bitand(n, n-1); \\ A129760
    a(n) = if (n<=1, n+1, if (n%2, a(n\2)+a(n-1), a(f(n/2)) + a(n/2+f(n/2)))); \\ Michel Marcus, Oct 25 2021
    
  • PARI
    \\ Also see links.
    
  • PARI
    A129760(n) = bitand(n, n-1);
    memoA347204 = Map();
    A347204(n) = if (n<=1, n+1, my(v); if(mapisdefined(memoA347204,n,&v), v, v = if(n%2, A347204(n\2)+A347204(n-1), A347204(A129760(n/2)) + A347204(n/2+A129760(n/2))); mapput(memoA347204,n,v); (v))); \\ (Memoized version of Michel Marcus's program given above) - Antti Karttunen, Nov 20 2021
    

Formula

a(n) = a(n - 2^f(n)) + (1 + f(n))*a((n - 2^f(n))/2) for n > 0 with a(0) = 1 where f(n) = A007814(n).
a(2n+1) = a(n) + a(2n) for n >= 0.
a(2n) = a(n - 2^f(n)) + a(2n - 2^f(n)) for n > 0 with a(0) = 1 where f(n) = A007814(n).
a(n) = 2*a(f(n)) + Sum_{k=0..floor(log_2(n))-1} a(f(n) - 2^k*T(n,k)) for n > 1 with a(0) = 1, a(1) = 2, and where f(n) = A053645(n), T(n,k) = floor(n/2^k) mod 2.
Sum_{k=0..2^n - 1} a(k) = A035009(n+1) for n >= 0.
a((4^n - 1)/3) = A002720(n) for n >= 0.
a(2^n - 1) = A000110(n+1),
a(2*(2^n - 1)) = A005493(n),
a(2^2*(2^n - 1)) = A005494(n),
a(2^3*(2^n - 1)) = A045379(n),
a(2^4*(2^n - 1)) = A196834(n),
a(2^m*(2^n-1)) = T(n,m+1) is the n-th (m+1)-Bell number for n >= 0, m >= 0 where T(n,m) = m*T(n-1,m) + Sum_{k=0..n-1} binomial(n-1,k)*T(k,m) with T(0,m) = 1.
a(n) = Sum_{j=0..2^A000120(n)-1} A243499(A295989(n,j)) for n >= 0. Also A243499(n) = Sum_{j=0..2^f(n)-1} (-1)^(f(n)-f(j)) a(A295989(n,j)) for n >= 0 where f(n) = A000120(n). In other words, a(n) = Sum_{j=0..n} (binomial(n,j) mod 2)*A243499(j) and A243499(n) = Sum_{j=0..n} (-1)^(f(n)-f(j))*(binomial(n,j) mod 2)*a(j) for n >= 0 where f(n) = A000120(n).
Generalization:
b(n, x) = (1/x)*b((n - 2^f(n))/2, x) + (-1)^n*b(floor((2n - 2^f(n))/2), x) for n > 0 with b(0, x) = 1 where f(n) = A007814(n).
Sum_{k=0..2^n - 1} b(k, x) = (1/x)^n for n >= 0.
b((4^n - 1)/3, x) = (1/x)^n*n!*L_{n}(x) for n >= 0 where L_{n}(x) is the n-th Laguerre polynomial.
b((8^n - 1)/7, x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A265649(n, k) for n >= 0.
b(2^n - 1, x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A008277(n+1, k+1),
b(2*(2^n - 1), x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A143494(n+2, k+2),
b(2^2*(2^n - 1), x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A143495(n+3, k+3),
b(2^m*(2^n - 1), x) = (1/x)^n*Sum_{k=0..n} (-x)^k*T(n+m+1, k+m+1, m+1) for n >= 0, m >= 0 where T(n,k,m) is m-Stirling numbers of the second kind.

A325803 Nonzero terms of Product_{k=0..floor(log_2(n))} (1 + A004718(floor(n/(2^k)))).

Original entry on oeis.org

1, 2, 6, -6, 24, -18, -48, 120, 18, -72, -192, 48, -360, 720, 54, 144, -360, 384, -960, 144, -1800, 720, -2880, 5040, -54, 216, 576, -144, 1080, -2160, 1536, -384, 2880, -5760, -144, 576, 5400, -10800, 2880, -720, -17280, 8640, -25200, 40320, -162, -432, 1080
Offset: 1

Views

Author

Mikhail Kurkov, May 22 2019

Keywords

Comments

See A329893.

Crossrefs

Programs

  • Mathematica
    a[n_?EvenQ] := a[n] = -a[n/2]; a[0] = 0; a[n_] := a[n] = a[(n - 1)/2] + 1; DeleteCases[Table[Product[ 1 + a[Floor[n/(2^k)]], {k, 0, Floor[Log2[n]]}], {n, 0, 200}], 0] (* Michael De Vlieger, Apr 22 2024, after Jean-François Alcover at A004718 *)
  • PARI
    b(n) = if(n==0, 0, (-1)^(n+1)*b(n\2) + n%2); \\ A004718
    f(n) = if(n==0, 1, prod(k=0, logint(n,2), 1+b(n\2^k)));
    lista(nn) = for (n=0, nn, if (f(n), print1(f(n), ", "))); \\ Michel Marcus, May 26 2019
    
  • Python
    from itertools import count, islice
    from math import prod
    def A325803_gen(): # generator of terms
        for n in count(0):
            c, s = [0]*(m:=n.bit_length()), bin(n)[2:]
            for i in range(m):
                if s[i]=='1':
                    for j in range(m-i):
                        c[j] = c[j]+1
                else:
                    for j in range(m-i):
                        c[j] = -c[j]
            if (k:=prod(1+d for d in c)): yield k
    A325803_list = list(islice(A325803_gen(),20)) # Chai Wah Wu, Mar 03 2023

Formula

a(n) = A329893(A325804(n)). - Antti Karttunen, Dec 10 2019

Extensions

Comments and two formulas moved to A329893, which is an "uncompressed" version of this sequence. - Antti Karttunen, Dec 11 2019

A344902 Number of open tours by a biased rook on a specific f(n) X 1 board, where f(n) = A070941(n) and cells are colored white or black according to the binary representation of 2n.

Original entry on oeis.org

1, 2, 4, 6, 8, 18, 18, 24, 16, 54, 54, 96, 54, 96, 96, 120, 32, 162, 162, 384, 162, 384, 384, 600, 162, 384, 384, 600, 384, 600, 600, 720, 64, 486, 486, 1536, 486, 1536, 1536, 3000, 486, 1536, 1536, 3000, 1536, 3000, 3000, 4320, 486, 1536, 1536, 3000, 1536
Offset: 0

Views

Author

Mikhail Kurkov, Jun 01 2021 [verification needed]

Keywords

Comments

A cell is colored white if the binary digit is 0 and a cell is colored black if the binary digit is 1. A biased rook on a white cell moves to the left to any cell or to the right only to a black cell. A biased rook on a black cell moves in any direction.

Crossrefs

Programs

  • Mathematica
    a[n_] := With[{s = DigitCount[n, 2]}, s[[1]]! * (1 + s[[1]])^(1 + s[[2]])]; a[0] = 1; Array[a, 50, 0] (* Amiram Eldar, Aug 03 2023 *)

Formula

a(n) = A000120(n)!*(1 + A000120(n))^(A023416(n) + 1) for n > 0 with a(0)=1.
a(2n) = (1 + A000120(n))*a(n) for n > 0 with a(0)=1.
From Mikhail Kurkov, Oct 16 2021: (Start)
Conjecture: a(n) = A284005(A073138(n)) for n >= 0 (noticed by Sequence Machine).
Proof: note that A073138(n) in binary is A000120(n) of ones followed by A023416(n) zeros. Then use the formula from "Comments on A284005". (End) [verification needed]

A329893 a(n) = Product_{k=0..floor(log_2(n))} (1 + A004718(floor(n/(2^k)))), where A004718 is Per Nørgård's "infinity sequence".

Original entry on oeis.org

1, 2, 0, 6, 0, 0, -6, 24, 0, 0, 0, 0, -18, 0, -48, 120, 0, 0, 0, 0, 0, 0, 0, 0, 18, -72, 0, 0, -192, 48, -360, 720, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 144, -360, 0, 0, 0, 0, 384, -960, 144, 0, -1800, 720, -2880, 5040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, 216
Offset: 0

Views

Author

Antti Karttunen (after Mikhail Kurkov's A325803), Dec 10 2019 [verification needed]

Keywords

Comments

The composer Per Nørgård's name is also written in the OEIS as Per Noergaard.
From Mikhail Kurkov, May 22 2019 (comments originally given in A325803): (Start)
Number of positive terms on the interval 2^m <= n < 2^(m+1) for m > 0 equals f(m-1,2,1) (and f(m-1,4,3) for negative) with f(m,g,h) = binomial(m, floor(m/2) + floor((m+g)/4) - floor((m+h)/4)), so total number of nonzero terms equals binomial(m, floor(m/2)) = A001405(m).
Sum_{n=0..2^m-1} a(n) = 3^m, m >= 0.
More generally, if we define a(n,k) = (-1)^(n+1)*a(floor(n/k),k) + n mod k, a(0,k) = 0, so Sum_{n=0..k^m-1} Product_{i=0..floor(log_k(n))} (1 + a(floor(n/(k^i)),k)) = binomial(k+1, 2)^m for any k = 2p, p > 0.
(End) [verification needed]

Crossrefs

Cf. A001405, A004718, A325803 (nonzero terms), A325804 (their positions).
Cf. also A284005, A293233.

Programs

  • Mathematica
    f[n_?EvenQ] := f[n] = -f[n/2]; f[0] = 0; f[n_] := f[n] = f[(n - 1)/2] + 1; Table[Product[1 + f[Floor[n/(2^k)]], {k, 0, Floor[Log2[n]]}], {n, 0, 120}]  (* Michael De Vlieger, Apr 22 2024, after Jean-François Alcover at A004718 *)
  • PARI
    up_to = 65537;
    A004718list(up_to) = { my(v=vector(up_to)); v[1]=1; v[2]=-1; for(n=3, up_to, v[n] = if(n%2, 1+v[n>>1], -v[n/2])); (v); }; \\ After code in A004718.
    v004718 = A004718list(up_to);
    A004718(n) = if(!n,n,v004718[n]);
    A329893(n) = { my(m=1); while(n, m *= 1+A004718(n); n >>= 1); (m); };
    
  • Python
    from math import prod
    def A329893(n):
        c, s = [0]*(m:=n.bit_length()), bin(n)[2:]
        for i in range(m):
            if s[i]=='1':
                for j in range(m-i):
                    c[j] = c[j]+1
            else:
                for j in range(m-i):
                    c[j] = -c[j]
        return prod(1+d for d in c) # Chai Wah Wu, Mar 03 2023

Formula

a(0) = 1; for n > 1, a(n) = (1+A004718(n)) * a(floor(n/2)).
a(n) = Product_{k=0..floor(log_2(n))} (1 + A004718(floor(n/(2^k)))).
a(A325804(n)) = A325803(n).

A344947 Number of open tours by a biased rook on a specific A070941(n) X 1 board, which ends on a black cell, where cells are colored white or black according to the binary representation of 2n.

Original entry on oeis.org

1, 1, 1, 4, 1, 4, 8, 18, 1, 4, 8, 18, 16, 36, 54, 96, 1, 4, 8, 18, 16, 36, 54, 96, 32, 72, 108, 192, 162, 288, 384, 600, 1, 4, 8, 18, 16, 36, 54, 96, 32, 72, 108, 192, 162, 288, 384, 600, 64, 144, 216, 384, 324, 576, 768, 1200, 486, 864, 1152, 1800, 1536, 2400
Offset: 0

Views

Author

Mikhail Kurkov, Jun 03 2021 [verification needed]

Keywords

Comments

A cell is colored white if the binary digit is 0 and a cell is colored black if the binary digit is 1. A biased rook on a white cell moves only to the left and otherwise moves in any direction.

Crossrefs

Formula

a(n) = A284005(2*A053645(n)) for n > 0 with a(0) = 1.
Previous Showing 11-20 of 21 results. Next