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 41-47 of 47 results.

A102676 Number of digits >= 5 in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 36, 38, 40, 41, 42, 43, 44, 45, 47, 49, 51, 53, 55, 56, 57, 58, 59, 60, 62
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of digits >= 5 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

References

  • Curtis Cooper, Number of large digits in the positive integers not exceeding n, Abstracts Amer. Math. Soc., 25 (No. 1, 2004), p. 38, Abstract 993-11-964.

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=5 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i),i=0..n), n=0..83); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Accumulate[Table[Total[Take[DigitCount[n],{5,9}]],{n,0,80}]] (* Harvey P. Dale, Apr 27 2015 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 1/2)*(2n + 2 - floor(n/10^j + 1/2)*10^j - floor(n/10^j)*(2n + 2 - (1+floor(n/10^j))*10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*A102675(n) + (1/2)*Sum_{j=1..m+1} (floor(n/10^j)*10^j - (floor(n/10^j + 1/2)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m-1) = 5*m*10^(m-1).
(This is the total number of digits >= 5 occurring in all the numbers with <= m places.)
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(5*10^j) - x^(10*10^j))/(1-x^10^(j+1)).
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} x^(5*10^j)/(1+x^(5*10^j)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102678 Number of digits >= 6 in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 36, 38, 39, 40, 41, 42, 43, 44, 46, 48
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of digits >= 6 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Partial sums of A102677.
Cf. A000120, A000788, A023416, A059015 (for base 2).

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=6 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i),i=0..n), n=0..86); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 2/5)*(2n + 2 - (1/5 + floor(n/10^j + 2/5))*10^j) - floor(n/10^j)*(2n + 2 - (1+floor(n/10^j)) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*A102677(n) + (1/2)*Sum_{j=1..m+1} ((-1/5*floor(n/10^j + 2/5) + floor(n/10^j))*10^j - (floor(n/10^j + 2/5)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m-1) = 4*m*10^(m-1).
(this is total number of digits >= 6 occurring in all the numbers with <= m places).
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(6*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005
An incorrect g.f. was deleted by N. J. A. Sloane, Sep 16 2009

A102680 Number of digits >= 7 in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of digits >= 7 occurring in all the numbers 0, 1, 2, ..., n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Partial sums of A102679.
Cf. A000120, A000788, A023416, A059015 (for base 2).

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=7 then ct:=ct+1 else ct:=ct fi od: ct: end:
    seq(add(p(i),i=0..n), n=0..90);
    # Emeric Deutsch
  • Mathematica
    Accumulate[Table[Count[IntegerDigits[n],?(#>6&)],{n,0,90}]] (* _Harvey P. Dale, Sep 04 2018 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 7/10)*(2n + 2 - (2/5 + floor(n/10^j + 7/10))*10^j) - floor(n/10^j)*(2n + 2 - (1+floor(n/10^j)) * 10^j)), where m=floor(log_10(n)).
a(n) = (n+1)*A102679(n) + (1/2)*Sum_{j=1..m+1} (((-2/5)*floor(n/10^j + 7/10) + floor(n/10^j))*10^j - (floor(n/10^j + 7/10)^2 - floor(n/10^j)^2)*10^j), where m=floor(log_10(n)).
a(10^m-1) = 3*m*10^(m-1).
(this is total number of digits >= 7 occurring in all the numbers with <= m places).
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(7*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102682 Number of digits >= 8 in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 16, 17, 18, 19, 20, 21, 22
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of digits >= 8 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=8 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i),i=0..n), n=0..95); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 1/5)*(2n + 2 - (3/5 + floor(n/10^j + 1/5))*10^j) - floor(n/10^j)*(2n + 2 - (1+floor(n/10^j)) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*A102681(n) + (1/2)*Sum_{j=1..m+1} ((-3/5*floor(n/10^j + 1/5) + floor(n/10^j))*10^j - (floor(n/10^j + 1/5)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m-1) = 2*m*10^(m-1). (this is total number of digits >= 8 occurring in all the numbers with <= m places).
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(8*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005
An incorrect g.f. was deleted by N. J. A. Sloane, Sep 16 2009

A168160 Number of 0's in the matrix whose lines are the binary expansion of the numbers 1,...,n.

Original entry on oeis.org

0, 2, 2, 7, 8, 9, 9, 19, 21, 23, 24, 26, 27, 28, 28, 47, 50, 53, 55, 58, 60, 62, 63, 66, 68, 70, 71, 73, 74, 75, 75, 111, 115, 119, 122, 126, 129, 132, 134, 138, 141, 144, 146, 149, 151, 153, 154, 158, 161, 164, 166, 169, 171, 173, 174, 177, 179, 181, 182, 184, 185, 186
Offset: 1

Views

Author

M. F. Hasler, Nov 22 2009

Keywords

Comments

The matrix is to be taken of minimal size, i.e., have n lines and the number of columns needed to write n in base 2 in the last line, A070939(n). Otherwise said, there is no zero column.
The number of zeros in the last line of the matrix is given by A023416(n).
One has a(n)=a(n-1) iff n = 2^k-1 for some k.

Examples

			a(4)=7 is the number of zeros in the matrix
[001] /* = 1 in binary */
[010] /* = 2 in binary */
[011] /* = 3 in binary */
[100] /* = 4 in binary */
		

Crossrefs

Programs

  • Mathematica
    #*BitLength[#] - Accumulate[DigitCount[#, 2, 1]] & [Range[100]] (* Paolo Xausa, Jan 17 2025 *)
  • PARI
    A168160(n)=n*#binary(n)-sum(i=1,n,norml2(binary(i)))
    
  • Python
    def A168160(n): return n*(a:=n.bit_length())-(n+1)*n.bit_count()-(sum((m:=1<>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,a+1))>>1) # Chai Wah Wu, Nov 11 2024

Formula

a(n) = n*A070939(n) - A000788(n) = A380230(n) - A000788(n).

A301896 a(n) = product of total number of 0's and total number of 1's in binary expansions of 0, ..., n.

Original entry on oeis.org

0, 1, 4, 8, 20, 35, 54, 72, 117, 165, 221, 280, 352, 425, 504, 576, 726, 875, 1036, 1200, 1386, 1575, 1776, 1976, 2214, 2451, 2700, 2944, 3216, 3479, 3750, 4000, 4455, 4897, 5355, 5808, 6300, 6789, 7296, 7800, 8364, 8925, 9504, 10080, 10695, 11305, 11931, 12544, 13260, 13965, 14688
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 28 2018

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, [1, 0], b(n-1)+
         (l-> [add(1-i, i=l), add(i, i=l)])(Bits[Split](n)))
        end:
    a:= n-> (l-> l[1]*l[2])(b(n)):
    seq(a(n), n=0..50);  # Alois P. Heinz, Mar 01 2023
  • Mathematica
    Accumulate[DigitCount[Range[0, 50], 2, 0]] Accumulate[DigitCount[Range[0, 50], 2, 1]]
  • Python
    def A301896(n): return (2+(n+1)*(m:=(n+1).bit_length())-(1<Chai Wah Wu, Mar 01 2023
    
  • Python
    def A301896(n): return (a:=(n+1)*n.bit_count()+(sum((m:=1<>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,n.bit_length()+1))>>1))*(2+(n+1)*(t:=(n+1).bit_length())-(1<Chai Wah Wu, Nov 11 2024

Formula

a(n) = A059015(n)*A000788(n).
a(2^k-1) = 2^(k-2)*(2^k*(k - 2) + 4)*k.

A173209 Partial sums of A000069.

Original entry on oeis.org

1, 3, 7, 14, 22, 33, 46, 60, 76, 95, 116, 138, 163, 189, 217, 248, 280, 315, 352, 390, 431, 473, 517, 564, 613, 663, 715, 770, 826, 885, 946, 1008, 1072, 1139, 1208, 1278, 1351, 1425, 1501, 1580, 1661, 1743, 1827, 1914, 2002, 2093, 2186, 2280, 2377, 2475, 2575
Offset: 1

Views

Author

Jonathan Vos Post, Feb 12 2010

Keywords

Comments

Partial sums of odious numbers. Second differences give A007413. The subsequence of prime partial sums of odious numbers begins: 3, 7, 163, 431, 613, 2377, 3691, which is a subsequence of A027697. The subsequence of odious partial sums of odious numbers begins: 1, 7, 14, 22, 76, 138, 217, 280, 352, 431, 517, 613, 770, 885.

Examples

			a(65) = 1 + 2 + 4 + 7 + 8 + 11 + 13 + 14 + 16 + 19 + 21 + 22 + 25 + 26 + 28 + 31 + 32 + 35 + 37 + 38 + 41 + 42 + 44 + 47 + 49 + 50 + 52 + 55 + 56 + 59 + 61 + 62 + 64 + 67 + 69 + 70 + 73 + 74 + 76 + 79 + 81 + 82 + 84 + 87 + 88 + 91 + 93 + 94 + 97 + 98 + 100 + 103 + 104 + 107 + 109 + 110 + 112 + 115 + 117 + 118 + 121 + 122 + 124 + 127 + 128.
		

Crossrefs

Programs

Formula

a(n) = SUM[i=1..n] A000069(i) = SUM[i=1..n] {i such that A010060(i)=1}.
a(n) = n^2 - n/2 + O(1). - Charles R Greathouse IV, Mar 22 2013
Previous Showing 41-47 of 47 results.