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 10 results.

A001316 Gould's sequence: a(n) = Sum_{k=0..n} (binomial(n,k) mod 2); number of odd entries in row n of Pascal's triangle (A007318); a(n) = 2^A000120(n).

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 4, 8, 4, 8, 8, 16, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32, 8, 16, 16, 32, 16, 32, 32, 64, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32
Offset: 0

Views

Author

Keywords

Comments

Also called Dress's sequence.
This sequence might be better called Glaisher's sequence, since James Glaisher showed that odd binomial coefficients are counted by 2^A000120(n) in 1899. - Eric Rowland, Mar 17 2017 [However, the name "Gould's sequence" is deeply entrenched in the literature. - N. J. A. Sloane, Mar 17 2017] [Named after the American mathematician Henry Wadsworth Gould (b. 1928). - Amiram Eldar, Jun 19 2021]
All terms are powers of 2. The first occurrence of 2^k is at n = 2^k - 1; e.g., the first occurrence of 16 is at n = 15. - Robert G. Wilson v, Dec 06 2000
a(n) is the highest power of 2 dividing binomial(2n,n) = A000984(n). - Benoit Cloitre, Jan 23 2002
Also number of 1's in n-th row of triangle in A070886. - Hans Havermann, May 26 2002. Equivalently, number of live cells in generation n of a one-dimensional cellular automaton, Rule 90, starting with a single live cell. - Ben Branman, Feb 28 2009. Ditto for Rule 18. - N. J. A. Sloane, Aug 09 2014. This is also the odd-rule cellular automaton defined by OddRule 003 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link). - N. J. A. Sloane, Feb 25 2015
Also number of numbers k, 0<=k<=n, such that (k OR n) = n (bitwise logical OR): a(n) = #{k : T(n,k)=n, 0<=k<=n}, where T is defined as in A080098. - Reinhard Zumkeller, Jan 28 2003
To construct the sequence, start with 1 and use the rule: If k >= 0 and a(0),a(1),...,a(2^k-1) are the first 2^k terms, then the next 2^k terms are 2*a(0),2*a(1),...,2*a(2^k-1). - Benoit Cloitre, Jan 30 2003
Also, numerator((2^k)/k!). - Mohammed Bouayoun (mohammed.bouayoun(AT)sanef.com), Mar 03 2004
The odd entries in Pascal's triangle form the Sierpiński Gasket (a fractal). - Amarnath Murthy, Nov 20 2004
Row sums of Sierpiński's Gasket A047999. - Johannes W. Meijer, Jun 05 2011
Fixed point of the morphism "1" -> "1,2", "2" -> "2,4", "4" -> "4,8", ..., "2^k" -> "2^k,2^(k+1)", ... starting with a(0) = 1; 1 -> 12 -> 1224 -> = 12242448 -> 122424482448488(16) -> ... . - Philippe Deléham, Jun 18 2005
a(n) = number of 1's of stage n of the one-dimensional cellular automaton with Rule 90. - Andras Erszegi (erszegi.andras(AT)chello.hu), Apr 01 2006
a(33)..a(63) = A117973(1)..A117973(31). - Stephen Crowley, Mar 21 2007
Or the number of solutions of the equation: A000120(x) + A000120(n-x) = A000120(n). - Vladimir Shevelev, Jul 19 2009
For positive n, a(n) equals the denominator of the permanent of the n X n matrix consisting entirely of (1/2)'s. - John M. Campbell, May 26 2011
Companions to A001316 are A048896, A105321, A117973, A151930 and A191488. They all have the same structure. We observe that for all these sequences a((2*n+1)*2^p-1) = C(p)*A001316(n), p >= 0. If C(p) = 2^p then a(n) = A001316(n), if C(p) = 1 then a(n) = A048896(n), if C(p) = 2^p+2 then a(n) = A105321(n+1), if C(p) = 2^(p+1) then a(n) = A117973(n), if C(p) = 2^p-2 then a(n) = (-1)*A151930(n) and if C(p) = 2^(p+1)+2 then a(n) = A191488(n). Furthermore for all a(2^p - 1) = C(p). - Johannes W. Meijer, Jun 05 2011
a(n) = number of zeros in n-th row of A219463 = number of ones in n-th row of A047999. - Reinhard Zumkeller, Nov 30 2012
This is the Run Length Transform of S(n) = {1,2,4,8,16,...} (cf. A000079). The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g., 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product). - N. J. A. Sloane, Sep 05 2014
A105321(n+1) = a(n+1) + a(n). - Reinhard Zumkeller, Nov 14 2014
a(n) = A261363(n,n) = number of distinct terms in row n of A261363 = number of odd terms in row n+1 of A261363. - Reinhard Zumkeller, Aug 16 2015
From Gary W. Adamson, Aug 26 2016: (Start)
A production matrix for the sequence is lim_{k->infinity} M^k, the left-shifted vector of M:
1, 0, 0, 0, 0, ...
2, 0, 0, 0, 0, ...
0, 1, 0, 0, 0, ...
0, 2, 0, 0, 0, ...
0, 0, 1, 0, 0, ...
0, 0, 2, 0, 0, ...
0, 0, 0, 1, 0, ...
...
The result is equivalent to the g.f. of Apr 06 2003: Product_{k>=0} (1 + 2*z^(2^k)). (End)
Number of binary palindromes of length n for which the first floor(n/2) symbols are themselves a palindrome (Ji and Wilf 2008). - Jeffrey Shallit, Jun 15 2017

