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 15 results. Next

A055010 a(0) = 0; for n > 0, a(n) = 3*2^(n-1) - 1.

Original entry on oeis.org

0, 2, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303, 196607, 393215, 786431, 1572863, 3145727, 6291455, 12582911, 25165823, 50331647, 100663295, 201326591, 402653183, 805306367, 1610612735, 3221225471, 6442450943, 12884901887
Offset: 0

Views

Author

Henry Bottomley, May 31 2000

Keywords

Comments

Apart from leading term (which should really be 3/2), same as A083329.
Written in binary, a(n) is 1011111...1.
The sequence 2, 5, 11, 23, 47, 95, ... apparently gives values of n such that Nim-factorial(n) = 2. Cf. A059970. However, compare A060152. More work is needed! - John W. Layman, Mar 09 2001
With offset 1, number of (132,3412)-avoiding two-stack sortable permutations.
Number of descents after n+1 iterations of morphism A007413.
a(n) = A164874(n,1), n>0; subsequence of A030130. - Reinhard Zumkeller, Aug 29 2009
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)=(-1)^n*charpoly(A,-1). - Milan Janjic, Jan 24 2010
a(n) is the total number of records over all length n binary words. A record in a word a_1,a_2,...,a_n is a letter a_j that is larger than all the preceding letters. That is, a_j>a_i for all iGeoffrey Critzer, Jul 18 2020
Called Thabit numbers after the Syrian mathematician Thābit ibn Qurra (826 or 836 - 901). - Amiram Eldar, Jun 08 2021
a(n) is the number of objects in a pile that represents a losing position in a Nim game, where a player must select at least one object but not more than half of the remaining objects, on their turn. - Kiran Ananthpur Bacche, Feb 03 2025

Examples

			a(3) = 3*2^2 - 1 = 3*4 - 1 = 11.
		

Crossrefs

Cf. A007505 for primes in this sequence. Apart from initial term, same as A052940 and A083329.
Cf. A266550 (independence number of the n-Mycielski graph).

Programs

Formula

a(n) = A118654(n-1, 4), for n > 0.
a(n) = 2*a(n-1) + 1 = a(n-1) + A007283(n-1) = A007283(n)-1 = A000079(n) + A000225(n + 1) = A000079(n + 1) + A000225(n) = 3*A000079(n) - 1 = 3*A000225(n) + 2.
a(n) = A010036(n)/2^(n-1). - Philippe Deléham, Feb 20 2004
a(n) = A099258(A033484(n)-1) = floor(A033484(n)/2). - Reinhard Zumkeller, Oct 09 2004
G.f.: x*(2-x)/((1-x)*(1-2*x)). - Philippe Deléham, Oct 04 2011
a(n+1) = A196168(A000079(n)). - Reinhard Zumkeller, Oct 28 2011
E.g.f.: (3*exp(2*x) - 2*exp(x) - 1)/2. - Stefano Spezia, Sep 14 2024

A089633 Numbers having no more than one 0 in their binary representation.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 11, 13, 14, 15, 23, 27, 29, 30, 31, 47, 55, 59, 61, 62, 63, 95, 111, 119, 123, 125, 126, 127, 191, 223, 239, 247, 251, 253, 254, 255, 383, 447, 479, 495, 503, 507, 509, 510, 511, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1023
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 01 2004

Keywords

Comments

Complement of A158582. - Reinhard Zumkeller, Apr 16 2009
Also union of A168604 and A030130. - Douglas Latimer, Jul 19 2012
Numbers of the form 2^t - 2^k - 1, 0 <= k < t.
n is in the sequence if and only if 2*n+1 is in the sequence. - Robert Israel, Dec 14 2018
Also the least binary rank of a strict integer partition of n, where the binary rank of a partition y is given by Sum_i 2^(y_i-1). - Gus Wiseman, May 24 2024

Examples

			From _Tilman Piesk_, May 09 2012: (Start)
