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

A296349 Position where binary expansion of n starts in the binary Champernowne sequence A030190.

Original entry on oeis.org

0, 1, 2, 4, 6, 9, 12, 15, 18, 22, 26, 30, 34, 38, 42, 46, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 136, 142, 148, 154, 160, 166, 172, 178, 184, 190, 196, 202, 208, 214, 220, 226, 232, 238, 244, 250, 256, 262, 268, 274, 280, 286, 292
Offset: 0

Views

Author

N. J. A. Sloane, Dec 16 2017

Keywords

Examples

			A030190 begins as follows (the bits are indexed starting at 0):
0,
1,
1, 0,
1, 1,
1, 0, 0,
1, 0, 1,
1, 1, 0,
1, 1, 1,
1, 0, 0, 0,
1, 0, 0, 1,
1, 0, 1, 0,
1, 0, 1, 1,
1, 1, 0, 0,
1, 1, 0, 1,
1, 1, 1, 0,
1, 1, 1, 1,
1, 0, 0, 0, 0,
1, 0, 0, 0, 1,
...
4 = 1,0,0 begins at the 6th bit, so a(4)=6; 5 = 1,0,1 begins at the 9th bit, so a(5)=9.
		

Crossrefs

This is A083652 prefixed by an initial 0.
A296354 is closely related.
Essentially partial sums of A070939.

A301336 a(n) = total number of 1's minus total number of 0's in binary expansions of 0, ..., n.

Original entry on oeis.org

-1, 0, 0, 2, 1, 2, 3, 6, 4, 4, 4, 6, 6, 8, 10, 14, 11, 10, 9, 10, 9, 10, 11, 14, 13, 14, 15, 18, 19, 22, 25, 30, 26, 24, 22, 22, 20, 20, 20, 22, 20, 20, 20, 22, 22, 24, 26, 30, 28, 28, 28, 30, 30, 32, 34, 38, 38, 40, 42, 46, 48, 52, 56, 62, 57, 54, 51, 50, 47, 46, 45, 46, 43, 42, 41, 42
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 28 2018

Keywords

Examples

			+---+-----+---+---+---+---+------------+
| n | bin.|1's|sum|0's|sum|    a(n)    |
+---+-----+---+---+---+---+------------+
| 0 |   0 | 0 | 0 | 1 | 1 | 0 - 1 =-1  |
| 1 |   1 | 1 | 1 | 0 | 1 | 1 - 1 = 0  |
| 2 |  10 | 1 | 2 | 1 | 2 | 2 - 2 = 0  |
| 3 |  11 | 2 | 4 | 0 | 2 | 4 - 2 = 2  |
| 4 | 100 | 1 | 5 | 2 | 4 | 5 - 4 = 1  |
| 5 | 101 | 2 | 7 | 1 | 5 | 7 - 5 = 2  |
| 6 | 110 | 2 | 9 | 1 | 6 | 9 - 6 = 3  |
+---+-----+---+---+---+---+------------+
bin. - n written in base 2;
1's - number of 1's in binary expansion of n;
0's - number of 0's in binary expansion of n;
sum - total number of 1's (or 0's) in binary expansions of 0, ..., n.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, -1,
          a(n-1)+add(2*i-1, i=Bits[Split](n)))
        end:
    seq(a(n), n=0..75);  # Alois P. Heinz, Nov 11 2024
  • Mathematica
    Accumulate[DigitCount[Range[0, 75], 2, 1] - DigitCount[Range[0, 75], 2, 0]]
  • Python
    def A301336(n):
        return sum(2*bin(i).count('1')-len(bin(i))+2 for i in range(n+1)) # Chai Wah Wu, Sep 03 2020
    
  • Python
    def A301336(n): return (n+1)*((n.bit_count()<<1)-(t:=(n+1).bit_length()))+(1<>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,n.bit_length()+1))-2 # Chai Wah Wu, Nov 11 2024

Formula

