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-8 of 8 results.

A326485 T(n, k) = 2^A050605(n) * n! * [x^k] [z^n] (4*exp(x*z))/(exp(z) + 1)^2, triangle read by rows, for 0 <= k <= n.

Original entry on oeis.org

1, -1, 1, 1, -4, 2, 1, 3, -6, 2, -1, 2, 3, -4, 1, -1, -5, 5, 5, -5, 1, 17, -24, -60, 40, 30, -24, 4, 17, 119, -84, -140, 70, 42, -28, 4, -31, 34, 119, -56, -70, 28, 14, -8, 1, -31, -279, 153, 357, -126, -126, 42, 18, -9, 1, 691, -620, -2790, 1020, 1785, -504, -420, 120, 45, -20, 2
Offset: 0

Views

Author

Peter Luschny, Jul 12 2019

Keywords

Comments

These are the coefficients of the generalized Euler polynomials (case m=2) with a different normalization. See A326480 for further comments.

Examples

			Triangle starts:
[0] [  1]
[1] [ -1,    1]
[2] [  1,   -4,   2]
[3] [  1,    3,  -6,    2]
[4] [ -1,    2,   3,   -4,    1]
[5] [ -1,   -5,   5,    5,   -5,    1]
[6] [ 17,  -24, -60,   40,   30,  -24,   4]
[7] [ 17,  119, -84, -140,   70,   42, -28,  4]
[8] [-31,   34, 119,  -56,  -70,   28,  14, -8,  1]
[9] [-31, -279, 153,  357, -126, -126,  42, 18, -9, 1]
		

Crossrefs

Programs

  • Maple
    E2n := proc(n) (4*exp(x*z))/(exp(z) + 1)^2;
    series(%, z, 48); 2^A050605(n)*n!*coeff(%, z, n) end:
    for n from 0 to 9 do PolynomialTools:-CoefficientList(E2n(n), x) od;

A007814 Exponent of highest power of 2 dividing n, a.k.a. the binary carry sequence, the ruler sequence, or the 2-adic valuation of n.

Original entry on oeis.org

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

Views

Author

John Tromp, Dec 11 1996

Keywords

Comments

