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.

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

This page as a plain text file.
%I A089633 #92 Dec 19 2024 20:54:52
%S A089633 0,1,2,3,5,6,7,11,13,14,15,23,27,29,30,31,47,55,59,61,62,63,95,111,
%T A089633 119,123,125,126,127,191,223,239,247,251,253,254,255,383,447,479,495,
%U A089633 503,507,509,510,511,767,895,959,991,1007,1015,1019,1021,1022,1023
%N A089633 Numbers having no more than one 0 in their binary representation.
%C A089633 Complement of A158582. - _Reinhard Zumkeller_, Apr 16 2009
%C A089633 Also union of A168604 and A030130. - _Douglas Latimer_, Jul 19 2012
%C A089633 Numbers of the form 2^t - 2^k - 1, 0 <= k < t.
%C A089633 n is in the sequence if and only if 2*n+1 is in the sequence. - _Robert Israel_, Dec 14 2018
%C A089633 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
%H A089633 Reinhard Zumkeller, <a href="/A089633/b089633.txt">Table of n, a(n) for n = 0..10000</a>
%H A089633 Vladimir Shevelev, <a href="https://arxiv.org/abs/0801.0072">On the Basis Polynomials in the Theory of Permutations with Prescribed Up-Down Structure</a>, arXiv:0801.0072 [math.CO], 2007-201. See Section 14.
%H A089633 Vladimir Shevelev, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL14/Shevelev/shevelev14.html">Binomial Coefficient Predictors</a>, Journal of Integer Sequences, Vol. 14 (2011), Article 11.2.8.
%H A089633 Vladimir Shevelev, <a href="http://www.emis.de/journals/INTEGERS/papers/m1/m1.Abstract.html">The number of permutations with prescribed up-down structure as a function of two variables</a>, INTEGERS, 12 (2012), #A1.
%H A089633 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>.
%F A089633 A023416(a(n)) <= 1; A023416(a(n)) = A023532(n-2) for n>1;
%F A089633 A000120(a(u)) <= A000120(a(v)) for u<v; A000120(a(n)) = A003056(n).
%F A089633 a(0)=0, n>0: a(n+1) = Min{m>n: BinOnes(a(n))<=BinOnes(m)} with BinOnes=A000120.
%F A089633 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
%F A089633 A029931(a(n)) = n and A029931(m) != n for m < a(n). - _Reinhard Zumkeller_, Feb 28 2014
%F A089633 A265705(a(n),k) = A265705(a(n),a(n)-k), k = 0 .. a(n). - _Reinhard Zumkeller_, Dec 15 2015
%F A089633 a(A014132(n)-1) = 2*a(n-1)+1 for n >= 1. - _Robert Israel_, Dec 14 2018
%F A089633 Sum_{n>=1} 1/a(n) = A065442 + A160502 = 3.069285887459... . - _Amiram Eldar_, Jan 09 2024
%F A089633 A019565(a(n)) = A077011(n). - _Gus Wiseman_, May 24 2024
%e A089633 From _Tilman Piesk_, May 09 2012: (Start)
%e A089633 This may also be viewed as a triangle:             In binary:
%e A089633                   0                                         0
%e A089633                1     2                                 01       10
%e A089633              3    5    6                          011      101      110
%e A089633            7   11   13   14                  0111     1011     1101     1110
%e A089633         15   23   27   29   30          01111    10111    11011    11101    11110
%e A089633       31  47   55   59   61   62
%e A089633    63   95  111  119  123  125  126
%e A089633 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)
%e A089633 From _Gus Wiseman_, May 24 2024: (Start)
%e A089633 The terms together with their binary expansions and binary indices begin:
%e A089633    0:      0 ~ {}
%e A089633    1:      1 ~ {1}
%e A089633    2:     10 ~ {2}
%e A089633    3:     11 ~ {1,2}
%e A089633    5:    101 ~ {1,3}
%e A089633    6:    110 ~ {2,3}
%e A089633    7:    111 ~ {1,2,3}
%e A089633   11:   1011 ~ {1,2,4}
%e A089633   13:   1101 ~ {1,3,4}
%e A089633   14:   1110 ~ {2,3,4}
%e A089633   15:   1111 ~ {1,2,3,4}
%e A089633   23:  10111 ~ {1,2,3,5}
%e A089633   27:  11011 ~ {1,2,4,5}
%e A089633   29:  11101 ~ {1,3,4,5}
%e A089633   30:  11110 ~ {2,3,4,5}
%e A089633   31:  11111 ~ {1,2,3,4,5}
%e A089633   47: 101111 ~ {1,2,3,4,6}
%e A089633   55: 110111 ~ {1,2,3,5,6}
%e A089633   59: 111011 ~ {1,2,4,5,6}
%e A089633   61: 111101 ~ {1,3,4,5,6}
%e A089633   62: 111110 ~ {2,3,4,5,6}
%e A089633 (End)
%p A089633 seq(seq(2^a-1-2^b,b=a-1..0,-1),a=1..11); # _Robert Israel_, Dec 14 2018
%t A089633 fQ[n_] := DigitCount[n, 2, 0] < 2; Select[ Range[0, 2^10], fQ] (* _Robert G. Wilson v_, Aug 02 2012 *)
%o A089633 (Haskell)
%o A089633 a089633 n = a089633_list !! (n-1)
%o A089633 a089633_list = [2 ^ t - 2 ^ k - 1 | t <- [1..], k <- [t-1,t-2..0]]
%o A089633 -- _Reinhard Zumkeller_, Feb 23 2012
%o A089633 (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)}
%o A089633 {for(w=0,1536,if(insq(w)>=0,print1(w,", ")))}
%o A089633 \\ _Douglas Latimer_, May 07 2013
%o A089633 (PARI) isoka(n) = #select(x->(x==0), binary(n)) <= 1; \\ _Michel Marcus_, Dec 14 2018
%o A089633 (Python)
%o A089633 from itertools import count, islice
%o A089633 def A089633_gen(): # generator of terms
%o A089633     return ((1<<t)-(1<<k)-1 for t in count(1) for k in range(t-1,-1,-1))
%o A089633 A089633_list = list(islice(A089633_gen(),30)) # _Chai Wah Wu_, Feb 10 2023
%o A089633 (Python)
%o A089633 from math import isqrt, comb
%o A089633 def A089633(n): return (1<<(a:=(isqrt((n<<3)+1)-1>>1)+1))-(1<<comb(a,2)+a-1-n)-1 # _Chai Wah Wu_, Dec 19 2024
%Y A089633 Cf. A000120, A007088, A011371, A014132, A023416, A023532, A029931.
%Y A089633 Cf. A181741 (primes), union of A081118 and A000918, apart from initial -1.
%Y A089633 Cf. A065442, A160502, A265705.
%Y A089633 For least binary index (instead of rank) we have A001511.
%Y A089633 Applying A019565 (Heinz number of binary indices) gives A077011.
%Y A089633 For greatest binary index we have A029837 or A070939, opposite A070940.
%Y A089633 Row minima of A118462 (binary ranks of strict partitions).
%Y A089633 For sum instead of minimum we have A372888, non-strict A372890.
%Y A089633 A000009 counts strict partitions, ranks A005117.
%Y A089633 A048675 gives binary rank of prime indices, distinct A087207.
%Y A089633 A048793 lists binary indices, product A096111, reverse A272020.
%Y A089633 A277905 groups all positive integers by binary rank of prime indices.
%Y A089633 Cf. A000041, A005940, A018819, A147655, A225620, A246868.
%K A089633 nonn,base
%O A089633 0,3
%A A089633 _Reinhard Zumkeller_, Jan 01 2004