This may also be viewed as a triangle:             In binary:
                  0                                         0
               1     2                                 01       10
             3    5    6                          011      101      110
           7   11   13   14                  0111     1011     1101     1110
        15   23   27   29   30          01111    10111    11011    11101    11110
      31  47   55   59   61   62
   63   95  111  119  123  125  126
Left three diagonals are A000225,  A055010, A086224. Right diagonal is A000918. Central column is A129868. Numbers in row n (counted from 0) have n binary 1s. (End)
From _Gus Wiseman_, May 24 2024: (Start)
The terms together with their binary expansions and binary indices begin:
   0:      0 ~ {}
   1:      1 ~ {1}
   2:     10 ~ {2}
   3:     11 ~ {1,2}
   5:    101 ~ {1,3}
   6:    110 ~ {2,3}
   7:    111 ~ {1,2,3}
  11:   1011 ~ {1,2,4}
  13:   1101 ~ {1,3,4}
  14:   1110 ~ {2,3,4}
  15:   1111 ~ {1,2,3,4}
  23:  10111 ~ {1,2,3,5}
  27:  11011 ~ {1,2,4,5}
  29:  11101 ~ {1,3,4,5}
  30:  11110 ~ {2,3,4,5}
  31:  11111 ~ {1,2,3,4,5}
  47: 101111 ~ {1,2,3,4,6}
  55: 110111 ~ {1,2,3,5,6}
  59: 111011 ~ {1,2,4,5,6}
  61: 111101 ~ {1,3,4,5,6}
  62: 111110 ~ {2,3,4,5,6}
(End)
		

Crossrefs

Cf. A181741 (primes), union of A081118 and A000918, apart from initial -1.
For least binary index (instead of rank) we have A001511.
Applying A019565 (Heinz number of binary indices) gives A077011.
For greatest binary index we have A029837 or A070939, opposite A070940.
Row minima of A118462 (binary ranks of strict partitions).
For sum instead of minimum we have A372888, non-strict A372890.
A000009 counts strict partitions, ranks A005117.
A048675 gives binary rank of prime indices, distinct A087207.
A048793 lists binary indices, product A096111, reverse A272020.
A277905 groups all positive integers by binary rank of prime indices.

