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

A057716 The nonpowers of 2.

Original entry on oeis.org

0, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74
Offset: 0

Views

Author

John Lindgren (john.lindgren(AT)Eng.Sun.COM), Oct 24 2000

Keywords

Comments

a(n) is the length signature of a string plus its length.
The positive members of this sequence are exactly the numbers that can be expressed as the sum of two or more consecutive positive integers (cf. A138591). - David Wasserman, Jan 24 2002
Starting at 3, these are the positions of the data bits in the single-error-correcting Hamming code.
Except for the offset 0, sequence corresponds to numbers with at least an odd divisor > 1 (For largest odd divisor see A000265). - Lekraj Beedassy, Apr 12 2005
These are exactly the numbers n with the property that, given the n(n-1)/2 sums of pairs, the original numbers can be recovered uniquely. [Nick Reingold, see Winkler reference.]
Subsequence of A158581; A000120(a(n)) > 1. - Reinhard Zumkeller, Apr 16 2009
Range of A140977. - Reinhard Zumkeller, Aug 15 2010
A209229(a(n)) = 0. - Reinhard Zumkeller, Mar 07 2012
A001227(a(n)) > 1. - Reinhard Zumkeller, May 01 2012
Numbers that can be expressed as the sum of at least two consecutive integers; numbers that can be expressed as the difference of two nonconsecutive triangular numbers. - Charles R Greathouse IV, Jul 27 2012
Except for the 1st term 0, these are the integers k such that 2*(2*k-1) divides binomial(2*k-1,k). See Ihringer & Kupavskii. - Michel Marcus, Oct 02 2017

References

  • Martin Davis, "Algorithms, Equations, and Logic", pp. 4-15 of S. Barry Cooper and Andrew Hodges, Eds., "The Once and Future Turing: Computing the World", Cambridge 2016.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 67-69.
  • P. Winkler, Mathematical Mind-Benders, Peters, Wellesley, MA, 2007; see p. 27.

Crossrefs

Complement of A000079. Cf. A057717, A001227, A103586, A138591, A138592.
See A074894 for more about the question of when the sums of n numbers taken k at a time determine the numbers.

Programs

  • Haskell
    a057716 n = a057716_list !! n
    a057716_list = filter ((== 0) . a209229) [0..]
    -- Reinhard Zumkeller, Mar 07 2012
    
  • Maple
    select(t -> t/2^padic:-ordp(t,2) <> 1, [$0..100]); # Robert Israel, May 05 2015
  • Mathematica
    Module[{nn = 100,maxpwr},maxpwr = Floor[Log[2, nn]]; Complement[Range[0, nn], 2^Range[0, maxpwr]]]  (* Harvey P. Dale, May 24 2012 *)
    Complement[Range[0, 99], 2^Range[0, 7]] (* Alonso del Arte, May 05 2015 *)
  • PARI
    print1(0);for(n=1,5,for(m=2^n+1,2^(n+1)-1,print1(", "m))) \\ Charles R Greathouse IV, Mar 07 2012
    
  • Python
    def A057716(n): return n + (n + n.bit_length()).bit_length() # Matthew Andres Moreno, Jun 16 2024
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        yield 0
        yield from (j for i in count(0) for j in range(2**i+1, 2**(i+1)))
    print(list(islice(agen(), 70))) # Michael S. Branicky, Oct 11 2024

Formula

a(n) = n + [log_2(n + [log_2(n)])] gives this sequence with the exception of a(1) = 1. - David W. Wilson, Mar 29 2005
Find k such that 2^k - (k + 1) <= n < 2^(k+1) - (k + 2), then a(n) = n + k + 1.
Numbers n = 2a(k) - 1, k > 0 are such that Sum_{k=0..n} B_k*M(n-k)*binomial(n, k) = 0 where B_k is the k-th Bernoulli number and M_k the k-th Motzkin number. - Benoit Cloitre, Oct 19 2005
From Robert Israel, May 05 2015: (Start)
G.f.: (1-x)^(-2)*Sum(m>=0, x^(2^m-m)*(2^m*x-2^m*x^2+x) + x^(2^(m+1)-m)*(2^(m+1)*x-2^(m+1)-x)).
a(i-m) = i for 2^m < i < 2^(m+1).
a(n) = A103586(n) + n for n >= 1. (End)

Extensions

Better description from Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 29 2001

A000247 a(n) = 2^n - n - 2.

Original entry on oeis.org