This sequence is an exception to my usual rule that when every other term of a sequence is 0 then those 0's should be omitted. In this case we would get A001511. - N. J. A. Sloane
To construct the sequence: start with 0,1, concatenate to get 0,1,0,1. Add + 1 to last term gives 0,1,0,2. Concatenate those 4 terms to get 0,1,0,2,0,1,0,2. Add + 1 to last term etc. - Benoit Cloitre, Mar 06 2003
The sequence is invariant under the following two transformations: increment every element by one (1, 2, 1, 3, 1, 2, 1, 4, ...), put a zero in front and between adjacent elements (0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, ...). The intermediate result is A001511. - Ralf Hinze (ralf(AT)informatik.uni-bonn.de), Aug 26 2003
Fixed point of the morphism 0->01, 1->02, 2->03, 3->04, ..., n->0(n+1), ..., starting from a(1) = 0. - Philippe Deléham, Mar 15 2004
Fixed point of the morphism 0->010, 1->2, 2->3, ..., n->(n+1), .... - Joerg Arndt, Apr 29 2014
a(n) is also the number of times to repeat a step on an even number in the hailstone sequence referenced in the Collatz conjecture. - Alex T. Flood (whiteangelsgrace(AT)gmail.com), Sep 22 2006
Let F(n) be the n-th Fermat number (A000215). Then F(a(r-1)) divides F(n)+2^k for r = k mod 2^n and r != 1. - T. D. Noe, Jul 12 2007
The following relation holds: 2^A007814(n)*(2*A025480(n-1)+1) = A001477(n) = n. (See functions hd, tl and cons in [Paul Tarau 2009].)
a(n) is the number of 0's at the end of n when n is written in base 2.
a(n+1) is the number of 1's at the end of n when n is written in base 2. - M. F. Hasler, Aug 25 2012
Shows which bit to flip when creating the binary reflected Gray code (bits are numbered from the right, offset is 0). That is, A003188(n) XOR A003188(n+1) == 2^A007814(n). - Russ Cox, Dec 04 2010
The sequence is squarefree (in the sense of not containing any subsequence of the form XX) [Allouche and Shallit]. Of course it contains individual terms that are squares (such as 4). - Comment expanded by N. J. A. Sloane, Jan 28 2019
a(n) is the number of zero coefficients in the n-th Stern polynomial, A125184. - T. D. Noe, Mar 01 2011
Lemma: For n < m with r = a(n) = a(m) there exists n < k < m with a(k) > r. Proof: We have n=b2^r and m=c2^r with b < c both odd; choose an even i between them; now a(i2^r) > r and n < i2^r < m. QED. Corollary: Every finite run of consecutive integers has a unique maximum 2-adic valuation. - Jason Kimberley, Sep 09 2011
a(n-2) is the 2-adic valuation of A000166(n) for n >= 2. - Joerg Arndt, Sep 06 2014
a(n) = number of 1's in the partition having Heinz number n. We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product_{j=1..r} p_j-th prime (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436. Example: a(24)=3; indeed, the partition having Heinz number 24 = 2*2*2*3 is [1,1,1,2]. - Emeric Deutsch, Jun 04 2015
a(n+1) is the difference between the two largest parts in the integer partition having viabin number n (0 is assumed to be a part). Example: a(20) = 2. Indeed, we have 19 = 10011_2, leading to the Ferrers board of the partition [3,1,1]. For the definition of viabin number see the comment in A290253. - Emeric Deutsch, Aug 24 2017
Apart from being squarefree, as noted above, the sequence has the property that every consecutive subsequence contains at least one number an odd number of times. - Jon Richfield, Dec 20 2018
a(n+1) is the 2-adic valuation of Sum_{e=0..n} u^e = (1 + u + u^2 + ... + u^n), for any u of the form 4k+1 (A016813). - Antti Karttunen, Aug 15 2020
{a(n)} represents the "first black hat" strategy for the game of countably infinitely many hats, with a probability of success of 1/3; cf. the Numberphile link below. - Frederic Ruget, Jun 14 2021
a(n) is the least nonnegative integer k for which there does not exist i+j=n and a(i)=a(j)=k (cf. A322523). - Rémy Sigrist and Jianing Song, Aug 23 2022

Examples

			2^3 divides 24, so a(24)=3.
From _Omar E. Pol_, Jun 12 2009: (Start)
Triangle begins:
  0;
  1,0;
  2,0,1,0;
  3,0,1,0,2,0,1,0;
  4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0;
  5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0;
  6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,...
(End)
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 27.
  • K. Atanassov, On the 37th and the 38th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 2, 83-85.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Cf. A011371 (partial sums), A094267 (first differences), A001511 (bisection), A346070 (mod 4).
Bisection of A050605 and |A088705|. Pairwise sums are A050603 and A136480. Difference of A285406 and A281264.
This is Guy Steele's sequence GS(1, 4) (see A135416). Cf. A053398(1,n). Column/row 1 of table A050602.
Cf. A007949 (3-adic), A235127 (4-adic), A112765 (5-adic), A122841 (6-adic), A214411 (7-adic), A244413 (8-adic), A122840 (10-adic).
Cf. A086463 (Dgf at s=2).