Examples

			Has a natural structure as a triangle:
  1,
  2,
  2,4,
  2,4,4,8,
  2,4,4,8,4,8,8,16,
  2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,
  2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32,64,
  ...
The rows converge to A117973.
From _Omar E. Pol_, Jun 07 2009: (Start)
Also, triangle begins:
   1;
   2,2;
   4,2,4,4;
   8,2,4,4,8,4,8,8;
  16,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16;
  32,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,4,8,8,16,8,16,16,32,8,16,16,32,16,32,32;
  64,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,4,8,8,16,8,16,16,32,8,16,16,32,16,32,...
(End)
G.f. = 1 + 2*x + 2*x^2 + 4*x^3 + 2*x^4 + 4*x^5 + 4*x^6 + 8*x^7 + 2*x^8 + ... - _Michael Somos_, Aug 26 2015
		

References

  • Arthur T. Benjamin and Jennifer J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A., 2003, p. 75ff.
  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 145-151.
  • James W. L. Glaisher, On the residue of a binomial-theorem coefficient with respect to a prime modulus, Quarterly Journal of Pure and Applied Mathematics, Vol. 30 (1899), pp. 150-156.
  • H. W. Gould, Exponential Binomial Coefficient Series. Tech. Rep. 4, Math. Dept., West Virginia Univ., Morgantown, WV, Sep 1961.
  • Olivier Martin, Andrew M. Odlyzko, and Stephen Wolfram, Algebraic properties of cellular automata, Comm. Math. Physics, Vol. 93 (1984), pp. 219-258. Reprinted in Theory and Applications of Cellular Automata, S Wolfram, Ed., World Scientific, 1986, pp. 51-90 and in Cellular Automata and Complexity: Collected Papers of Stephen Wolfram, Addison-Wesley, 1994, pp. 71-113
  • Manfred R. Schroeder, Fractals, Chaos, Power Laws, W. H. Freeman, NY, 1991, page 383.
  • 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).
  • Andrew Wuensche, Exploring Discrete Dynamics, Luniver Press, 2011. See Fig. 2.3.

Crossrefs

Equals left border of triangle A166548. - Gary W. Adamson, Oct 16 2009
For generating functions Product_{k>=0} (1+a*x^(b^k)) for the following values of (a,b) see: (1,2) A000012 and A000027, (1,3) A039966 and A005836, (1,4) A151666 and A000695, (1,5) A151667 and A033042, (2,2) A001316, (2,3) A151668, (2,4) A151669, (2,5) A151670, (3,2) A048883, (3,3) A117940, (3,4) A151665, (3,5) A151671, (4,2) A102376, (4,3) A151672, (4,4) A151673, (4,5) A151674.
For partial sums see A006046. For first differences see A151930.
This is the numerator of 2^n/n!, while A049606 gives the denominator.
If we subtract 1 from the terms we get a pair of essentially identical sequences, A038573 and A159913.
A163000 and A163577 count binomial coefficients with 2-adic valuation 1 and 2. A275012 gives a measure of complexity of these sequences. - Eric Rowland, Mar 15 2017
Cf. A286575 (run-length transform), A368655 (binomial transform), also A037445.