0, 3, 10, 25, 56, 119, 246, 501, 1012, 2035, 4082, 8177, 16368, 32751, 65518, 131053, 262124, 524267, 1048554, 2097129, 4194280, 8388583, 16777190, 33554405, 67108836, 134217699, 268435426, 536870881, 1073741792, 2147483615
Offset: 2

Views

Author

Keywords

Comments

Ways of placing n+1 labeled balls into 2 indistinguishable boxes with at least 2 balls in each box.
2^a(n) is an integer of the form 1/(2 - Sum_{i=1..m} i/2^i). - Benoit Cloitre, Oct 25 2002
Number of permutations avoiding 13-2 that contain the pattern 23-1 exactly twice.
Cost of ternary maximum height Huffman tree with N internal nodes (non-leaves) for minimizing absolutely ordered sequences of size n = 2N + 1. - Alex Vinokur (alexvn(AT)barak-online.net), Nov 02 2004
a(n) is the number of Dyck n-paths whose third upstep initiates the last long ascent, n >= 1. A long ascent is one consisting of 2 or more upsteps. For example, a(3)=3 counts UUDuUDDD, UDUDuUDD, UUDDuUDD (third upstep in small type). - David Callan, Dec 08 2004
Subsequence of A158581; A000120(a(n)) > 1. - Reinhard Zumkeller, Apr 16 2009
Number of vertices of the tropical Grassmannian simplicial complex G(2,n), related to phylogenetic trees. - Tom Copeland, Oct 03 2011
(Conjecture) Let a(2)=0. For n > 2, let N = 2*n + 1. For each n, define the n X n tridiagonal unit-primitive matrix (see [Jeffery]) A_{N,1}=[0,1,0,...,0; 1,0,1,0,...,0; 0,1,0,1,0,...,0; ...; 0,...,0,1,0,1; 0,...,0,1,1] associated with N. Define the n-dimensional column vectors V_N = [v_1,v_2,...,v_n]^T = [A_{N,1}]^n*[1,1,...,1]^T, where [.]^T denotes matrix transpose and [1,...,1] is the n-dimensional unit vector. Let (v_k)N denote the k-th element of V_N, k in {1,...,n}. Then a(n) = (v(n-2))N. - _L. Edson Jeffery, Jan 20 2012
For n>0, (a(n)) is row 3 of the convolution array A213568. - Clark Kimberling, Jun 20 2012
For n>2, a(n-2) is the number of connected induced (non-null) subgraphs of the n-centipede graph. - Giovanni Resta, May 04 2017
a(n) is the number of maximal boundary strata of the moduli space of stable rational curves with n+1 marked points. The closures of the maximal boundary strata are called the irreducible boundary divisors of the moduli space; see Cavalieri Section 2.1. - Harry Richman, Aug 13 2024

Examples

			a(3) = 4!/(2!*2!*2!) = 3.
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 222.
  • F. N. David and D. E. Barton, Combinatorial Chance. Hafner, NY, 1962, p. 296.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 76.
  • 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

Cf. A000478 (3 boxes), A058844 (4 boxes).

Programs

Formula

E.g.f.: (exp(x)-1-x)*(exp(x)-1).
G.f.: x^3*(3-2*x)/((1-2*x)*(1-x)^2).
a(n) = 2*a(n-1) + n + 3 = a(n-1) + 2^(n-1) - 1 = A000295(n) - 1 = A000295(n+1) - 2^(n+1).
A107907(a(n)) = A000225(n). - Reinhard Zumkeller, May 28 2005
Starting (3, 10, 25, 56, ...) = binomial transform of [3, 7, 8, 8, 8, ...]. - Gary W. Adamson, Nov 07 2007
a(2)=0, a(3)=3, a(4)=10, a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3). - Harvey P. Dale, Aug 23 2011
a(n) = (Sum_{k=2..floor(n/2)} binomial(n+1,k)) + if(n odd, binomial(n+1,(n+1)/2)/2, 0).
a(n) = Sum_{k=0..n-3} Sum_{i=0..n-1} C(i,k). - Wesley Ivan Hurt, Sep 20 2017

Extensions

Additional comments from Michael Steyer, Dec 02 2000
More terms from Larry Reeves (larryr(AT)acm.org), Dec 04 2000
I recently changed the beginning of this sequence so the formulas etc. may need to be adjusted. - N. J. A. Sloane, Jan 24 2006
Formulas and comments adjusted for offset by Franklin T. Adams-Watters, Nov 10 2011

