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 10 results.

A055641 Number of zero digits in n.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Henry Bottomley, Jun 06 2000

Keywords

Examples

			a(99) = 0 because the digits of 99 are 9 and 9, a(100) = 2 because the digits of 100 are 1, 0 and 0 and there are two 0's.
		

Crossrefs

Programs

  • Haskell
    a055641 n | n < 10    = 0 ^ n
              | otherwise = a055641 n' + 0 ^ d where (n',d) = divMod n 10
    -- Reinhard Zumkeller, Apr 30 2013
    
  • Mathematica
    Array[Last@ DigitCount@ # &, 105] (* Michael De Vlieger, Jul 02 2015 *)
  • PARI
    a(n)=if(n,n=digits(n); sum(i=2,#n,n[i]==0), 1) \\ Charles R Greathouse IV, Sep 13 2015
    
  • PARI
    A055641(n)=#select(d->!d,digits(n))+!n \\ M. F. Hasler, Jun 22 2018
    
  • Python
    def a(n): return str(n).count("0")
    print([a(n) for n in range(106)]) # Michael S. Branicky, May 26 2022

Formula

From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = m + 1 - A055640(n) = Sum_{j=1..m+1} (1 + floor(n/10^j) - floor(n/10^j+0.9)), where m = floor(log_10(n)).
G.f.: g(x) = 1 + (1/(1-x))*Sum_{j>=0} (x^(10*10^j) - x^(11*10^j))/(1-x^10^(j+1)). (End)
a(n) = if n<10 then A000007(n) else a(A059995(n)) + A000007(A010879(n)). - Reinhard Zumkeller, Apr 30 2013, corrected by M. F. Hasler, Jun 22 2018

A085976 Number of 2's in decimal expansion of prime(n).

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Examples

			prime(4) = 7, so a(4)=0 and prime(2490) = 22229, so a(2490)=4.
		

Crossrefs

Cf. 0's A085974, 1's A085975, 3's A085977, 4's A085978, 5's A085979, 6's A085980, 7's A085981, 8's A085982, 9's A085983.

Programs

  • Haskell
    a085976 = count2 0 . a000040 where
       count2 c x | d == 2    = if x < 10 then c + 1 else count2 (c + 1) x'
                  | otherwise = if x < 10 then c else count2 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[Prime[Range[110]],10,2] (* Harvey P. Dale, Jan 14 2014 *)

A085975 Number of 1's in decimal expansion of prime(n).

Original entry on oeis.org

0, 0, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Examples

			prime(5) = 11, so a(5)=2 and prime(1242) = 10111, so a(1242)=4.
		

Crossrefs

Cf. 0's A085974, 2's A085976, 3's A085977, 4's A085978, 5's A085979, 6's A085980, 7's A085981, 8's A085982, 9's A085983.

Programs

  • Haskell
    a085975 = count1 0 . a000040 where
       count1 c x | d == 1    = if x < 10 then c + 1 else count1 (c + 1) x'
                  | otherwise = if x < 10 then c else count1 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[Prime[Range[100]],10,1] (* Paolo Xausa, Oct 30 2023 *)

A085977 Number of 3's in decimal expansion of prime(n).

Original entry on oeis.org

0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 0, 0, 0, 0, 1, 2, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Examples

			prime(2) = 3, so a(2)=1 and prime(345) = 2333, so a(345)=3.
		

Crossrefs

Cf. 0's A085974, 1's A085975, 2's A085976, 4's A085978, 5's A085979, 6's A085980, 7's A085981, 8's A085982, 9's A085983.

Programs

  • Haskell
    a085977 = count3 0 . a000040 where
       count3 c x | d == 3    = if x < 10 then c + 1 else count3 (c + 1) x'
                  | otherwise = if x < 10 then c else count3 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[Prime[Range[110]],10,3] (* Harvey P. Dale, Aug 05 2019 *)

A085978 Number of 4's in decimal expansion of prime(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Crossrefs

Cf. 0's A085974, 1's A085975, 2's A085976, 3's A085977, 5's A085979, 6's A085980, 7's A085981, 8's A085982, 9's A085983.

Programs

  • Haskell
    a085978 = count4 0 . a000040 where
       count4 c x | d == 4    = if x < 10 then c + 1 else count4 (c + 1) x'
                  | otherwise = if x < 10 then c else count4 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[#,10,4]&/@Prime[Range[110]] (* Harvey P. Dale, May 30 2021 *)

A085979 Number of 5's in decimal expansion of prime(n).

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Crossrefs

Cf. 0's A085974, 1's A085975, 2's A085976, 3's A085977, 4's A085978, 6's A085980, 7's A085981, 8's A085982, 9's A085983.

Programs

  • Haskell
    a085979 = count5 0 . a000040 where
       count5 c x | d == 5    = if x < 10 then c + 1 else count5 (c + 1) x'
                  | otherwise = if x < 10 then c else count5 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[Prime[Range[100]],10,5] (* Paolo Xausa, Oct 30 2023 *)

A085980 Number of 6's in decimal expansion of prime(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Crossrefs

Cf. 0's A085974, 1's A085975, 2's A085976, 3's A085977, 4's A085978, 5's A085979, 7's A085981, 8's A085982, 9's A085983.

Programs

  • Haskell
    a085980 = count6 0 . a000040 where
       count6 c x | d == 6    = if x < 10 then c + 1 else count6 (c + 1) x'
                  | otherwise = if x < 10 then c else count6 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    Table[DigitCount[n,10,6],{n,Prime[Range[110]]}] (* Harvey P. Dale, Mar 20 2018 *)

A085981 Number of 7's in decimal expansion of prime(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Crossrefs

Cf. 0's A085974, 1's A085975, 2's A085976, 3's A085977, 4's A085978, 5's A085979, 6's A085980, 8's A085982, 9's A085983.

Programs

  • Haskell
    a085981 = count7 0 . a000040 where
       count7 c x | d == 7    = if x < 10 then c + 1 else count7 (c + 1) x'
                  | otherwise = if x < 10 then c else count7 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[Prime[Range[100]],10,7] (* Paolo Xausa, Oct 30 2023 *)

A085982 Number of 8's in decimal expansion of prime(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Crossrefs

Cf. 0's A085974, 1's A085975, 2's A085976, 3's A085977, 4's A085978, 5's A085979, 6's A085980, 7's A085981, 9's A085983.

Programs

  • Haskell
    a085982 = count8 0 . a000040 where
       count8 c x | d == 8    = if x < 10 then c + 1 else count8 (c + 1) x'
                  | otherwise = if x < 10 then c else count8 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[Prime[Range[150]],10,8](* Harvey P. Dale, Jun 11 2016 *)

A085983 Number of 9's in decimal expansion of prime(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Jason Earls, Jul 06 2003

Keywords

Crossrefs

Cf. 0's A085974, 1's A085975, 2's A085976, 3's A085977, 4's A085978, 5's A085979, 6's A085980, 7's A085981, 8's A085982.

Programs

  • Haskell
    a085983 = count9 0 . a000040 where
       count9 c x | d == 9    = if x < 10 then c + 1 else count9 (c + 1) x'
                  | otherwise = if x < 10 then c else count9 c x'
                  where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 08 2014
  • Mathematica
    DigitCount[#,10,9]&/@Prime[Range[110]] (* Harvey P. Dale, May 08 2018 *)
Showing 1-10 of 10 results.