Programs

  • Haskell
    a007814 n = if m == 0 then 1 + a007814 n' else 0
                where (n', m) = divMod n 2
    -- Reinhard Zumkeller, Jul 05 2013, May 14 2011, Apr 08 2011
    
  • Haskell
    a007814 n | odd n = 0 | otherwise = 1 + a007814 (n `div` 2)
    --  Walt Rorie-Baety, Mar 22 2013
    
  • Magma
    [Valuation(n, 2): n in [1..120]]; // Bruno Berselli, Aug 05 2013
    
  • Maple
    ord := proc(n) local i,j; if n=0 then return 0; fi; i:=0; j:=n; while j mod 2 <> 1 do i:=i+1; j:=j/2; od: i; end proc: seq(ord(n), n=1..111);
    A007814 := n -> padic[ordp](n,2): seq(A007814(n), n=1..111); # Peter Luschny, Nov 26 2010
  • Mathematica
    Table[IntegerExponent[n, 2], {n, 64}] (* Eric W. Weisstein *)
    IntegerExponent[Range[64], 2] (* Eric W. Weisstein, Feb 01 2024 *)
    p=2; Array[ If[ Mod[ #, p ]==0, Select[ FactorInteger[ # ], Function[ q, q[ [ 1 ] ]==p ], 1 ][ [ 1, 2 ] ], 0 ]&, 96 ]
    DigitCount[BitXor[x, x - 1], 2, 1] - 1; a different version based on the same concept: Floor[Log[2, BitXor[x, x - 1]]] (* Jaume Simon Gispert (jaume(AT)nuem.com), Aug 29 2004 *)
    Nest[Join[ #, ReplacePart[ #, Length[ # ] -> Last[ # ] + 1]] &, {0, 1}, 5] (* N. J. Gunther, May 23 2009 *)
    Nest[ Flatten[# /. a_Integer -> {0, a + 1}] &, {0}, 7] (* Robert G. Wilson v, Jan 17 2011 *)
  • PARI
    A007814(n)=valuation(n,2);
    
  • Python
    import math
    def a(n): return int(math.log(n - (n & n - 1), 2)) # Indranil Ghosh, Apr 18 2017
    
  • Python
    def A007814(n): return (~n & n-1).bit_length() # Chai Wah Wu, Jul 01 2022
    
  • R
    sapply(1:100,function(x) sum(gmp::factorize(x)==2)) # Christian N. K. Anderson, Jun 20 2013
    
  • Scheme
    (define (A007814 n) (let loop ((n n) (e 0)) (if (odd? n) e (loop (/ n 2) (+ 1 e))))) ;; Antti Karttunen, Oct 06 2017

Formula

a(n) = A001511(n) - 1.
a(2*n) = A050603(2*n) = A001511(n).
a(n) = A091090(n-1) + A036987(n-1) - 1.
a(n) = 0 if n is odd, otherwise 1 + a(n/2). - Reinhard Zumkeller, Aug 11 2001
Sum_{k=1..n} a(k) = n - A000120(n). - Benoit Cloitre, Oct 19 2002
G.f.: A(x) = Sum_{k>=1} x^(2^k)/(1-x^(2^k)). - Ralf Stephan, Apr 10 2002
G.f. A(x) satisfies A(x) = A(x^2) + x^2/(1-x^2). A(x) = B(x^2) = B(x) - x/(1-x), where B(x) is the g.f. for A001151. - Franklin T. Adams-Watters, Feb 09 2006
Totally additive with a(p) = 1 if p = 2, 0 otherwise.
Dirichlet g.f.: zeta(s)/(2^s-1). - Ralf Stephan, Jun 17 2007
Define 0 <= k <= 2^n - 1; binary: k = b(0) + 2*b(1) + 4*b(2) + ... + 2^(n-1)*b(n-1); where b(x) are 0 or 1 for 0 <= x <= n - 1; define c(x) = 1 - b(x) for 0 <= x <= n - 1; Then: a(k) = c(0) + c(0)*c(1) + c(0)*c(1)*c(2) + ... + c(0)*c(1)...c(n-1); a(k+1) = b(0) + b(0)*b(1) + b(0)*b(1)*b(2) + ... + b(0)*b(1)...b(n-1). - Arie Werksma (werksma(AT)tiscali.nl), May 10 2008
a(n) = floor(A002487(n - 1) / A002487(n)). - Reikku Kulon, Oct 05 2008
Sum_{k=1..n} (-1)^A000120(n-k)*a(k) = (-1)^(A000120(n)-1)*(A000120(n) - A000035(n)). - Vladimir Shevelev, Mar 17 2009
a(A001147(n) + A057077(n-1)) = a(2*n). - Vladimir Shevelev, Mar 21 2009
For n>=1, a(A004760(n+1)) = a(n). - Vladimir Shevelev, Apr 15 2009
2^(a(n)) = A006519(n). - Philippe Deléham, Apr 22 2009
a(n) = A063787(n) - A000120(n). - Gary W. Adamson, Jun 04 2009
a(C(n,k)) = A000120(k) + A000120(n-k) - A000120(n). - Vladimir Shevelev, Jul 19 2009
a(n!) = n - A000120(n). - Vladimir Shevelev, Jul 20 2009
v_{2}(n) = Sum_{r>=1} (r / 2^(r+1)) Sum_{k=0..2^(r+1)-1} e^(2(k*Pi*i(n+2^r))/(2^(r+1))). - A. Neves, Sep 28 2010, corrected Oct 04 2010
a(n) mod 2 = A096268(n-1). - Robert G. Wilson v, Jan 18 2012
a(A005408(n)) = 1; a(A016825(n)) = 3; A017113(a(n)) = 5; A051062(a(n)) = 7; a(n) = (A037227(n)-1)/2. - Reinhard Zumkeller, Jun 30 2012
a((2*n-1)*2^p) = p, p >= 0 and n >= 1. - Johannes W. Meijer, Feb 04 2013
a(n) = A067255(n,1). - Reinhard Zumkeller, Jun 11 2013
a(n) = log_2(n - (n AND n-1)). - Gary Detlefs, Jun 13 2014
a(n) = 1 + A000120(n-1) - A000120(n), where A000120 is the Hamming weight function. - Stanislav Sykora, Jul 14 2014
A053398(n,k) = a(A003986(n-1,k-1)+1); a(n) = A053398(n,1) = A053398(n,n) = A053398(2*n-1,n) = Min_{k=1..n} A053398(n,k). - Reinhard Zumkeller, Aug 04 2014
a((2*x-1)*2^n) = a((2*y-1)*2^n) for positive n, x and y. - Juri-Stepan Gerasimov, Aug 04 2016
a(n) = A285406(n) - A281264(n). - Ralf Steiner, Apr 18 2017
a(n) = A000005(n)/(A000005(2*n) - A000005(n)) - 1. - conjectured by Velin Yanev, Jun 30 2017, proved by Nicholas Stearns, Sep 11 2017
Equivalently to above formula, a(n) = A183063(n) / A001227(n), i.e., a(n) is the number of even divisors of n divided by number of odd divisors of n. - Franklin T. Adams-Watters, Oct 31 2018
a(n)*(n mod 4) = 2*floor(((n+1) mod 4)/3). - Gary Detlefs, Feb 16 2019
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1. - Amiram Eldar, Jul 11 2020
a(n) = 2*Sum_{j=1..floor(log_2(n))} frac(binomial(n, 2^j)*2^(j-1)/n). - Dario T. de Castro, Jul 08 2022
a(n) = A070939(n) - A070939(A030101(n)). - Andrew T. Porter, Dec 16 2022
a(n) = floor((gcd(n, 2^n)^(n+1) mod (2^(n+1)-1)^2)/(2^(n+1)-1)) (see Lemma 3.4 from Mazzanti's 2002 article). - Lorenzo Sauras Altuzarra, Mar 10 2024
a(n) = 1 - A088705(n). - Chai Wah Wu, Sep 18 2024

Extensions

Formula index adapted to the offset of A025480 by R. J. Mathar, Jul 20 2010
Edited by Ralf Stephan, Feb 08 2014

A069834 a(n) = n-th reduced triangular number: n*(n+1)/{2^k} where 2^k is the largest power of 2 that divides product n*(n+1).

Original entry on oeis.org

1, 3, 3, 5, 15, 21, 7, 9, 45, 55, 33, 39, 91, 105, 15, 17, 153, 171, 95, 105, 231, 253, 69, 75, 325, 351, 189, 203, 435, 465, 31, 33, 561, 595, 315, 333, 703, 741, 195, 205, 861, 903, 473, 495, 1035, 1081, 141, 147, 1225, 1275, 663, 689, 1431, 1485, 385, 399
Offset: 1

Views

Author

Amarnath Murthy, Apr 14 2002

Keywords

Comments

The largest odd divisor of n-th triangular number.

Crossrefs

Programs

  • Mathematica
    Table[tri = n*(n + 1)/2; tri/2^IntegerExponent[tri, 2], {n, 100}] (* T. D. Noe, Oct 28 2013 *)
  • PARI
    for(n=1,100,t=n*n+n;while(t%2==0,t=t/2);print1(t","))
    
  • PARI
    a(n)=local(t);t=n*(n+1)\2;t/2^valuation(t,2) \\ Franklin T. Adams-Watters, Nov 20 2009
    
  • Python
    def A069834(n):
        a, b = divmod(n*n+n, 2)
        while b == 0:
            a, b = divmod(a,2)
        return 2*a+b # Chai Wah Wu, Dec 05 2021

Formula

GCD(a(n),a(n+1)) = A000265(n+1). - Ralf Stephan, Apr 05 2003
a(n) = A000265(n) * A000265(n+1). - Franklin T. Adams-Watters, Nov 20 2009
From Amiram Eldar, Sep 15 2022: (Start)
a(n) = A000265(A000217(n)).
Sum_{n>=1} 1/a(n) = Sum_{i,j>=1} 2^(i+1)/(4^i*(2*j-1)^2 - 1) = 2.84288562849221553965... . (End)

Extensions

More terms from Ralf Stephan, Apr 05 2003

A050602 Square array A(x,y), read by antidiagonals, where A(x,y) = 0 if (x AND y) = 0, otherwise A(x,y) = 1+A(x XOR y, 2*(x AND y)).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 3, 1, 3, 2, 3, 0, 0, 0, 2, 2, 1, 1, 2, 2, 0, 0, 0, 1, 0, 2, 1, 1, 1, 2, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 2, 1, 2, 0, 2, 1, 2, 0, 2, 1, 2, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Jun 22 1999

Keywords

Comments

Array is symmetric and is read by antidiagonals: (0,0), (0,1), (1,0), (0,2), (1,1), (2,0), etc. - Antti Karttunen, Sep 04 2023
Comment from N. J. A. Sloane, Jun 21 2011: Apparently the same as the following sequence. Infinite square array read by antidiagonals, where T(m,n) = length of longest carry propagation when u and v are added in binary, for u >= 0, v >= 0.
See A192054 for definition of carry propagation. For example, T(3,5) = 3, since adding 011 + 101 in binary, the initial 1 propagates three places.

Examples

			The top left corner of the square array:
     |  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-----+--------------------------------------------------------
   0 |  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,
   1 |  0, 1, 0, 2, 0, 1, 0, 3, 0, 1,  0,  2,  0,  1,  0,  4,
   2 |  0, 0, 1, 1, 0, 0, 2, 2, 0, 0,  1,  1,  0,  0,  3,  3,
   3 |  0, 2, 1, 1, 0, 3, 2, 2, 0, 2,  1,  1,  0,  4,  3,  3,
   4 |  0, 0, 0, 0, 1, 1, 1, 1, 0, 0,  0,  0,  2,  2,  2,  2,
   5 |  0, 1, 0, 3, 1, 1, 1, 2, 0, 1,  0,  4,  2,  2,  2,  2,
   6 |  0, 0, 2, 2, 1, 1, 1, 1, 0, 0,  3,  3,  2,  2,  2,  2,
   7 |  0, 3, 2, 2, 1, 2, 1, 1, 0, 4,  3,  3,  2,  2,  2,  2,
   8 |  0, 0, 0, 0, 0, 0, 0, 0, 1, 1,  1,  1,  1,  1,  1,  1,
   9 |  0, 1, 0, 2, 0, 1, 0, 4, 1, 1,  1,  2,  1,  1,  1,  3,
  10 |  0, 0, 1, 1, 0, 0, 3, 3, 1, 1,  1,  1,  1,  1,  2,  2,
  11 |  0, 2, 1, 1, 0, 4, 3, 3, 1, 2,  1,  1,  1,  3,  2,  2,
  12 |  0, 0, 0, 0, 2, 2, 2, 2, 1, 1,  1,  1,  1,  1,  1,  1,
  13 |  0, 1, 0, 4, 2, 2, 2, 2, 1, 1,  1,  3,  1,  1,  1,  2,
  14 |  0, 0, 3, 3, 2, 2, 2, 2, 1, 1,  2,  2,  1,  1,  1,  1,
  15 |  0, 4, 3, 3, 2, 2, 2, 2, 1, 3,  2,  2,  1,  2,  1,  1,
etc.
		

Crossrefs

Row/Column 1: A007814, Row/Column 2: A050605, Row/Column 3: A050606. See also A372554 [A(n, 2n+1)].
Cf. also A192054.
Cf. also A072030 (A285721) for similar arrays computed for an elementary Euclidean algorithm.

Programs

  • Maple
    add3c := proc(a,b) option remember; if(0 = ANDnos(a,b)) then RETURN(0); else RETURN(1+add3c(XORnos(a,b),2*ANDnos(a,b))); fi; end;
  • Mathematica
    a[n_, k_] := a[n, k] = If[0 == BitAnd[n, k], 0, 1 + a[BitXor[n, k], 2*BitAnd[n, k]]]; Table[a[n - k, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 16 2014, updated Mar 06 2016 after Maple *)
  • PARI
    up_to = 120;
    A050602sq(x,y) = if(!bitand(x,y), 0, 1+A050602sq(bitxor(x,y),2*bitand(x,y)));
    A050602list(up_to) = { my(v = vector(up_to), i=0); for(a=0, oo, for(col=0, a, i++; if(i > up_to, return(v)); v[i] = A050602sq(col, a-col))); (v); };
    v050602 = A050602list(up_to);
    A050602(n) = v050602[1+n]; \\ Antti Karttunen, Sep 04 2023

Formula

If A004198(x,y) = 0, then A(x,y) = 0, otherwise A(x,y) = 1 + A(A003987(x,y), 2*A004198(x,y)), where A004198 and A003987 are bitwise-AND and bitwise-XOR respectively.

Extensions

Name edited by Antti Karttunen, Sep 04 2023

A161737 Numerators of the column sums of the BG2 matrix.

Original entry on oeis.org

1, 2, 16, 128, 2048, 32768, 262144, 2097152, 67108864, 2147483648, 17179869184, 137438953472, 2199023255552, 35184372088832, 281474976710656, 2251799813685248, 144115188075855872, 9223372036854775808, 73786976294838206464, 590295810358705651712, 9444732965739290427392
Offset: 1

Views

Author

Johannes W. Meijer, Jun 18 2009

Keywords

Comments

For the definition of the BG2 matrix coefficients see A161736.

Examples

			sb(1) = 1; sb(2) = 2; sb(3) = 16/9; sb(4) = 128/75; sb(5) = 2048/1225; etc..
		

Crossrefs

Programs

  • Magma
    [Numerator((2^(4*n-5)*(Factorial(n-1))^4)/((n-1)*(Factorial(2*n-2))^2)): n in [2..20]]; // G. C. Greubel, Sep 26 2018
  • Maple
    nmax := 18; x(1):=0: x(2):=1: for n from 2 to nmax-1 do x(n+1) := A050605(n-2) + x(n) + 3 od: for n from 1 to nmax do a(n) := 2^x(n) od: seq(a(n), n=1..nmax); # End program 1
    nmax1 := 20; for n from 0 to nmax1 do y(2*n+1) := A090739(n); y(2*n) := A090739(n) od: z(1) := 0: z(2) := 1: for n from 3 to nmax1 do z(n) := z(n-1) + y(n-1) od: for n from 1 to nmax1 do a(n) := 2^z(n) od: seq(a(n), n=1..nmax1); # End program 2
    # Above Maple programs edited by Johannes W. Meijer, Sep 25 2012 and by Peter Luschny, Feb 13 2025
    r := n -> Pi*(2*n - 2)*((n - 3/2)!/(n - 1)!)^2: a := n -> denom(simplify(r(n))):
    seq(a(n), n = 1..20);  # Peter Luschny, Feb 12 2025
  • Mathematica
    sb[1] = 1; sb[2] = 2; sb[n_] := sb[n] = sb[n-1]*4*(n-1)*(n-2)/(2n-3)^2;
    Table[sb[n] // Numerator, {n, 2, 20}] (* Jean-François Alcover, Aug 14 2017 *)
  • PARI
    vector(20, n, n++; numerator((2^(4*n-5)*(n-1)!^4)/((n-1)*(2*n-2)!^2))) \\ G. C. Greubel, Sep 26 2018
    

Formula

a(n) = numer(sb(n)) with sb(n) = (2^(4*n-5)*(n-1)!^4)/((n-1)*(2*n-2)!^2) and A161736(n) = denom(sb(n)).
a(n) = denominator(Pi*(2*n - 2)*((n - 3/2)!/(n - 1)!)^2). - Peter Luschny, Feb 12 2025

Extensions

Offset set to 1 and a(1) = 1 prepended by Peter Luschny, Feb 13 2025

A212591 a(n) is the smallest value of k for which A020986(k) = n.

Original entry on oeis.org

0, 1, 2, 5, 8, 9, 10, 21, 32, 33, 34, 37, 40, 41, 42, 85, 128, 129, 130, 133, 136, 137, 138, 149, 160, 161, 162, 165, 168, 169, 170, 341, 512, 513, 514, 517, 520, 521, 522, 533, 544, 545, 546, 549, 552, 553, 554, 597, 640, 641, 642, 645, 648, 649, 650, 661
Offset: 1

Views

Author

Michael Day, May 22 2012

Keywords

Comments

Brillhart and Morton derive an omega function for the largest values of k. This sequence appears to be given by a similar alpha function.

Crossrefs

Programs

  • J
    NB. J function on a vector
    NB. Beware round-off errors on large arguments
    NB. ok up to ~ 1e8
    alphav =: 3 : 0
    n   =. <: y
    if.+/ ntlo=. n > 0 do.
    n   =. ntlo#n
    m   =. >.-: n
    r   =. <.2^.m
    f   =. <.3%~2+2^2*>:i.>./>:r
    z   =. 0
    mi  =. m
    for_i. i.#f do.
      z   =. z + (i{f) * <.0.5 + mi =. mi%2
    end.
    nzer=. (+/ @: (0=>./\)@:|.)"1 @: #: m
    ntlo #^:_1 z - (2|n) * <.-:nzer{f
    else.
    ntlo
    end.
    )
    NB. eg    alphav 1 3 5 100 2 8 33
  • PARI
    alpha(n)={
    if(n<2, return(max(0,n-1)));
    local(nm1=n-1,
          mi=m=ceil(nm1/2),
          r=floor(log(m)/log(2)),
    i,fi,alpha=0,a);
    forstep(i=1, 2*r+1, 2,
        mi/=2;
        fi=(1+2^i)\3;
    alpha+=fi*floor(0.5+mi);
           );
    alpha*=2;
    if(nm1%2,   \\ adjust for even n
       a=factor(2*m)[1,2]-1;
    alpha-= (1+2^(1+2*a))\3;
      );
    return(alpha);
    }
    

Formula

a(2*n-1) - a(2*n-2) = (2^(2*k+1)+1)/3 and a(2*n) - a(2*n-1) = (2^(2*k+1)+1)/3 with a(0) = a(1) = 0, where n = (2^k)*(2*m-1) for some integers k >= 0 and m > 0.
Restating the formula above, a(n+1) - a(n) = A007583(A050605(n-1)) = A276391 with terms repeated. - John Keith, Mar 04 2021

Extensions

Minor edits by N. J. A. Sloane, Jun 06 2012

A344346 Numbers k which have an odd number of trailing zeros in their binary reflected Gray code A014550(k).

Original entry on oeis.org

3, 4, 11, 12, 15, 16, 19, 20, 27, 28, 35, 36, 43, 44, 47, 48, 51, 52, 59, 60, 63, 64, 67, 68, 75, 76, 79, 80, 83, 84, 91, 92, 99, 100, 107, 108, 111, 112, 115, 116, 123, 124, 131, 132, 139, 140, 143, 144, 147, 148, 155, 156, 163, 164, 171, 172, 175, 176, 179, 180
Offset: 1

Views

Author

Amiram Eldar, May 15 2021

Keywords

Comments

Numbers k such that A050605(k-1) is odd.
Numbers k such that A136480(k) is even.
The asymptotic density of this sequence is 1/3.

Examples

			3 is a term since its Gray code, 10, has 1 trailing zero, and 1 is odd.
15 is a term since its Gray code, 1000, has 3 trailing zeros, and 3 is odd.
		

Crossrefs

Similar sequences: A001950 (Zeckendorf), A036554 (binary), A145204 (ternary), A217319 (quaternary), A232745 (factorial), A342050 (primorial).

Programs

  • Mathematica
    Select[Range[180], OddQ @ IntegerExponent[# * (# + 1)/2, 2] &]
  • Python
    def A344346(n):
        def f(x):
            c, s = (n+1>>1)+x, bin(x)[2:]
            l = len(s)
            for i in range(l&1^1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return (m<<2)-(n&1) # Chai Wah Wu, Jan 29 2025

Formula

a(n) = A081706(n) + 1. - Hugo Pfoertner, May 16 2021

A378992 a(n) = A011371(n) - A048881(n); The exponent of the highest power of 2 dividing the n-th factorial minus the exponent of the highest power of 2 dividing n-th Catalan number.

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 2, 4, 6, 6, 6, 7, 8, 8, 8, 11, 14, 14, 14, 15, 16, 16, 16, 18, 20, 20, 20, 21, 22, 22, 22, 26, 30, 30, 30, 31, 32, 32, 32, 34, 36, 36, 36, 37, 38, 38, 38, 41, 44, 44, 44, 45, 46, 46, 46, 48, 50, 50, 50, 51, 52, 52, 52, 57, 62, 62, 62, 63, 64, 64, 64, 66, 68, 68, 68, 69, 70, 70, 70, 73, 76, 76, 76
Offset: 0

Views

Author

Antti Karttunen, Dec 16 2024

Keywords

Comments

Apparently, after the initial three 0's, only terms of A092054 occur, every other as a single copy, and every other in a batch of 3 duplicated terms.

Crossrefs

Programs

  • Mathematica
    A378992[n_] := n - DigitCount[n, 2, 1] - DigitCount[n + 1, 2, 1] + 1;
    Array[A378992, 100, 0] (* or *)
    MapIndexed[#2[[1]] - # &, Total[Partition[DigitCount[Range[0, 100], 2, 1], 2, 1], {2}]] (* Paolo Xausa, Dec 28 2024 *)
  • PARI
    A378992(n) = (1+(n-hammingweight(n)-hammingweight(1+n)));

Formula

a(n) = A007814(A000142(n)) - A007814(A000108(n)) = A011371(n) - A048881(n).
a(0) = 0; for n > 0, a(n) = A050605(n-1) + a(n-1), where A050605(n) = A007814(n+1)+A007814(n+2)-1.
Showing 1-8 of 8 results.