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

A067576 Array T(i,j) read by downward antidiagonals, where T(i,j) is the j-th term whose binary expansion has i 1's.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 6, 11, 15, 16, 9, 13, 23, 31, 32, 10, 14, 27, 47, 63, 64, 12, 19, 29, 55, 95, 127, 128, 17, 21, 30, 59, 111, 191, 255, 256, 18, 22, 39, 61, 119, 223, 383, 511, 512, 20, 25, 43, 62, 123, 239, 447, 767, 1023, 1024, 24, 26, 45, 79, 125, 247, 479, 895, 1535, 2047
Offset: 1

Views

Author

Robert G. Wilson v, Jan 30 2002

Keywords

Comments

This is a permutation of the positive integers; the inverse permutation is A356419. - Jianing Song, Aug 06 2022

Examples

			Array begins:
        j=1  j=2  j=3  j=4  j=5  j=6
  i=1:    1,   2,   4,   8,  16,  32, ...
  i=2:    3,   5,   6,   9,  10,  12, ...
  i=3:    7,  11,  13,  14,  19,  21, ...
  i=4:   15,  23,  27,  29,  30,  39, ...
  i=5:   31,  47,  55,  59,  61,  62, ...
  i=6:   63,  95, 111, 119, 123, 125, ...
		

Crossrefs

T(n,n) gives A036563(n+1).
The antidiagonals are read in the opposite direction from those in A066884.
Antidiagonal sums give A361074.

