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

A268289 a(0)=0; thereafter a(n) = a(n-1) - A037861(n).

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 4, 7, 5, 5, 5, 7, 7, 9, 11, 15, 12, 11, 10, 11, 10, 11, 12, 15, 14, 15, 16, 19, 20, 23, 26, 31, 27, 25, 23, 23, 21, 21, 21, 23, 21, 21, 21, 23, 23, 25, 27, 31, 29, 29, 29, 31, 31, 33, 35, 39, 39, 41, 43, 47, 49
Offset: 0

Views

Author

Mark Moore, Jan 30 2016

Keywords

Comments

The graph of this sequence is related to the Takagi (blancmange) curve: see Lagarias (2012), Section 9, especially Theorem 9.1. [Corrected by Laura Monroe, Oct 21 2020]
Theorem: a(n) is the cardinality of the set { 1<= m <= n, ((n-m) mod 2^floor(log_2(m)+1)) < 2^floor(log_2(m)) }. See links.
From Laura Monroe, Jun 11 2020: (Start)
Consider a full balanced binary tree with n unlabeled leaves such that for each internal node, the number of leaf descendants of the two children differs by at most 1. Call a tree with this even distribution of leaves "pairwise".
Apply labels to the internal nodes, where an internal node is labeled S if its two children have the same number of leaf descendants, and D if its two children have a different number of leaf descendants, and call this an SD-tree. (For a pairwise tree, this is equivalent to saying that a node is an S-node iff it has an even number of leaf descendants.)
a(n) is then the number of S-nodes on a pairwise SD-tree with n+1 leaves.
This is proved in Props. 17 and 18 of the Monroe et al. article in the links.
One example of such a tree is the summation tree generated by a pairwise summation on n+1 summands (see example below). Another example is the tree representing a neutral single-elimination tournament on n+1 teams, as in A096351.
(End)
From Laura Monroe, Oct 23 2020: (Start)
Subtracting a(n) from n gives a sequence of dilations of increasing length on the dyadic rational points of the Takagi function. The number of points in each dilation is 2^k and the scale of each dilation in both the x and y directions is 2^k, where k = floor(log_2(n+1)).
2^(a(n)) is the number of tree automorphisms on the pairwise (i.e., divide-and-conquer) tree with n+1 leaves.
(End)

Examples

			From _Laura Monroe_, Jun 11 2020: (Start)
For n=2, the pairwise summation on 2+1=3 summands takes the form ((a+b)+c). The corresponding summation tree and SD-tree look like:
       +            D
      / \          / \
     +   c        S   c
    / \          / \
   a   b        a   b
and exactly 1 internal node has an even number of leaf descendants, hence is an S-node.
For n=3, the pairwise summation on 3+1=4 summands takes the form ((a+b)+(c+d)). The corresponding summation tree and SD-tree look like:
       +            S
      / \          / \
     +   +        S   S
    /|   |\      /|   |\
   a b   c d    a b   c d
and exactly 3 internal nodes have an even number of leaf descendants, hence are S-nodes.
(End)
		

Crossrefs