A158582 Numbers with at least two zeros in their binary representation.

Original entry on oeis.org

4, 8, 9, 10, 12, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 16 2009

Keywords

Comments

Subsequence of A158581; complement of A089633; A023416(a(n))>1.
A265705(a(n),k) != A265705(a(n),a(n)-k) for at least one k <= a(n). - Reinhard Zumkeller, Dec 15 2015

Crossrefs

Programs

  • Haskell
    a158582 n = a158582_list !! (n-1)
    a158582_list = [x | x <- [0..], a023416 x > 1]
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Mathematica
    Select[Range[100],DigitCount[#,2,0]>1&] (* Harvey P. Dale, Jan 19 2015 *)
  • Python
    def A158582(n):
        def f(x):
            c = n+(((l:=(x+1).bit_length())+1)*(l-2)>>1)
            m = bin(x+1)[2:].find('0')
            c += m if m>-1 else l
            return c
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 24 2024

A383666 Numbers in whose binary representation no bit (0 or 1) occurs exactly once.

Original entry on oeis.org

3, 7, 9, 10, 12, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86
Offset: 1

Views

Author

Clark Kimberling, May 07 2025

Keywords

Comments

Also numbers that are not a power of 2 and are not (2^k + 1) away from the next larger power of 2 for some k. - David A. Corneth, May 17 2025

Examples

			From _David A. Corneth_, May 17 2025: (Start)
3 = 11_2 is in the sequence as both the digits 0 and the digits 1 do not occur exactly once in the binary expansion. Also 3 is no power of 2 and one less than a power of 2.
6 = 101_2 is not in the sequence as the digit 0 occurs exactly once in the binary expansion. Also it can be written as 2^3 - 2^0 - 1. (End)
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,n1,n0;
      L:= convert(n,base,2);
      n1:= convert(L,`+`);
      n0:= nops(L)-n1;
      n1 >= 2 and n0 <> 1
    end proc;
    select(filter, [$1..1000]); # Robert Israel, May 13 2025
  • Mathematica
    s = Select[Range[200], DigitCount[#, 2, 0] != 1 && DigitCount[#, 2, 1] != 1 &]
    Map[First, RealDigits[s, 2]]
  • PARI
    isok(k) = my(b=binary(k)); (#select(x->(x==1), b) != 1) && (#select(x->(x==0), b) != 1); \\ Michel Marcus, May 13 2025
    
  • PARI
    is(n) = {
        my(v = valuation(n, 2));
        if(n >> v == 1, return(0));
        if(1<> valuation(c, 2) == 1, return(0));
        1
    } \\ David A. Corneth, May 17 2025
    
  • PARI
    upto(n) = {
        my(res = [1..n], del = List());
        for(i = 0, logint(n, 2)+1,
            pow2 = 1<David A. Corneth, May 17 2025
    
  • Python
    def A383666(n):
        def f(x):
            if x<=1: return n+x
            l, s = x.bit_length(), bin(x)[2:]
            if (m:=s.count('0'))>0: return n+s.index('0')-(m>1)+(l*(l-1)>>1)
            return n-1+(l*(l+1)>>1)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, May 21 2025

A383667 Binary words beginning with 1 in which no binary digit occurs only once.

Original entry on oeis.org

11, 111, 1001, 1010, 1100, 1111, 10001, 10010, 10011, 10100, 10101, 10110, 11000, 11001, 11010, 11100, 11111, 100001, 100010, 100011, 100100, 100101, 100110, 100111, 101000, 101001, 101010, 101011, 101100, 101101, 101110, 110000, 110001, 110010, 110011
Offset: 1

Views

Author

Clark Kimberling, May 07 2025

Keywords

Crossrefs

Programs

  • Mathematica
    s = Select[Range[200], DigitCount[#, 2, 0] != 1 && DigitCount[#, 2, 1] != 1 &]
    Map[First, RealDigits[s, 2]]; Map[FromDigits, m]
  • Python
    def A383667(n):
        def f(x):
            if x<=1: return n+x
            l, s = x.bit_length(), bin(x)[2:]
            if (m:=s.count('0'))>0: return n+s.index('0')-(m>1)+(l*(l-1)>>1)
            return n-1+(l*(l+1)>>1)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return int(bin(m)[2:]) # Chai Wah Wu, May 21 2025
Showing 1-5 of 5 results.