Programs

  • Mathematica
    a = {}; Do[ a = Append[a, Last[ Take[ Select[ Range[2^13], Count[ IntegerDigits[ #, 2], 1] == j & ], i - j]]], {i, 2, 12}, {j, 1, i - 1} ]; a

A066884 Square array read by upward antidiagonals where the n-th row contains the positive integers with n binary 1's.

Original entry on oeis.org

1, 3, 2, 7, 5, 4, 15, 11, 6, 8, 31, 23, 13, 9, 16, 63, 47, 27, 14, 10, 32, 127, 95, 55, 29, 19, 12, 64, 255, 191, 111, 59, 30, 21, 17, 128, 511, 383, 223, 119, 61, 39, 22, 18, 256, 1023, 767, 447, 239, 123, 62, 43, 25, 20, 512, 2047, 1535, 895, 479, 247, 125, 79, 45, 26, 24, 1024
Offset: 1

Views

Author

Jared Benjamin Ricks (jaredricks(AT)yahoo.com), Jan 21 2002

Keywords

Comments

This is a permutation of the positive integers; the inverse permutation is A067587.

Examples

			Column: 1   2   3   4   5   6
-----------------------------
Row 1:| 1   2   4   8  16  32
Row 2:| 3   5   6   9  10  12
Row 3:| 7  11  13  14  19  21
Row 4:|15  23  27  29  30  39
Row 5:|31  47  55  59  61  62
Row 6:|63  95 111 119 123 125
		

Crossrefs

Selected rows: A000079 (1), A018900 (2), A014311 (3), A014312 (4), A014313 (5), A023688 (6), A023689 (7), A023690 (8), A023691 (9), A038461 (10), A038462 (11), A038463 (12). For decimal analogs, see A011557 and A038444-A038452.
Selected columns: A000225 (1), A055010 (2).
Selected diagonals: A036563 (main), A000918 (1st upper), A153894 (2nd upper). [Franklin T. Adams-Watters, Apr 22 2009]
Cf. A067576 (the same array read by downward antidiagonals).
Antidiagonal sums give A361074.

Programs

  • Mathematica
    a = {}; Do[ a = Append[a, Last[ Take[ Take[ Select[ Range[2^12], Count[ IntegerDigits[ #, 2], 1] == j - i + 1 & ], j], i]]], {j, 1, 11}, {i, 1, j}]; a

Extensions

Corrected and extended by Henry Bottomley, Jan 27 2002

A090706 Number of numbers having in binary representation the same number of zeros and ones as n has.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 3, 3, 3, 3, 1, 1, 4, 4, 6, 4, 6, 6, 4, 4, 6, 6, 4, 6, 4, 4, 1, 1, 5, 5, 10, 5, 10, 10, 10, 5, 10, 10, 10, 10, 10, 10, 5, 5, 10, 10, 10, 10, 10, 10, 5, 10, 10, 10, 5, 10, 5, 5, 1, 1, 6, 6, 15, 6, 15, 15, 20, 6, 15, 15, 20, 15, 20, 20, 15, 6, 15, 15, 20, 15, 20
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 15 2004

Keywords

Examples

			From _Ruud H.G. van Tol_, Apr 17 2014: (Start)
n=25->'11001': a(25) = #{'10011'->19, '10101'->21, '10110'->22, '11001'->25, '11010'->26, '11100'->28} = 6.
n=23->'1_0111' has 5 bits, and the lower 4 bits can be shuffled. There are 1 zero and 3 ones, so the number of combinations is C(4,1) = 4 (the zero can be in 4 positions).
n=31->'1_1111': C(4,4) = 1.
n=33->'1_00001': C(5,1) = 5 (the one can be in 5 positions).
n=35->'1_00011': C(5,2) = 10. (End)
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Binomial[Length[b = IntegerDigits[n, 2]]-1, Count[b, 0]]; a[0] = 1; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 25 2014 *)
  • PARI
    A090706 = n->binomial(#binary(n)-1,hammingweight(n)-(n>0)) \\ About 20% faster than the alternative "...-1)+!n". - M. F. Hasler, Jan 04 2014
    
  • Python
    from math import comb
    def A090706(n): return comb(n.bit_length()-1,n.bit_count()-1) if n else 1 # Chai Wah Wu, Mar 06 2025

Formula

a(n) = binomial(A070939(n)-1, A000120(n)-1).
a(n) = binomial(A070939(n)-1, A023416(n)).

Extensions

Missing a(0)=1 added and offset adjusted by Reinhard Zumkeller, Dec 19 2012

A038461 Sums of 10 distinct powers of 2.

Original entry on oeis.org

1023, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 2046, 2559, 2815, 2943, 3007, 3039, 3055, 3063, 3067, 3069, 3070, 3327, 3455, 3519, 3551, 3567, 3575, 3579, 3581, 3582, 3711, 3775, 3807, 3823, 3831, 3835, 3837, 3838, 3903
Offset: 1

Views

Author

Keywords

Crossrefs

Base 2 interpretation of A038452.
Cf. A000079, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691 (Hamming weight = 1, 2, ..., 9).

Programs

  • Mathematica
    Select[Range[4000], DigitCount[#, 2, 1] == 10 &] (* Amiram Eldar, Feb 14 2022 *)
  • PARI
    isok(n) = hammingweight(n) == 10; \\ Michel Marcus, Feb 29 2016
    
  • Python
    from itertools import islice
    def A038461_gen(): # generator of terms
        yield (n:=1023)
        while True: yield (n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A038461_list = list(islice(A038461_gen(),20)) # Chai Wah Wu, Mar 10 2025

Formula

Sum_{n>=1} 1/a(n) = 1.386312271262110321181505974797071257205562524228381227122302929089588534920... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A038462 Sums of 11 distinct powers of 2.

Original entry on oeis.org

2047, 3071, 3583, 3839, 3967, 4031, 4063, 4079, 4087, 4091, 4093, 4094, 5119, 5631, 5887, 6015, 6079, 6111, 6127, 6135, 6139, 6141, 6142, 6655, 6911, 7039, 7103, 7135, 7151, 7159, 7163, 7165, 7166, 7423, 7551, 7615, 7647, 7663, 7671
Offset: 1

Views

Author

Keywords

Crossrefs

Base 2 interpretation of A038453.
Cf. A000079, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691, A038461 (Hamming weight = 1, 2, ..., 10).

Programs

  • Mathematica
    Select[Range[8000], DigitCount[#, 2, 1] == 11 &] (* Amiram Eldar, Feb 14 2022 *)
  • Python
    from itertools import islice
    def A038462_gen(): # generator of terms
        yield (n:=2047)
        while True: yield (n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A038462_list = list(islice(A038462_gen(),20)) # Chai Wah Wu, Mar 10 2025

Formula

Sum_{n>=1} 1/a(n) = 1.386300330514503033229968047555778179200262625510401687087371496738972082061... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A038463 Sums of 12 distinct powers of 2.

Original entry on oeis.org

4095, 6143, 7167, 7679, 7935, 8063, 8127, 8159, 8175, 8183, 8187, 8189, 8190, 10239, 11263, 11775, 12031, 12159, 12223, 12255, 12271, 12279, 12283, 12285, 12286, 13311, 13823, 14079, 14207, 14271, 14303, 14319, 14327, 14331, 14333
Offset: 1

Views

Author

Keywords

Crossrefs

Base 2 interpretation of A038454.
Cf. A000079, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691, A038461, A038462 (Hamming weight = 1, 2, ..., 11).

Programs

  • Mathematica
    Select[Range[15000], DigitCount[#, 2, 1] == 12 &] (* Amiram Eldar, Feb 14 2022 *)
  • Python
    from itertools import islice
    def A038463_gen(): # generator of terms
        yield (n:=4095)
        while True: yield (n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A038463_list = list(islice(A038463_gen(),20)) # Chai Wah Wu, Mar 10 2025

Formula

Sum_{n>=1} 1/a(n) = 1.386296350824871649202152615241744383837323713474767661902780220440945591424... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Offset changed to 1 by Ivan Neretin, Feb 28 2016

A238015 Denominator of (2*n+1)!*8*Bernoulli(2*n,1/2).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 4, 1, 1, 1, 2, 1, 2, 2, 4, 1, 2, 2, 4, 2, 4, 4, 8, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 4, 1, 1, 1, 2, 1, 2, 2, 4, 1, 2, 2, 4, 2, 4, 4, 8, 1, 1, 1, 2, 1
Offset: 0

Views

Author

Robert Israel, Feb 17 2014

Keywords

Comments

It appears that a(n) is 1 for n in A095736, 2 for n in A014312, 4 for n in A014313, 8 for n in A023688, 16 for n in A023689, 32 for n in A023690, 64 for n in A023691. - Michel Marcus, Feb 18 2014

Examples

			For n=15, (2*15+1)!*8*Bernoulli(2*15,1/2) = -79147239268966167007717425917182573906640625/2 so a(15) = 2.
		

Crossrefs

Cf. A033473.

Programs

  • Maple
    seq(denom((2*n+1)!*8*bernoulli(2*n,1/2)), n=0 .. 100);
  • Mathematica
    Table[Denominator[(2 n + 1)! 8 BernoulliB[2 n, 1/2]], {n, 0, 200}] (* Vincenzo Librandi, Feb 18 2014 *)

A317295 Numbers with a composite number of 1's in their binary expansion.

Original entry on oeis.org

15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 63, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 95, 99, 101, 102, 105, 106, 108, 111, 113, 114, 116, 119, 120, 123, 125, 126, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 159, 163, 165, 166, 169, 170, 172, 175, 177, 178, 180, 183, 184, 187, 189, 190
Offset: 1

Views

Author

Omar E. Pol, Aug 10 2018

Keywords

Comments

By definition no power of 2 is in the sequence.

Examples

			23 is in the sequence because the binary expansion of 23 is 10111 and 10111 has four 1's, and 4 is a composite number (A002808).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200], CompositeQ[DigitCount[#, 2, 1]] &] (* Amiram Eldar, Jul 23 2023 *)
  • PARI
    isok(n) = my(w = hammingweight(n)); (w != 1) && !isprime(w); \\ Michel Marcus, Aug 15 2018
    
  • Python
    from sympy import isprime; isok = lambda n: n & (n-1) and not isprime(bin(n).count('1')) # David Radcliffe, Aug 15 2018

A086772 Store the natural numbers in a triangular array such that values on each row have the same number of bits. Start a new row with the smallest number not yet recorded. a(n) represents the initial terms in the resulting array.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 15, 21, 24, 31, 41, 45, 63, 64, 72, 74, 83, 94, 127, 139, 140, 173, 197, 207, 234, 255, 268, 284, 288, 339, 349, 390, 426, 445, 467, 511, 522, 553, 569, 634, 689, 706, 734, 797, 838, 934, 950, 951, 1023, 1036, 1052, 1078, 1179, 1236
Offset: 0

Views

Author

Alford Arnold, Aug 03 2003

Keywords

Comments

A067576 describes the sequences with a fixed number of binary bits using antidiagonals.

Examples

			The array begins:
   0
   1  2
   3  5  6
   4  8 16 32
   7 11 13 14 19
   9 10 12 17 18 20
  15 23 27 29 30 39 43
  ...
so the initial terms are 0 1 3 4 7 9 15 ...
		

Crossrefs

Programs

  • Maple
    A086772aux := proc(n,k)
        option remember;
        local a,npr,kpr,fnd ;
        if n = 0 then
            return 0;
        end if;
        if k = 0 then
            for a from 1 do
                fnd := false;
                for npr from 1 to n-1 do
                    for kpr from 0 to npr do
                        if procname(npr,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                end do:
                if not fnd then
                    return a;
                end if;
            end do:
        else
            for a from 1 do
                if wt(a) = wt(procname(n,0)) then
                    fnd := false;
                    for npr from 1 to n-1 do
                        for kpr from 0 to npr do
                            if procname(npr,kpr) = a then
                                fnd := true;
                                break;
                            end if;
                        end do:
                    end do:
                    for kpr from 0 to k-1 do
                        if procname(n,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                    if not fnd then
                        return a;
                    end if;
                end if;
            end do:
        end if;
    end proc:
    A086772 := proc(n)
        A086772aux(n,0) ;
    end proc: # R. J. Mathar, Sep 15 2012

A382631 Integers whose binary representation contains exactly four 1's, no two 1's being adjacent.

Original entry on oeis.org

85, 149, 165, 169, 170, 277, 293, 297, 298, 325, 329, 330, 337, 338, 340, 533, 549, 553, 554, 581, 585, 586, 593, 594, 596, 645, 649, 650, 657, 658, 660, 673, 674, 676, 680, 1045, 1061, 1065, 1066, 1093, 1097, 1098, 1105, 1106, 1108, 1157, 1161, 1162, 1169, 1170
Offset: 1

Views

Author

Chai Wah Wu, Apr 07 2025

Keywords

Comments

Subsequence of A003714 and of A014312.

Examples

			85 = 1010101_2, 1066 = 10000101010_2.
		

Crossrefs

Programs

  • Python
    def A382631_gen(): # generator of terms
        n = 15
        yield 85
        while True: yield int(bin(n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)[2:].replace('1','01'),2)
    A382631_list = list(islice(A382631_gen(),30))
Previous Showing 11-20 of 20 results.