Programs

  • Haskell
    import Data.List (transpose)
    a001316 = sum . a047999_row  -- Reinhard Zumkeller, Nov 24 2012
    a001316_list = 1 : zs where
       zs = 2 : (concat $ transpose [zs, map (* 2) zs])
    -- Reinhard Zumkeller, Aug 27 2014, Sep 16 2011
    (Sage, Python)
    from functools import cache
    @cache
    def A001316(n):
        if n <= 1: return n+1
        return A001316(n//2) << n%2
    print([A001316(n) for n in range(88)])  # Peter Luschny, Nov 19 2012
    
  • Maple
    A001316 := proc(n) local k; add(binomial(n,k) mod 2, k=0..n); end;
    S:=[1]; S:=[op(S),op(2*s)]; # repeat ad infinitum!
    a := n -> 2^add(i,i=convert(n,base,2)); # Peter Luschny, Mar 11 2009
  • Mathematica
    Table[ Sum[ Mod[ Binomial[n, k], 2], {k, 0, n} ], {n, 0, 100} ]
    Nest[ Join[#, 2#] &, {1}, 7] (* Robert G. Wilson v, Jan 24 2006 and modified Jul 27 2014 *)
    Map[Function[Apply[Plus,Flatten[ #1]]], CellularAutomaton[90,{{1},0},100]] (* Produces counts of ON cells. N. J. A. Sloane, Aug 10 2009 *)
    ArrayPlot[CellularAutomaton[90, {{1}, 0}, 20]] (* Illustration of first 20 generations. - N. J. A. Sloane, Aug 14 2014 *)
    Table[2^(RealDigits[n - 1, 2][[1]] // Total), {n, 1, 100}] (* Gabriel C. Benamy, Dec 08 2009 *)
    CoefficientList[Series[Exp[2*x], {x, 0, 100}], x] // Numerator (* Jean-François Alcover, Oct 25 2013 *)
    Count[#,?OddQ]&/@Table[Binomial[n,k],{n,0,90},{k,0,n}] (* _Harvey P. Dale, Sep 22 2015 *)
    2^DigitSum[Range[0, 100], 2] (* Paolo Xausa, Jul 31 2025 *)
  • PARI
    {a(n) = if( n<0, 0, numerator(2^n / n!))};
    
  • PARI
    A001316(n)=1<M. F. Hasler, May 03 2009
    
  • PARI
    a(n)=2^hammingweight(n) \\ Charles R Greathouse IV, Jan 04 2013
    
  • Python
    def A001316(n):
        return 2**bin(n)[2:].count("1") # Indranil Ghosh, Feb 06 2017
    
  • Python
    def A001316(n): return 1<Karl-Heinz Hofmann, Aug 01 2025
    
  • Python
    import numpy # (version >= 2.0.0)
    n_up_to = 2**22
    A000079 = 1 << numpy.arange(n_up_to.bit_length())
    A001316 = A000079[numpy.bitwise_count(numpy.arange(n_up_to))]
    print(A001316[0:100]) # Karl-Heinz Hofmann, Aug 01 2025
    
  • Scheme
    (define (A001316 n) (let loop ((n n) (z 1)) (cond ((zero? n) z) ((even? n) (loop (/ n 2) z)) (else (loop (/ (- n 1) 2) (* z 2)))))) ;; Antti Karttunen, May 29 2017

Formula

a(n) = 2^A000120(n).
a(0) = 1; for n > 0, write n = 2^i + j where 0 <= j < 2^i; then a(n) = 2*a(j).
a(n) = 2*a(n-1)/A006519(n) = A000079(n)*A049606(n)/A000142(n).
a(n) = A038573(n) + 1.
G.f.: Product_{k>=0} (1+2*z^(2^k)). - Ralf Stephan, Apr 06 2003
a(n) = Sum_{i=0..2*n} (binomial(2*n, i) mod 2)*(-1)^i. - Benoit Cloitre, Nov 16 2003
a(n) mod 3 = A001285(n). - Benoit Cloitre, May 09 2004
a(n) = 2^n - 2*Sum_{k=0..n} floor(binomial(n, k)/2). - Paul Barry, Dec 24 2004
a(n) = Product_{k=0..log_2(n)} 2^b(n, k), b(n, k) = coefficient of 2^k in binary expansion of n. - Paul D. Hanna
Sum_{k=0..n-1} a(k) = A006046(n).
a(n) = n/2 + 1/2 + (1/2)*Sum_{k=0..n} (-(-1)^binomial(n,k)). - Stephen Crowley, Mar 21 2007
G.f. for a(n)/A156769(n): (1/2)*z^(1/2)*sinh(2*z^(1/2)). - Johannes W. Meijer, Feb 20 2009
Equals infinite convolution product of [1,2,0,0,0,0,0,0,0] aerated (A000079 - 1) times, i.e., [1,2,0,0,0,0,0,0,0] * [1,0,2,0,0,0,0,0,0] * [1,0,0,0,2,0,0,0,0]. - Mats Granvik, Gary W. Adamson, Oct 02 2009
a(n) = f(n, 1) with f(x, y) = if x = 0 then y otherwise f(floor(x/2), y*(1 + x mod 2)). - Reinhard Zumkeller, Nov 21 2009
a(n) = 2^(number of 1's in binary form of (n-1)). - Gabriel C. Benamy, Dec 08 2009
a((2*n+1)*2^p-1) = (2^p)*a(n), p >= 0. - Johannes W. Meijer, Jun 05 2011
a(n) = A000120(A001317(n)). - Reinhard Zumkeller, Nov 24 2012
a(n) = A226078(n,1). - Reinhard Zumkeller, May 25 2013
a(n) = lcm(n!, 2^n) / n!. - Daniel Suteu, Apr 28 2017
a(n) = A061142(A005940(1+n)). - Antti Karttunen, May 29 2017
a(0) = 1, a(2*n) = a(n), a(2*n+1) = 2*a(n). - Daniele Parisse, Feb 15 2024
a(n*m) <= a(n)^A000120(m). - Joe Amos, Mar 27 2025

Extensions

Additional comments from Henry Bottomley, Mar 12 2001
Further comments from N. J. A. Sloane, May 30 2009

A003986 Table T(n,k) = n OR k read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 3, 3, 3, 4, 3, 2, 3, 4, 5, 5, 3, 3, 5, 5, 6, 5, 6, 3, 6, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 6, 7, 4, 7, 6, 7, 8, 9, 9, 7, 7, 5, 5, 7, 7, 9, 9, 10, 9, 10, 7, 6, 5, 6, 7, 10, 9, 10, 11, 11, 11, 11, 7, 7, 7, 7, 11, 11, 11, 11, 12, 11, 10, 11, 12, 7, 6, 7, 12, 11, 10, 11, 12, 13, 13, 11
Offset: 0

Views

Author

Keywords

Examples

			The upper left corner of the array starts in row x=0 with columns y>=0 as:
   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, ...
   1,  1,  3,  3,  5,  5,  7,  7,  9,  9, 11, 11, 13, ...
   2,  3,  2,  3,  6,  7,  6,  7, 10, 11, 10, 11, 14, ...
   3,  3,  3,  3,  7,  7,  7,  7, 11, 11, 11, 11, 15, ...
   4,  5,  6,  7,  4,  5,  6,  7, 12, 13, 14, 15, 12, ...
   5,  5,  7,  7,  5,  5,  7,  7, 13, 13, 15, 15, 13, ...
   6,  7,  6,  7,  6,  7,  6,  7, 14, 15, 14, 15, 14, ...
   7,  7,  7,  7,  7,  7,  7,  7, 15, 15, 15, 15, 15, ...
   8,  9, 10, 11, 12, 13, 14, 15,  8,  9, 10, 11, 12, ...
   9,  9, 11, 11, 13, 13, 15, 15,  9,  9, 11, 11, 13, ...
  10, 11, 10, 11, 14, 15, 14, 15, 10, 11, 10, 11, 14, ...
		

Crossrefs

Cf. A003987 (XOR) and A004198 (AND). Cf. also A075173, A075175.
Antidiagonal sums are in A006583.

Programs

  • C
    #include 
    int main()
    {
    int n, k;
    for (n=0; n<=20; n++){
        for(k=0; k<=n; k++){
            printf("%d, ", (k|(n - k)));
        }
        printf("\n");
    }
    return 0;
    } /* Indranil Ghosh, Apr 01 2017 */
  • Haskell
    import Data.Bits ((.|.))
    a003986 n k = (n - k) .|. k :: Int
    a003986_row n = map (a003986 n) [0..n]
    a003986_tabl = map a003986_row [0..]
    -- Reinhard Zumkeller, Aug 05 2014
    
  • Maple
    read("transforms") ;
    A003986 := proc(x,y) ORnos(x,y) ;end proc:
    for d from 0 to 12 do for x from 0 to d do printf("%d,", A003986(x,d-x)) ; end do: end do: # R. J. Mathar, May 28 2011
  • Mathematica
    Table[BitOr[k, n - k], {n, 0, 20}, {k, 0, n}] //Flatten (* Indranil Ghosh, Apr 01 2017 *)
  • PARI
    tabl(nn) = {for(n=0, nn, for(k=0, n, print1(bitor(k, n - k), ", "); ); print(); ); };
    tabl(20) \\ Indranil Ghosh, Apr 01 2017
    
  • Python
    for n in range(21):
        print([k|(n - k) for k in range(n + 1)])
    # Indranil Ghosh, Apr 01 2017
    

Formula

T(x,y) = T(y,x) = A080098(x,y). - R. J. Mathar, May 28 2011

Extensions

Name edited by Michel Marcus, Jan 17 2023

A265705 Triangle read by rows: T(n,k) = k IMPL n, 0 <= k <= n, bitwise logical IMPL.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 3, 3, 3, 3, 7, 6, 5, 4, 7, 7, 7, 5, 5, 7, 7, 7, 6, 7, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 15, 14, 13, 12, 11, 10, 9, 8, 15, 15, 15, 13, 13, 11, 11, 9, 9, 15, 15, 15, 14, 15, 14, 11, 10, 11, 10, 15, 14, 15, 15, 15, 15, 15, 11, 11, 11, 11, 15
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 15 2015

Keywords

Examples

			.          10 | 1010                            12 | 1100
.           4 |  100                             6 |  110
.   ----------+-----                     ----------+-----
.   4 IMPL 10 | 1011 -> T(10,4)=11       6 IMPL 12 | 1101 -> T(12,6)=13
.
First 16 rows of the triangle, where non-symmetrical rows are marked, see comment concerning A158582 and A089633:
.   0:                                 0
.   1:                               1   1
.   2:                             3   2   3
.   3:                           3   3   3   3
.   4:                         7   6   5   4   7    X
.   5:                       7   7   5   5   7   7
.   6:                     7   6   7   6   7   6   7
.   7:                   7   7   7   7   7   7   7   7
.   8:                15  14  13  12  11  10   9   8  15    X
.   9:              15  15  13  13  11  11   9   9  15  15    X
.  10:            15  14  15  14  11  10  11  10  15  14  15    X
.  11:          15  15  15  15  11  11  11  11  15  15  15  15
.  12:        15  14  13  12  15  14  13  12  15  14  13  12  15    X
.  13:      15  15  13  13  15  15  13  13  15  15  13  13  15  15
.  14:    15  14  15  14  15  14  15  14  15  14  15  14  15  14  15
.  15:  15  15  15  15  15  15  15  15  15  15  15  15  15  15  15  15 .
		

Crossrefs

Cf. A003817, A007088, A029578, A089633, A158582, A247648, A265716 (central terms), A265736 (row sums).
Other triangles: A080099 (AND), A080098 (OR), A051933 (XOR), A102037 (CNIMPL).

Programs

  • Haskell
    a265705_tabl = map a265705_row [0..]
    a265705_row n = map (a265705 n) [0..n]
    a265705 n k = k `bimpl` n where
       bimpl 0 0 = 0
       bimpl p q = 2 * bimpl p' q' + if u <= v then 1 else 0
                   where (p', u) = divMod p 2; (q', v) = divMod q 2
    
  • Julia
    using IntegerSequences
    for n in 0:15 println(n == 0 ? [0] : [Bits("IMP", k, n) for k in 0:n]) end  # Peter Luschny, Sep 25 2021
  • Maple
    A265705 := (n, k) -> Bits:-Implies(k, n):
    seq(seq(A265705(n, k), k=0..n), n=0..11); # Peter Luschny, Sep 23 2019
  • Mathematica
    T[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[n, 2]]-1-k, n]];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 25 2021, after David A. Corneth's PARI code *)
  • PARI
    T(n, k) = if(n==0,return(0)); bitor((2<David A. Corneth, Sep 24 2021
    

Formula

T(n,0) = T(n,n) = A003817(n).
T(2*n,n) = A265716(n).
Let m = A089633(n): T(m,k) = T(m,m-k), k = 0..m.
Let m = A158582(n): T(m,k) != T(m,m-k) for at least one k <= n.
Let m = A247648(n): T(2*m,m) = 2*m.
For n > 0: A029578(n+2) = number of odd terms in row n; no even terms in odd-indexed rows.
A265885(n) = T(prime(n),n).
A053644(n) = smallest k such that row k contains n.

A080099 Triangle T(n,k) = n AND k, 0<=k<=n, bitwise logical AND, read by rows.

Original entry on oeis.org

0, 0, 1, 0, 0, 2, 0, 1, 2, 3, 0, 0, 0, 0, 4, 0, 1, 0, 1, 4, 5, 0, 0, 2, 2, 4, 4, 6, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 1, 0, 1, 0, 1, 0, 1, 8, 9, 0, 0, 2, 2, 0, 0, 2, 2, 8, 8, 10, 0, 1, 2, 3, 0, 1, 2, 3, 8, 9, 10, 11, 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 12, 0, 1, 0, 1, 4, 5, 4, 5, 8, 9, 8, 9
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 28 2003

Keywords

Comments

A080100(n) = number of numbers k such that n AND k = 0 in n-th row of the triangular array.

Examples

			Triangle starts:
0
0 1
0 0 2
0 1 2 3
0 0 0 0 4
0 1 0 1 4 5
0 0 2 2 4 4 6
0 1 2 3 4 5 6 7
...
		

Crossrefs

Cf. A080100, A222423 (row sums), A004198 (array).
Other triangles: A080098 (OR), A051933 (XOR), A265705 (IMPL), A102037 (CNIMPL).

Programs

  • Haskell
    import Data.Bits ((.&.))
    a080099 n k = n .&. k :: Int
    a080099_row n = map (a080099 n) [0..n]
    a080099_tabl = map a080099_row [0..]
    -- Reinhard Zumkeller, Aug 03 2014, Jul 05 2012
    
  • Mathematica
    Column[Table[BitAnd[n, k], {n, 0, 15}, {k, 0, n}], Center] (* Alonso del Arte, Jun 19 2012 *)
  • PARI
    T(n,k)=bitand(n,k) \\ Charles R Greathouse IV, Jan 26 2013
    
  • Python
    def T(n, k): return n & k
    print([T(n, k) for n in range(14) for k in range(n+1)]) # Michael S. Branicky, Dec 16 2021

A051933 Triangle T(n,m) = Nim-sum (or XOR) of n and m, read by rows, 0<=m<=n.

Original entry on oeis.org

0, 1, 0, 2, 3, 0, 3, 2, 1, 0, 4, 5, 6, 7, 0, 5, 4, 7, 6, 1, 0, 6, 7, 4, 5, 2, 3, 0, 7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15, 0, 9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 11, 10, 9, 8, 15, 14, 13, 12, 3, 2, 1, 0, 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0
Offset: 0

Views

Author

N. J. A. Sloane, Dec 20 1999

Keywords

Examples

			{0},
{1,0},
{2,3,0},
{3,2,1,0}, ...
		

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 60.
  • J. H. Conway, On Numbers and Games, Academic Press, p. 52.

Crossrefs

Cf. A224915 (row sums), A003987 (array), A051910 (Nim-product).
Other triangles: A080099 (AND), A080098 (OR), A265705 (IMPL), A102037 (CNIMPL), A002262 (k).

Programs

  • Haskell
    import Data.Bits (xor)
    a051933 n k = n `xor` k :: Int
    a051933_row n = map (a051933 n) [0..n]
    a051933_tabl = map a051933_row [0..]
    -- Reinhard Zumkeller, Aug 02 2014, Aug 13 2013
    
  • Julia
    using IntegerSequences
    A051933Row(n) = [Bits("XOR", n, k) for k in 0:n]
    for n in 0:10 println(A051933Row(n)) end  # Peter Luschny, Sep 25 2021
  • Maple
    nimsum := proc(a,b) local t1,t2,t3,t4,l; t1 := convert(a+2^20,base,2); t2 := convert(b+2^20,base,2); t3 := evalm(t1+t2); map(x->x mod 2, t3); t4 := convert(evalm(%),list); l := convert(t4,base,2,10); sum(l[k]*10^(k-1), k=1..nops(l)); end; # memo: adjust 2^20 to be much bigger than a and b
    AT := array(0..N,0..N); for a from 0 to N do for b from a to N do AT[a,b] := nimsum(a,b); AT[b,a] := AT[a,b]; od: od:
    # Alternative:
    A051933 := (n, k) -> Bits:-Xor(n, k):
    seq(seq(A051933(n, k), k=0..n), n=0..12); # Peter Luschny, Sep 23 2019
  • Mathematica
    Flatten[Table[BitXor[m, n], {m, 0, 12}, {n, 0, m}]] (* Jean-François Alcover, Apr 29 2011 *)

Extensions

More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999

A102037 Triangle of BitAnd(BitNot(n), k).

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Dec 25 2004

Keywords

Comments

As a logical operation on two variables this is also called the 'converse nonimplication'. - Peter Luschny, Sep 25 2021

Examples

			Table starts:
[0] 0;
[1] 0, 0;
[2] 0, 1, 0;
[3] 0, 0, 0, 0;
[4] 0, 1, 2, 3, 0;
[5] 0, 0, 2, 2, 0, 0;
[6] 0, 1, 0, 1, 0, 1, 0;
[7] 0, 0, 0, 0, 0, 0, 0, 0;
[8] 0, 1, 2, 3, 4, 5, 6, 7, 0;
[9] 0, 0, 2, 2, 4, 4, 6, 6, 0, 0.
		

Crossrefs

Cf. A350094 (row sums), A268040 (array).
Other triangles: A080099 (AND), A080098 (OR), A051933 (XOR), A265705 (IMPL).

Programs

  • Julia
    using IntegerSequences
    A102037Row(n) = [Bits("CNIMP", n, k) for k in 0:n]
    for n in 0:20 println(A102037Row(n)) end  # Peter Luschny, Sep 25 2021
  • Maple
    with(Bits): cnimp := (n, k) -> And(Not(n), k):
    seq(print(seq(cnimp(n,k), k=0..n)), n = 0..12); # Peter Luschny, Sep 25 2021

A350093 a(n) = Sum_{k=0..n} n OR k where OR is the bitwise logical OR operator (A003986).

Original entry on oeis.org

0, 2, 7, 12, 26, 34, 45, 56, 100, 114, 131, 148, 174, 194, 217, 240, 392, 418, 447, 476, 514, 546, 581, 616, 684, 722, 763, 804, 854, 898, 945, 992, 1552, 1602, 1655, 1708, 1770, 1826, 1885, 1944, 2036, 2098, 2163, 2228, 2302, 2370, 2441, 2512, 2712, 2786, 2863
Offset: 0

Views

Author

Kevin Ryde, Dec 14 2021

Keywords

Comments

The effect of n OR k is to force a 1-bit at all bit positions where n has a 1-bit, which means n*(n+1) in the sum. Bits of k where n has a 0-bit are NOT(n) AND k = n CNIMPL k so that a(n) = A350094(n) + n*(n+1).

Crossrefs

Cf. A003986 (bitwise OR), A001196 (bit doubling).
Row sums of A080098.
Other sums: A222423 (AND), A224915 (XOR), A265736 (IMPL), A350094 (CNIMPL).

Programs

  • PARI
    a(n) = (3*(n^2 + fromdigits(binary(n),4)) + 2*n) >> 2;

Formula

a(n) = ((3*n+2)*n + A001196(n)) / 4.
a(2*n) = 4*a(n) - n.
a(2*n+1) = 4*a(n) + 2*n + 2.
a(n) = A222423(n) + A224915(n), being OR = AND + XOR.

A182251 a(0) = 0, a(n) = (a(n-1) OR n) * n.

Original entry on oeis.org

0, 1, 6, 21, 84, 425, 2586, 18137, 145096, 1305873, 13058830, 143647141, 1723765788, 22408955257, 313725373682, 4705880605425, 75294089686800, 1279999524675617, 23039991444161430, 437759837439067189, 8755196748781343780, 183859131724408219737, 4044900897936980834346
Offset: 0

Views

Author

Alex Ratushnyak, Apr 20 2012

Keywords

Crossrefs

Cf. A080098.

Programs

  • Mathematica
    a[0]=0; a[n_]:=n BitOr[a[n-1],n]; Array[a,23,0] (* Stefano Spezia, Apr 15 2022 *)
    nxt[{n_,a_}]:={n+1,BitOr[a,n+1](n+1)}; NestList[nxt,{0,0},30][[All,2]] (* Harvey P. Dale, Feb 08 2023 *)
  • PARI
    a(n) = if (n==0, 0, n*bitor(a(n-1), n)); \\ Michel Marcus, Apr 16 2022
  • Python
    a=0
    for i in range(1,51):
      print(a)
      a |= i
      a *= i
    

Formula

a(0) = 0, a(n) = (a(n-1) OR n) * n, where OR is the bitwise logical inclusive-OR operator.

A163351 Triangle T(n,k) = m, 0<=k<=n, read by rows, where each decimal digit d of the integer m is the minimum of the corresponding decimal digits of n and k.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 10, 11, 12, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 10
Offset: 0

Views

Author

Rick L. Shepherd, Jul 25 2009

Keywords

Comments

The number k is left-padded with zeros as necessary for comparison with n.
Clearly, for all n>=0, T(n,0) = 0 and T(n,n) = n.
For all A051885(n), T(A051885(n),k) = k; no other rows have this pattern.

Examples

			T(10,1) = 0 = a(56) as 0<1 in both tens and units positions. Sequence first differs from A002262 here.
T(104,53) = 3 as 3<4, 0<5, and 0<1.
		

Crossrefs

A163352 Triangle T(n,k) = m, 0<=k<=n, read by rows, where each decimal digit d of the integer m is the maximum of the corresponding decimal digits of n and k.

Original entry on oeis.org

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

Views

Author

Rick L. Shepherd, Jul 25 2009

Keywords

Comments

The number k is left-padded with zeros as necessary for comparison with n.
Clearly, for all n>=0, T(n,0) = T(n,n) = n.
For all A051885(n), T(A051885(n),k) = A051885(n); no other rows have constant terms.

Examples

			T(10,1) = 11 = a(56) as 1>0 in both tens and units positions. Sequence first differs from A003056 here.
T(104,53) = 154 as 4>3, 5>0, and 1>0.
		

Crossrefs

Showing 1-10 of 10 results.