Programs

  • Haskell
    a089633 n = a089633_list !! (n-1)
    a089633_list = [2 ^ t - 2 ^ k - 1 | t <- [1..], k <- [t-1,t-2..0]]
    -- Reinhard Zumkeller, Feb 23 2012
    
  • Maple
    seq(seq(2^a-1-2^b,b=a-1..0,-1),a=1..11); # Robert Israel, Dec 14 2018
  • Mathematica
    fQ[n_] := DigitCount[n, 2, 0] < 2; Select[ Range[0, 2^10], fQ] (* Robert G. Wilson v, Aug 02 2012 *)
  • PARI
    {insq(n) = local(dd, hf, v); v=binary(n);hf=length(v);dd=sum(i=1,hf,v[i]);if(dd<=hf-2,-1,1)}
    {for(w=0,1536,if(insq(w)>=0,print1(w,", ")))}
    \\ Douglas Latimer, May 07 2013
    
  • PARI
    isoka(n) = #select(x->(x==0), binary(n)) <= 1; \\ Michel Marcus, Dec 14 2018
    
  • Python
    from itertools import count, islice
    def A089633_gen(): # generator of terms
        return ((1<A089633_list = list(islice(A089633_gen(),30)) # Chai Wah Wu, Feb 10 2023
    
  • Python
    from math import isqrt, comb
    def A089633(n): return (1<<(a:=(isqrt((n<<3)+1)-1>>1)+1))-(1<Chai Wah Wu, Dec 19 2024

Formula

A023416(a(n)) <= 1; A023416(a(n)) = A023532(n-2) for n>1;
A000120(a(u)) <= A000120(a(v)) for uA000120(a(n)) = A003056(n).
a(0)=0, n>0: a(n+1) = Min{m>n: BinOnes(a(n))<=BinOnes(m)} with BinOnes=A000120.
If m = floor((sqrt(8*n+1) - 1) / 2), then a(n) = 2^(m+1) - 2^(m*(m+3)/2 - n) - 1. - Carl R. White, Feb 10 2009
A029931(a(n)) = n and A029931(m) != n for m < a(n). - Reinhard Zumkeller, Feb 28 2014
A265705(a(n),k) = A265705(a(n),a(n)-k), k = 0 .. a(n). - Reinhard Zumkeller, Dec 15 2015
a(A014132(n)-1) = 2*a(n-1)+1 for n >= 1. - Robert Israel, Dec 14 2018
Sum_{n>=1} 1/a(n) = A065442 + A160502 = 3.069285887459... . - Amiram Eldar, Jan 09 2024
A019565(a(n)) = A077011(n). - Gus Wiseman, May 24 2024

A086224 a(n) = 7*2^n - 1.

Original entry on oeis.org

6, 13, 27, 55, 111, 223, 447, 895, 1791, 3583, 7167, 14335, 28671, 57343, 114687, 229375, 458751, 917503, 1835007, 3670015, 7340031, 14680063, 29360127, 58720255, 117440511, 234881023, 469762047, 939524095, 1879048191, 3758096383, 7516192767, 15032385535, 30064771071
Offset: 0

Views

Author

Marco Matosic, Jul 27 2003

Keywords

Comments

a(n) = A164874(n+2,2); subsequence of A030130. - Reinhard Zumkeller, Aug 29 2009
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=-3, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)=(-1)^n*charpoly(A,-5). - Milan Janjic, Jan 27 2010

Crossrefs

Other sequences with recurrence a(n+1) = 2*a(n) + 1 are:
a(0) = 2 gives A153893, a(0)=3 essentially A126646.
a(0) = 4 gives A153894, a(0)=5 essentially A153893.
a(0) = 7 gives essentially A000225.
a(0) = 8 gives A052996 except for some initial terms,
a(0) = 9 is essentially A153894.
a(0) = 10 gives A086225,
a(0) = 11 is essentially A153893.
a(0) = 13 is essentially A086224.

Programs

  • Mathematica
    7*2^Range[0,30]-1 (* Harvey P. Dale, May 09 2018 *)
  • PARI
    a(n)=7<Charles R Greathouse IV, Sep 24 2015

Formula

a(n+1) = 2*a(n) + 1.
G.f.: (6-5*x)/((1-x)*(1-2*x)). - Jaume Oliver Lafont, Sep 14 2009
a(n-1)^2 + a(n) = (7*2^(n-1))^2. - Vincenzo Librandi, Aug 08 2010
a(n) = (A052940(n+1) + A000225(n+3))/2. - Gennady Eremin, Aug 31 2023
From Elmo R. Oliveira, Apr 22 2025: (Start)
E.g.f.: exp(x)*(7*exp(x) - 1).
a(n) = 3*a(n-1) - 2*a(n-2). (End)

Extensions

More terms from David Wasserman, Feb 22 2005

A164874 Triangle read by rows: T(1,1)=2; T(n,k)=2*T(n-1,k)+1, 1<=k

Original entry on oeis.org

2, 5, 6, 11, 13, 14, 23, 27, 29, 30, 47, 55, 59, 61, 62, 95, 111, 119, 123, 125, 126, 191, 223, 239, 247, 251, 253, 254, 383, 447, 479, 495, 503, 507, 509, 510, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 2046
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 29 2009

Keywords

Comments

All terms contain exactly 1 zero in binary representation.

Examples

			Initial rows:
   1:                             2
   2:                        5        6
   3:                  11        13        14
   4:             23        27       29        30
   5:        47        55        59        61        62
   6:    95       111       119      123       125       126
also in binary representation:
                                 10
                            101       110
                      1011      1101      1110
                 10111     11011     11101     11110
           101111    110111    111011    111101    111110
      1011111   1101111   1110111   1111011   1111101   1111110 .
		

Crossrefs

Programs

  • Haskell
    a164874 n k = a164874_tabl !! (n-1) !! (k-1)
    a164874_row n = a164874_tabl !! (n-1)
    a164874_tabl = map reverse $ iterate f [2] where
       f xs@(x:_) = (2 * x + 2) : map ((+ 1) . (* 2)) xs
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Mathematica
    A164874row[n_] := 2^(n + 1) - 1 - BitShiftRight[2^n, Range[n]];
    Array[A164874row, 10] (* Paolo Xausa, Jun 13 2025 *)
  • Python
    from math import isqrt
    def A164874(n): return (1<<(a:=(isqrt(n<<3)+1>>1)+1))-(1<<(a*(a-1)>>1)-n)-1 # Chai Wah Wu, May 21 2025

Formula

T(n,k) = 2^(n+1) - 2^(n-k) - 1, 1 <= k <= n.
T(n,k) = A030130(n*(n-1)/2 + k + 1);
A023416(T(n,k)) = 1, 1<=k<=n;
A059673(n) = sum of n-th row;
T(n,1) = A055010(n);
T(n,2) = A086224(n-2) for n > 1;
T(n,n-1) = A036563(n+1) for n > 1;
T(n,n) = A000918(n+1).

A095078 Primes with a single 0 bit in their binary expansion.

Original entry on oeis.org

2, 5, 11, 13, 23, 29, 47, 59, 61, 191, 223, 239, 251, 383, 479, 503, 509, 991, 1019, 1021, 2039, 3583, 3967, 4079, 4091, 4093, 6143, 15359, 16127, 16319, 16381, 63487, 65407, 65519, 129023, 131063, 245759, 253951, 261631, 261887, 262079
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Comments

Except for the first value 2, the sequence gives the primes of the form 2^k -2^j -1 with 0 < j < k-1. If j=k-1 we obtain the Mersenne primes. - Pierre CAMI, May 19 2005
{2} UNION (A000040 INTERSECT A190620). - Chai Wah Wu, Dec 19 2024

Crossrefs

Intersection of A000040 and A030130. Cf. A095058, A190620.

Programs

  • Mathematica
    Select[Prime[Range[23000]],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Nov 28 2019 *)
  • PARI
    forprime(p=2,262079,v=binary(p);s=0;for(k=1,#v,s+=v[k]);if(#v-s==1,print1(p,", "))) \\ Washington Bomfim, Jan 13 2011

A059673 Sum of binary numbers with n 1's and one (non-leading) 0.

Original entry on oeis.org

0, 2, 11, 38, 109, 284, 699, 1658, 3833, 8696, 19447, 42998, 94197, 204788, 442355, 950258, 2031601, 4325360, 9175023, 19398638, 40894445, 85983212, 180355051, 377487338, 788529129, 1644167144, 3422552039, 7113539558, 14763950053
Offset: 0

Views

Author

Henry Bottomley, Feb 05 2001

Keywords

Comments

For n>0, a(n) = sum of n-th row of the triangle in A164874. [Reinhard Zumkeller, Aug 29 2009]

Examples

			a(4)=109 since the binary sum 11110+11101+11011+10111 is 30+29+27+23.
		

Crossrefs

Cf. A030130, A164874. [From Reinhard Zumkeller, Aug 29 2009]

Programs

  • Maple
    A059673:=n->(2*n-1)*2^n+1-n: seq(A059673(n), n=0..50); # Wesley Ivan Hurt, Apr 24 2017
  • Mathematica
    Table[Total[FromDigits[#,2]&/@Rest[Permutations[PadRight[{0},n,1]]]],{n,30}] (* or *) LinearRecurrence[{6,-13,12,-4},{0,2,11,38},30] (* Harvey P. Dale, May 17 2015 *)
  • PARI
    concat(0, Vec(-x*(2*x^2+x-2)/((x-1)^2*(2*x-1)^2) + O(x^100))) \\ Colin Barker, Sep 14 2014
    
  • Python
    def A059673(n): return ((n<<1)-1<Chai Wah Wu, Dec 19 2024

Formula

a(n) = (2n-1)*2^n+1-n.
G.f.: -x*(2*x^2+x-2) / ((x-1)^2*(2*x-1)^2). - Colin Barker, Sep 14 2014
a(0)=0, a(1)=2, a(2)=11, a(3)=38, a(n)=6*a(n-1)-13*a(n-2)+ 12*a(n-3)- 4*a(n-4). - Harvey P. Dale, May 17 2015. [This is equivalent to the g.f. -x*(2*x^2+x-2) / ((x-1)^2*(2*x-1)^2) given by Colin Barker. - N. J. A. Sloane, May 17 2015]

A160502 Decimal expansion of the (finite) value of Sum_{ k >= 1, k has only a single zero digit in base 2 } 1/k.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, May 15 2009

Keywords

Comments

The sum of 1/n where n has a single 0 in base 2.

Examples

			1.4625907350443646995461454467205346210747448647488211093642006243545229...
		

Crossrefs

Cf. A030130 (numbers with a single zero in base 2), A140502.

Programs

  • Mathematica
    RealDigits[ N[ Sum[1/(2^n - 1 - 2^k), {n, 2, 400}, {k, 0, n - 2}], 111]][[1]]
    (* first install irwinSums.m, see reference, then *) First@ RealDigits@ iSum[0, 1, 111, 2] (* Robert G. Wilson v, Aug 03 2010 *)

Formula

Equals Sum_{n>=2} Sum_{k=0..n-2}, 1/(2^n - 1 - 2^k).

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

A214853 Fibonacci numbers with only one 0 in the binary representation.

Original entry on oeis.org

0, 2, 5, 13, 55
Offset: 1

Views

Author

Alex Ratushnyak, Mar 08 2013

Keywords

Comments

Conjecture: the sequence is finite.
No more terms below 2*10^301. - Matthew House, Sep 06 2015
No more terms below 10^162809483. (This number could easily be raised. Of the Fibonacci numbers less than 2^32 -- i.e., F(0) through F(47) -- F(10)=55 is the largest that has only one 0 in its binary representation, and of those not less than 2^32, the smallest one whose 32 least significant bits include fewer than 2 zero bits is Fibonacci(779038816), which exceeds 10^162809483.) - Jon E. Schoenfield, Sep 07 2015

Examples

			55 is 110111 in binary, thus 55 is in the sequence.
		

Crossrefs

Intersection of A030130 and A000045.

Programs

  • Mathematica
    Select[Fibonacci@ Range[0, 120], Last@ DigitCount[#, 2] == 1 &] (* Michael De Vlieger, Sep 07 2015 *)
  • Python
    def count0(x):
        c = 0
        while x:
            c+= 1 - (x&1)
            if c>1:
                return 2
            x>>=1
        return c
    prpr, prev = 0,1
    TOP = 1<<12
    print(0, end=',')
    for i in range(1,TOP):
        if count0(prpr)==1:
            print(prpr, end=',')
        if (i&4095)==0:
            print('.', end=',')
        prpr, prev = prev, prpr+prev

A255568 Numbers in whose binary representation there are six 1-bits more than there are nonleading 0-bits.

Original entry on oeis.org

63, 191, 223, 239, 247, 251, 253, 254, 639, 703, 735, 751, 759, 763, 765, 766, 831, 863, 879, 887, 891, 893, 894, 927, 943, 951, 955, 957, 958, 975, 983, 987, 989, 990, 999, 1003, 1005, 1006, 1011, 1013, 1014, 1017, 1018, 1020, 2303, 2431, 2495, 2527, 2543, 2551, 2555
Offset: 1

Views

Author

Antti Karttunen, Mar 11 2015

Keywords

Comments

Numbers for which A037861(n) = -6.
Numbers in whose binary representation (A007088) the number of 1-bits = 6 + number of (nonleading) 0 bits.

Examples

			63 ("111111" in binary) is included because there are 0 zero-bits and six 1-bits.
191 ("10111111" in binary) is included because there is 1 zero-bit and seven 1-bits, thus there are six 1-bits more than the number of 0-bits.
		

Crossrefs

The intersection of A030130 and A023689 is a finite subsequence of this sequence.

Programs

Showing 1-10 of 15 results. Next