G.f.: -1/(1 - x) + (1/(1 - x)^2)*Sum_{k>=0} x^(2^k)*(1 - x^(2^k))/(1 + x^(2^k)).
a(n) = A000788(n) - A059015(n).
a(n) = A268289(n) - 1.
a(A000079(n)) = A000295(n).

A295513 a(n) = n*bil(n) - 2^bil(n) where bil(0) = 0 and bil(n) = floor(log_2(n)) + 1 for n>0.

Original entry on oeis.org

-1, -1, 0, 2, 4, 7, 10, 13, 16, 20, 24, 28, 32, 36, 40, 44, 48, 53, 58, 63, 68, 73, 78, 83, 88, 93, 98, 103, 108, 113, 118, 123, 128, 134, 140, 146, 152, 158, 164, 170, 176, 182, 188, 194, 200, 206, 212, 218, 224, 230, 236, 242, 248, 254, 260, 266, 272, 278
Offset: 0

Views

Author

Peter Luschny, Dec 02 2017

Keywords

Crossrefs

Programs

  • Maple
    A295513 := proc(n) local i, s, z; s := -1; i := n-1; z := 1;
    while 0 <= i do s := s+i; i := i-z; z := z+z od; s end:
    seq(A295513(n), n=0..57);
  • Mathematica
    a[n_] := n IntegerLength[n, 2] - 2^IntegerLength[n, 2];
    Table[a[n], {n, 0, 58}]
  • Python
    def A295513(n): return n*(m:=(n-1).bit_length())-(1<Chai Wah Wu, Mar 29 2023

Formula

A001855(n) = a(n) + 1.
A033156(n) = a(n) + 2n.
A003314(n) = a(n) + n.
A083652(n) = a(n+1) + 2.
A061168(n) = a(n+1) - n + 1.
A123753(n) = a(n+1) + n + 2.
A097383(n) = a(n+1) - div(n-1, 2).
A054248(n) = a(n) + n + rem(n, 2).

A382115 a(n) is the smallest positive number not already used and whose binary expansion occurs, ending at position n, in the binary Champernowne word.

Original entry on oeis.org

1, 3, 2, 5, 11, 7, 6, 4, 9, 18, 37, 75, 23, 14, 13, 27, 55, 15, 30, 12, 8, 17, 34, 68, 137, 19, 38, 77, 10, 21, 42, 85, 43, 87, 47, 94, 28, 25, 51, 102, 205, 155, 311, 111, 222, 29, 59, 119, 239, 31, 62, 60, 24, 16, 33, 66, 132, 264, 529, 35, 70, 140, 281, 50
Offset: 1

Views

Author

Ruud H.G. van Tol, Mar 16 2025

Keywords

Comments

In other words, distinct positive numbers in base-10 from the digits n-k to n from the juxtaposition of the positive binary numbers, with k >= 0 minimal.
This sequence is a permutation of the natural numbers.

Examples

			From the juxtaposition 1.10.11.100.101.110.111.1000..., a(1) uses digits 1 to 1, a(2) uses digits 1 to 2, a(3) uses digits 2 to 3 and a(4) uses digits 2 to 4.
Juxtaposed numbers in binary, and positions within them, begin
  n = 1  2 3  4 5  6 7 8  ...
      1  1 0  1 1  1 0 0  ...
                \----/
For n=7, binary 10 = 2 ends at n=7 but has already appeared at a(3)=2, and the next smallest binary 110 = 6 has not yet appeared so a(7) = 6.
		

Crossrefs

Programs

  • PARI
    lista(n)= my(b=List(), i=0, s=0, m=Map(Mat([0, 0])), r=vector(n)); while(s
    				
  • Python
    from itertools import count, islice
    def bgen(): # generates concatenation of binary of digits of 1..oo
        yield from (b for i in count(1) for b in bin(i)[2:])
    def agen(): # generator of terms
        aset, s, g = set(), "", bgen()
        for n in count(1):
            s += next(g)
            an = next(i for k in range(1, n+1) if (i:=int(s[-k:], 2)) not in aset and i > 0)
            yield an
            aset.add(an)
    print(list(islice(agen(), 64))) # Michael S. Branicky, Mar 16 2025

A214936 a(0) = 1, a(n) = a(n - 1) * (length of binary representation of n).

Original entry on oeis.org

1, 1, 2, 4, 12, 36, 108, 324, 1296, 5184, 20736, 82944, 331776, 1327104, 5308416, 21233664, 106168320, 530841600, 2654208000, 13271040000, 66355200000, 331776000000, 1658880000000, 8294400000000, 41472000000000, 207360000000000, 1036800000000000, 5184000000000000
Offset: 0

Views

Author

Alex Ratushnyak, Jul 29 2012

Keywords

Examples

			a(4) = 12 because a(3) = 4 and 4 in binary is 100 (3 bits), and thus 4 * 3 = 12.
		

Crossrefs

Cf. A070939.
Cf. A083652: a(0)=1, for n>0: a(n)=a(n-1)+A070939(n).

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,a*IntegerLength[n+1,2]}; Transpose[NestList[nxt,{0,1},30]][[2]] (* Harvey P. Dale, Oct 11 2015 *)
  • Python
    t = 1
    for n in range(1,33):
        print(t, end=', ')
        t *= len(bin(n))-2

Formula

a(0) = 1, for n > 0: a(n) = a(n - 1) * (Length of binary representation of n) = a(n - 1) * A070939(n).

A280724 Expansion of 1/(1 - x) + (1/(1 - x)^2)*Sum_{k>=0} x^(3^k).

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 11, 13, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 07 2017

Keywords

Comments

Sums of lengths of ternary numbers (A007089).

Examples

			-----------------------
n  base 3 length  a(n)
-----------------------
0 |  0   |  1   |  1
1 |  1   |  1   |  2
2 |  2   |  1   |  3
3 |  10  |  2   |  5
4 |  11  |  2   |  7
5 |  12  |  2   |  9
6 |  20  |  2   |  11
7 |  21  |  2   |  13
8 |  22  |  2   |  15
9 |  100 |  3   |  18
-----------------------
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[1/(1 - x) + (1/(1 - x)^2) Sum[x^3^k, {k, 0, 15}], {x, 0, 70}], x]
    Table[1 + Sum[Floor[Log[3, k]] + 1, {k, 1, n}], {n, 0, 70}]