Programs

  • C
    int a(int n)   {
        int m=n+1;
        int result=0;
        int i=0;
        while (n) {
            int ith_bit_set = m&(1<>= 1;
        }
       return result;
    }
    /* Laura Monroe, Jun 17 2020 */
    
  • Julia
    function A268289List(len)
        A = zeros(Int, len)
        for n in 1:len-1
            a, b, c = n, n & 1, 1
            while (a >>= 1) != 0
                b += a & 1
                c += 1
            end
            A[n+1] = A[n] + <<(b, 1) - c
        end
        A
    end; println(A268289List(61)) # Peter Luschny, Jun 22 2020
  • Maple
    a000120 := proc(n) add(i, i=convert(n, base, 2)) end:
    a023416 := proc(n) if n = 0 then 1; else add(1-e, e=convert(n, base, 2)) ; end if; end proc:
    a268289:=proc(n) option remember; global a000120, a023416;
    if n=0 then 0 else a268289(n-1)+a000120(n)-a023416(n); fi; end;
    [seq(a268289(n),n=0..132)];
    # N. J. A. Sloane, Mar 07 2016
    # second Maple program:
    a:= proc(n) option remember; `if`(n<0, 0,
          a(n-1)+add(2*i-1, i=Bits[Split](n)))
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Jan 18 2022
  • Mathematica
    Join[{0}, Table[DigitCount[n, 2, 1] - DigitCount[n, 2, 0], {n, 1, 100}] // Accumulate] (* Jean-François Alcover, Oct 24 2016 *)
  • PARI
    a(n) = if (n==0, 0, if (n%2, 2*a((n-1)/2)+1, a(n/2) + a(n/2-1))); \\ Michel Marcus, Jun 16 2020
    
  • PARI
    a(n) = my(v=binary(n+1),s=-1); for(i=1,#v, v[i]=if(v[i],s++,s--;1)); fromdigits(v,2); \\ Kevin Ryde, Jun 16 2020
    
  • Python
    def A268289(n): return (sum(i.bit_count() for i in range(1,n+1))<<1)-1-(n+1)*(m:=(n+1).bit_length())+(1<Chai Wah Wu, Mar 01 2023
    
  • Python
    def A268289(n): return sum((n+1)%m if (n+1)&(m:=1<Chai Wah Wu, Nov 11 2024
    

Formula

From N. J. A. Sloane, Mar 11 2016: (Start)
a(0)=0; for n > 0, a(n) = a(n-1) + A000120(n) - A023416(n) = A000788(n) - A181132(n).
a(0)=0; thereafter a(2*n) = a(n) + a(n-1), a(2*n+1) = 2*a(n) + 1.
G.f.: (1/(1-x)^2) * Sum_{k >= 0} x^(2^k)*(1-x^(2^k))/(1+x^(2^k)).
a(2^k-1) = 2^k-1, a(3*2^k-1) = 2^(k+1)-1, a(5*2^k-1) = 3*2^k-1, etc.
(End)
From Laura Monroe, Jun 11 2020: (Start)
a(n-1) = Sum_{i=0..floor(log_2(n))} (((floor(n/(2^i))+1) mod 2)*(2^i)+(-1)^((floor(n/(2^i))+1) mod 2)*(n mod (2^i))), for n>=1.
This is an explicit formula for this sequence, and is O(log(n)). This formula is proven in Prop. 18, in the Monroe et al. reference in the links. (End)
From Laura Monroe, Oct 23 2020: (Start)
a(n) = n - A296062(n).
a(n+1) = (n+1) - (2^k)*tau(x/(2^k)), where tau is the Takagi function and n+1 = (2^k)+x with x < 2^k. (End)

Extensions

Simplified definition following a suggestion from Michel Marcus. Corrected start, added more terms. - N. J. A. Sloane, Mar 07 2016

A110625 Numerator of b(n) = -Sum_{k=1..n} A037861(k)/((2*k)*(2*k+1)), where A037861(k) = (number of 0's) - (number of 1's) in the binary representation of k.

Original entry on oeis.org

1, 1, 3, 101, 5807, 77801, 82949, 170636, 170636, 170636, 363113, 363113, 84848, 710567, 22435781, 3901243741, 27210449083, 1003538672911, 248595095590537, 10165684261926701, 438167567023512863, 439119040574907047
Offset: 1

Views

Author

Jonathan Sondow, Aug 01 2005

Keywords

Comments

Numerators of partial sums of a series for the "alternating Euler constant" log(4/Pi) (see A094640 and Sondow 2005, 2010). Denominators are A110626.

Examples

			a(3) = 3 because b(3) = 1/6 + 0 + 1/21 = 3/14.
The first few fractions b(n) are 1/6, 1/6, 3/14, 101/504, 5807/27720, 77801/360360, 82949/360360, ... = A110625/A110626. - _Petros Hadjicostas_, May 15 2020
		

Crossrefs

Programs

  • PARI
    a(n) = numerator(-sum(k=1, n, (#binary(k) - 2*hammingweight(k))/(2*k*(2*k+1)))); \\ Petros Hadjicostas, May 15 2020

Formula

Lim_{n -> infinity} b(n) = log 4/Pi = 0.24156...

A110626 Denominator of b(n) = -Sum_{k=1..n} A037861(k)/((2*k)*(2*k+1)), where A037861(k) = (number of 0's) - (number of 1's) in the binary representation of k.

Original entry on oeis.org

6, 6, 14, 504, 27720, 360360, 360360, 765765, 765765, 765765, 1601145, 1601145, 369495, 3061530, 94907430, 16703707680, 116925953760, 4326260289120, 1068586291412640, 43812037947918240, 1883917631760484320
Offset: 1

Views

Author

Jonathan Sondow, Aug 01 2005

Keywords

Comments

Denominators of partial sums of a series for the "alternating Euler constant" log(4/Pi) (see A094640 and Sondow 2005, 2010). Numerators are A110625.

Examples

			a(3) = 14 because b(3) = 1/6 + 0 + 1/21 = 3/14.
The first few fractions b(n) are 1/6, 1/6, 3/14, 101/504, 5807/27720, 77801/360360, 82949/360360, ... = A110625/A110626. - _Petros Hadjicostas_, May 15 2020
		

Crossrefs

Programs

  • PARI
    a(n) = denominator(-sum(k=1, n, (#binary(k) - 2*hammingweight(k))/(2*k*(2*k+1))));\\ Petros Hadjicostas, May 15 2020

Formula

Lim_{n -> infinity} b(n) = log 4/Pi = 0.24156...

A214923 Total count of 1's in binary representation of Fibonacci(n) and previous Fibonacci numbers, minus total count of 0's. That is, partial sums of b(n) = -A037861(Fibonacci(n)).

Original entry on oeis.org

-1, 0, 1, 1, 3, 4, 2, 4, 5, 3, 7, 8, 4, 6, 9, 7, 13, 16, 12, 9, 12, 10, 11, 18, 14, 9, 10, 14, 17, 22, 18, 19, 15, 19, 20, 18, 18, 21, 15, 13, 18, 24, 24, 27, 33, 32, 43, 37, 28, 31, 33, 32, 31, 29, 24, 30, 34, 27, 35, 35, 26, 22, 32, 35, 31, 37, 30, 36, 19, 18
Offset: 0

Views

Author

Alex Ratushnyak, Jul 29 2012

Keywords

Comments

b(n) = -A037861(Fibonacci(n)) begins: -1, 1, 1, 0, 2, 1, -2, 2, 1, -2, 4, 1, -4, 2, 3, -2, 6, 3, -4, -3, 3, -2, 1, 7, -4, -5, 1, 4, 3, 5, -4, 1, -4, 4, 1, -2, 0. For example b(6) = -A037861(Fibonacci(6)) = -A037861(8) = -2.
Conjecture: a(n) contains infinitely many positive and infinitely many negative terms.

Crossrefs

Programs

  • Java
    import static java.lang.System.out;
    import java.math.BigInteger;
    public class A214923 {
      public static void main (String[] args) {       // 51 minutes
        BigInteger prpr = BigInteger.valueOf(0);
        BigInteger prev = BigInteger.valueOf(1), curr;
        long n, c0=1, c1, sum=0, count0=0, countPos=0, countNeg=0, max=0, min=0, maxAt=0, minAt=0;
        for (n=0; n<10000000; ++n) {
          c1 = prpr.bitCount();
          if (n>0)
            c0 = prpr.bitLength() - c1;
          sum += c1-c0;
          out.printf("%d, ", sum);
          if (sum>0) ++countPos; else
          if (sum<0) ++countNeg; else
                     ++count0;
          if (sum>max) { max=sum; maxAt=n; }
          if (sum
    				
  • Mathematica
    Accumulate[Table[f = Fibonacci[n]; Count[IntegerDigits[f, 2], 1] - Count[IntegerDigits[f, 2], 0], {n, 0, 100}]] (* T. D. Noe, Jul 30 2012 *)

A145015 Run lengths in A037861 having the same sign.

Original entry on oeis.org

1, 3, 1, 3, 3, 5, 3, 1, 1, 3, 1, 7, 7, 1, 3, 5, 3, 13, 7, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 7, 3, 1, 1, 3, 1, 7, 1, 15, 15, 1, 7, 1, 3, 5, 7, 1, 3, 5, 3, 13, 7, 1, 3, 5, 3, 13, 3, 29, 15, 1, 7, 1, 3, 1, 1, 3, 7, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 7, 7, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 7, 3, 1, 1, 3, 1, 7, 1, 15, 7, 1
Offset: 0

Views

Author

Denis Boigelot (dboigelo(AT)ulb.ac.be), Sep 29 2008

Keywords

Comments

a(n) seems (conjecture) to contain only the numbers 2^n - 1 (for n>=1) and 2^n - 3 (for n>=3)

Examples

			A037861 is: 1,-1,0,-2,1,-1,-1,-3,2,0,0,-2,0,-2,-2,-4,3, ... so sign is +,-,0,-,+,-,-,-,+,0,0,-,0,-,-,-,+, ... thus sequence is 1,3,1,3,3,5, ...
		

Crossrefs

Cf. A037861.

A177681 Primes p such that abs(A037861(p)) is a prime number.

Original entry on oeis.org

3, 7, 11, 13, 23, 29, 31, 43, 53, 79, 103, 107, 109, 127, 131, 137, 151, 157, 167, 173, 179, 181, 193, 199, 211, 227, 229, 233, 241, 257, 311, 317, 347, 349, 359, 367, 373, 379, 383, 431, 439, 443, 461, 463, 467, 479, 487, 491, 499, 503, 509, 523, 547, 571
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 14 2010

Keywords

Crossrefs

Extensions

Entries checked, keyword:base,less added and incorrect comment removed by R. J. Mathar, May 18 2010

A031443 Digitally balanced numbers: positive numbers that in base 2 have the same number of 0's as 1's.

Original entry on oeis.org

2, 9, 10, 12, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 163, 165, 166, 169, 170, 172, 177, 178, 180, 184, 195, 197, 198, 201, 202, 204, 209, 210, 212, 216, 225, 226, 228, 232, 240, 527, 535, 539, 541, 542, 551
Offset: 1

Views

Author

Keywords

Comments

Also numbers k such that the binary digital mean dm(2, k) = (Sum_{i=1..d} 2*d_i - 1) / (2*d) = 0, where d is the number of digits in the binary representation of k and d_i the individual digits. - Reikku Kulon, Sep 21 2008
From Reikku Kulon, Sep 29 2008: (Start)
Each run of values begins with 2^(2k + 1) + 2^(k + 1) - 2^k - 1. The initial values increase according to the sequence {2^(k - 1), 2^(k - 2), 2^(k - 3), ..., 2^(k - k)}.
After this, the values follow a periodic sequence of increases by successive powers of two with single odd values interspersed.
Each run ends with an odd increase followed by increases of {2^(k - k), ..., 2^(k - 2), 2^(k - 1), 2^k}, finally reaching 2^(2k + 2) - 2^(k + 1).
Similar behavior occurs in other bases. (End)
Numbers k such that A000120(k)/A070939(k) = 1/2. - Ctibor O. Zizka, Oct 15 2008
Subsequence of A053754; A179888 is a subsequence. - Reinhard Zumkeller, Jul 31 2010
A000120(a(n)) = A023416(a(n)); A037861(a(n)) = 0.
A001700 gives number of terms having length 2*n in binary representation: A001700(n-1) = #{m: A070939(a(m))=2*n}. - Reinhard Zumkeller, Jun 08 2011
The number of terms below 2^k is A079309(floor(k/2)) for k > 1. - Amiram Eldar, Nov 21 2020

Examples

			9 is a term because '1001' contains 2 '0's and 2 '1's.
		

Crossrefs

Subsequence of A053754.
Row n = 2 of A378000.
Terms of binary width n are enumerated by A001700.

Programs

  • Haskell
    -- See link, showing that Ulrich Schimkes formula provides a very efficient algorithm. Reinhard Zumkeller, Jun 15 2011
    
  • Magma
    [ n: n in [2..250] | Multiplicity({* z: z in Intseq(n,2) *}, 0) eq &+Intseq(n,2) ];  // Bruno Berselli, Jun 07 2011
    
  • Maple
    a:=proc(n) local nn, n1, n0: nn:=convert(n,base,2): n1:=add(nn[i],i=1..nops(nn)): n0:=nops(nn)-n1: if n0=n1 then n else end if end proc: seq(a(n), n = 1..240); # Emeric Deutsch, Jul 31 2008
  • Mathematica
    Select[Range[250],DigitCount[#,2,1]==DigitCount[#,2,0]&] (* Harvey P. Dale, Jul 22 2013 *)
    FromDigits[#,2]&/@DeleteCases[Flatten[Permutations/@Table[PadRight[{},2n,{1,0}],{n,5}],1],?(#[[1]]==0&)]//Sort (* _Harvey P. Dale, May 30 2016 *)
  • PARI
    for(n=1,100,b=binary(n); l=length(b); if(sum(i=1,l, component(b,i))==l/2,print1(n,",")))
    
  • PARI
    is(n)=hammingweight(n)==hammingweight(bitneg(n,#binary(n))) \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    is(n)=2*hammingweight(n)==exponent(n)+1 \\ Charles R Greathouse IV, Apr 18 2020
    
  • Perl
    for my $half ( 1 .. 4 ) {
      my $N = 2 * $half;  # only even widths apply
      my $vector = (1 << ($N-1)) | ((1 << ($N/2-1)) - 1);  # first key
      my $n = 1; $n *= $_ for 2 .. $N;    # N!
      my $d = 1; $d *= $_ for 2 .. $N/2;  # (N/2)!
      for (1 .. $n/($d*$d*2)) {
        print "$vector, ";
        my ($v, $d) = ($vector, 0);
        until ($v & 1 or !$v) { $d = ($d << 1)|1; $v >>= 1 }
        $vector += $d + 1 + (($v ^ ($v + 1)) >> 2);  # next key
      }
    } # Ruud H.G. van Tol, Mar 30 2014
    
  • Python
    from sympy.utilities.iterables import multiset_permutations
    A031443_list = [int('1'+''.join(p),2) for n in range(1,10) for p in multiset_permutations('0'*n+'1'*(n-1))] # Chai Wah Wu, Nov 15 2019

Formula

a(n+1) = a(n) + 2^k + 2^(m-1) - 1 + floor((2^(k+m) - 2^k)/a(n))*(2^(2*m) + 2^(m-1)) where k is the largest integer such that 2^k divides a(n) and m is the largest integer such that 2^m divides a(n)/2^k+1. - Ulrich Schimke (UlrSchimke(AT)aol.com)
A145037(a(n)) = 0. - Reikku Kulon, Oct 02 2008

A145037 Number of 1's minus number of 0's in the binary representation of n.

Original entry on oeis.org

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

Views

Author

Reikku Kulon, Sep 30 2008

Keywords

Comments

Column 2 of A144912 (which begins at n = 2).
Zeros in that column correspond to A031443.

Examples

			From _Michel Marcus_, Feb 12 2022: (Start)
Viewed as an irregular triangle:
   0;
   1;
   0,  2;
  -1,  1,  1, 3;
  -2,  0,  0, 2,  0, 2, 2, 4;
  -3, -1, -1, 1, -1, 1, 1, 3, -1, 1, 1, 3, 1, 3, 3, 5;
  ... (End)
		

Crossrefs

Cf. A037861 (negated), A031443 (indices of 0's), A144912, A000120.
Cf. A269735 (first differences), A268289 (partial sums).
Column k=1 of A360099.

Programs

  • Haskell
    a145037 0 = 0
    a145037 n = a145037 n' + 2*m - 1 where (n', m) = divMod n 2
    -- Reinhard Zumkeller, Jun 16 2011
    
  • Maple
    a:= n-> add(2*i-1, i=Bits[Split](n)):
    seq(a(n), n=0..90);  # Alois P. Heinz, Jan 18 2022
  • Mathematica
    Join[{0}, Table[Count[#, 1] - Count[#, 0] &[IntegerDigits[n, 2]], {n, 1, 90}]] (* Robert P. P. McKone, Feb 12 2022 *)
  • PARI
    A145037(n)=hammingweight(n)*2-logint(n<<1+!n,2) \\ M. F. Hasler, Mar 08 2018
    
  • Python
    result = [0]
    for n in range (1, 2**14 + 1):
        result.append(bin(n)[2:].count("1") - bin(n)[2:].count("0"))
    print(result[0:129]) # Karl-Heinz Hofmann, Jan 18 2022
    
  • Python
    def a(n): return (n.bit_count()<<1) - n.bit_length()
    print([a(n) for n in range(1, 2**14+1)]) # Michael S. Branicky, May 14 2024
    (C#)
    int A145037(int n)  {
        int result = 0;
        while(n > 0)  {
            result += 2 * (n % 2) - 1;
            n /= 2;
        }
        return result;
    } \\ Frank Hollstein, Dec 08 2022

Formula

a(n) = -A037861(n) for n >= 1.
a(n) = Sum_{i=1..k} (2*b[i] - 1) where b is the binary expansion of n and k is the number of bits in this binary expansion. - Michel Marcus, Jun 28 2021
From Aayush Soni Feb 12 2022: (Start)
Upper bound: a(n) <= floor(log_2(n+1)).
Lower bound: For n > 0, a(n) >= 1 - floor(log_2(n)).
If n is even, a(2^n) to a(2^(n+1)-1) inclusive are all odd and vice versa. (End)

Extensions

Renamed (using a Mar 08 2018 comment from M. F. Hasler) and edited by Jon E. Schoenfield, Jun 29 2021

A049354 Digitally balanced numbers in base 3: equal numbers of 0's, 1's, 2's.

Original entry on oeis.org

11, 15, 19, 21, 260, 266, 268, 278, 290, 294, 302, 304, 308, 312, 316, 318, 332, 344, 348, 380, 384, 396, 410, 412, 416, 420, 424, 426, 434, 438, 450, 460, 462, 468, 500, 502, 508, 518, 520, 524, 528, 532, 534, 544, 550, 552, 572, 574, 578, 582, 586, 588, 596
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049354-A049360. See also A061854, A037861.
Row n = 3 of A378000.

Programs

  • Haskell
    a049354 n = a049354_list !! (n-1)
    a049354_list = filter f [1..] where
       f n = t0 == a062756 n && t0 == a081603 n where t0 = a077267 n
    -- Reinhard Zumkeller, Aug 09 2014
    
  • Mathematica
    Select[Range[600],Length[Union[DigitCount[#,3]]]== 1&]
    FromDigits[#,3]&/@DeleteCases[Flatten[Permutations/@Table[PadRight[{},3n,{1,0,2}],{n,3}],1],?(#[[1]]==0&)]//Sort (* _Harvey P. Dale, May 30 2016 *)
    Select[Range@5000, Differences@DigitCount[#,3]=={0,0}&] (* Hans Rudolf Widmer, Dec 11 2021 *)
  • Python
    from sympy.ntheory import count_digits
    def ok(n): c = count_digits(n, 3); return c[0] == c[1] == c[2]
    print([k for k in range(600) if ok(k)]) # Michael S. Branicky, Nov 15 2021

Formula

A062756(a(n)) = A077267(a(n)) and A081603(a(n)) = A077267(a(n)). - Reinhard Zumkeller, Aug 09 2014

A031448 Numbers whose base-2 representation has one fewer 0's than 1's.

Original entry on oeis.org

1, 5, 6, 19, 21, 22, 25, 26, 28, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 271, 279, 283, 285, 286, 295, 299, 301, 302, 307, 309, 310, 313, 314, 316, 327, 331, 333, 334, 339, 341, 342
Offset: 1

Views

Author

Keywords

Comments

A037861(a(n)) = -1. - Reinhard Zumkeller, Mar 31 2015
The viabin numbers of the integer partitions in which the number of parts is equal to the largest part (for the definition of viabin number see comment in A290253). For example, 99 is in the sequence because it is the viabin number of the integer partition [4,2,2,2]. - Emeric Deutsch, Aug 29 2017

Examples

			99 is in the sequence because its binary form is 1100011. - _Emeric Deutsch_, Aug 29 2017
		

Crossrefs

Cf. A007088, A023416, A000120, A031444, subsequence of A089648.

Programs

  • Haskell
    a031448 n = a031448_list !! (n-1)
    a031448_list = filter ((== -1) . a037861) [1..]
    -- Reinhard Zumkeller, Mar 31 2015
  • Maple
    vitopart := proc (n) local L, i, j, N, p, t: N := 2*n; L := ListTools:-Reverse(convert(N, base, 2)): j := 0: for i to nops(L) do if L[i] = 0 then j := j+1: p[j] := numboccur(L[1 .. i], 1) end if end do: sort([seq(p[t], t = 1 .. j)], `>=`) end proc: A := {}; for m to 500 do if nops(vitopart(m)) = max(vitopart(m)) then A := `union`(A, {m}) else  end if end do: A; # program is based on my comment; the command vitopart(n) yields the integer partition having viabin number n. - Emeric Deutsch, Aug 29 2017
  • Mathematica
    Select[Range[400],DigitCount[#,2,1]==DigitCount[#,2,0]+1&] (* Harvey P. Dale, May 24 2019 *)
Showing 1-10 of 43 results. Next