Formula

G.f.: 1/(1 - x) + (1/(1 - x)^2)*Sum_{k>=0} x^(3^k).
a(n) = 1 + Sum_{k=1..n} floor(log_3(k)) + 1.

A299404 a(n) = 1 + Sum_{m >= 1} (m + 1)^n/2^(m - 1).

Original entry on oeis.org

3, 7, 23, 103, 599, 4327, 37463, 378343, 4366679, 56698087, 817980503, 12981060583, 224732540759, 4214866787047, 85130743763543, 1842265527822823, 42525237455850839, 1042966136233087207, 27084277306054762583, 742412698554627289063, 21421502369955073624919
Offset: 0

Views

Author

Joseph Wheat, Feb 20 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Table[1 + LerchPhi[1/2, -n, 2], {n, 0, 20}] (* Vaclav Kotesovec, Apr 17 2018 *)
  • PARI
    a(n) = 1+ round(suminf(m=1, (m + 1)^n/2^(m - 1)));

Formula

a(n + 1) = 4*A162509(n + 1) + a(n).
a(n) = 2*A007047(n) + 1.
{a(4n - 3), a(4n - 2), a(4n - 1), a(4n)} mod 10 = {7, 3, 3, 9} for n > 0.
floor(log_2(a(n))) = A083652(n).
Lim_{n->infinity} (a(n)^(1/n))/n = 1/(e*log(2)). - Jon E. Schoenfield, Feb 24 2018
a(n)/n! ~ 4 / (log(2))^(n+1). - Vaclav Kotesovec, Apr 17 2018
Previous Showing 11-17 of 17 results.