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

A196564 Number of odd digits in decimal representation of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 04 2011

Keywords

Crossrefs

Programs

  • Haskell
    a196564 n = length [d | d <- show n, d `elem` "13579"]
    -- Reinhard Zumkeller, Feb 22 2012, Oct 04 2011
    
  • Maple
    A196564 := proc(n)
            if n =0 then
                    0;
            else
                    convert(n,base,10) ;
                    add(d mod 2,d=%) ;
            end if:
    end proc: # R. J. Mathar, Jul 13 2012
  • Mathematica
    Table[Total[Mod[IntegerDigits[n],2]],{n,0,100}] (* Zak Seidov, Oct 13 2015 *)
  • PARI
    a(n) = #select(x->x%2, digits(n)); \\ Michel Marcus, Oct 14 2015
    
  • Python
    def a(n): return sum(1 for d in str(n) if d in "13579")
    print([a(n) for n in range(100)]) # Michael S. Branicky, May 15 2022

Formula

a(n) = A055642(n) - A196563(n);
a(A014263(n)) = 0; a(A007957(n)) > 0.
From Hieronymus Fischer, May 30 2012: (Start)
a(n) = Sum_{j=0..m} (floor(n/(2*10^j) + (1/2)) - floor(n/(2*10^j))), where m=floor(log_10(n)).
a(10*n+k) = a(n) + a(k), 0<=k<10, n>=0.
a(n) = a(floor(n/10)) + a(n mod 10), n>=0.
a(n) = Sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.
a(A014261(n)) = floor(log_5(4*n+1)), n>0.
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} x^10^j/(1+x^10^j). (End)

A196563 Number of even digits in decimal representation of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 04 2011

Keywords

Crossrefs

Programs

  • Haskell
    a196563 n = length [d | d <- show n, d `elem` "02468"]
    -- Reinhard Zumkeller, Feb 22 2012, Oct 04 2011
    
  • Maple
    A196563 := proc(n)
            if n =0 then
                    1;
            else
                    convert(n,base,10) ;
                    add(1-(d mod 2),d=%) ;
            end if:
    end proc: # R. J. Mathar, Jul 13 2012
  • Mathematica
    Table[Count[Mod[IntegerDigits[n],2],0][n],{n,0,100}] (* Zak Seidov, Oct 13 2015 *)
    Table[Count[IntegerDigits[n],?EvenQ],{n,0,120}] (* _Harvey P. Dale, Feb 22 2020 *)
  • PARI
    a(n) = #select(x->(!(x%2)), if (n, digits(n), [0])); \\ Michel Marcus, Oct 14 2015
    
  • Python
    def a(n): return sum(1 for d in str(n) if d in "02468")
    print([a(n) for n in range(100)]) # Michael S. Branicky, May 15 2022

Formula

a(n) = A055642(n) - A196564(n);
a(A014261(n)) = 0; a(A007928(n)) > 0.
From Hieronymus Fischer, May 30 2012: (Start)
a(n) = Sum_{j=0..m} (1 + floor(n/(2*10^j)) - floor(n/(2*10^j) + (1/2))), where m=floor(log_10(n)).
a(10*n+k) = a(n) + a(k), 0<=k<10, n>=1.
a(n) = a(floor(n/10))+a(n mod 10), n>=10.
a(n) = Sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.
a(A014263(n)) = 1 + floor(log_5(n-1)), n>1.
G.f.: g(x) = 1 + (1/(1-x))*Sum_{j>=0} x^(2*10^j)/(1+x^10^j). (End)

A083449 a(n) = A019566(n)/9, where A019566(n) = concat(n,...,1) - concat(1,...,n).

Original entry on oeis.org

0, 1, 22, 343, 4664, 58985, 713306, 8367627, 96021948, -150891621, -13731137410, -260644605199, 86159119727012, 19839246664059223, 3106259112208391434, 422859356777752723645, 53509280234443297055856, 6473262479112108841388067, 759559693477989774385720278
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 01 2003

Keywords

Comments

Are there any palindromes > 58985?
This sequence also gives the number of occurrences of any digit d > n (thus n < 9) in the list of all numbers from 1 to concatenation(1,...,n) = A007908(n) = A014824(n) = sum_{i=1..n} i*10^(n-i). See A277849, A061217, A277830 etc. - M. F. Hasler, Nov 01 2016, edited Nov 07 2020

Crossrefs

Cf. A061217.

Programs

  • Maple
    a:= n-> (parse(cat((n+1-i)$i=1..n))-parse(cat($1..n)))/9:
    seq(a(n), n=1..20);  # Alois P. Heinz, Nov 09 2020
  • Mathematica
    Array[(FromDigits@ Apply[Join, Reverse@ #] - FromDigits@ Apply[Join, #])/9 &@ Map[IntegerDigits, Range[#]] &, 19] (* Michael De Vlieger, Nov 12 2020 *)
  • PARI
    apply( {A083449(n)=A019566(n)\9}, [1..20]) \\ - M. F. Hasler, Nov 07 2020

Formula

For n < 10, a(n) = ceiling((9*n-11)*(10^n+1)/729). - M. F. Hasler, Nov 07 2020

Extensions

More terms from David Wasserman, Nov 09 2004

A277830 Number of digits '0' in the set of all numbers from 0 to A014824(n) = Sum_{i=1..n} i*10^(n-i) = (0, 1, 12, 123, 1234, 12345, ...).

Original entry on oeis.org

1, 1, 2, 23, 344, 4665, 58986, 713307, 8367628, 96021949, 1083676272, 12071330614, 133058985146, 1454046641578, 15775034317010, 170096022182442, 1824417011947874, 19478738020713306, 207133059219478738, 2194787382318244170, 23182441724417009624, 244170096256515775267
Offset: 0

Views

Author

M. F. Hasler, Nov 01 2016

Keywords

Comments

The first 10 terms are given by a simple explicit formula and linear recurrence, which does not hold for n > 9. Note that A007908 (concat(1..n)) differs from A014824 (a(n) = a(n-1)*10 + n) for n > 9. - M. F. Hasler, Nov 07 2020

Crossrefs

Programs

  • PARI
    print1(c=1);N=0;for(n=1,8,print1(","c+=sum(k=N+1,N=N*10+n,#select(d->d==0,digits(k))))) \\ For purpose of illustration.
    
  • PARI
    apply( A277830(n)={A061217(A014824(n)+!n)+1}, [0..22]) \\ Thanks to Kevin Ryde's formula. - M. F. Hasler, Nov 07 2020

Formula

a(n) = A083449(n) + 1 for n <= 9.
a(n) = 1 + A061217(A014824(n)), taking A061217(0)=0. - Kevin Ryde, Nov 07 2020

Extensions

Incorrect data, b-file, links, formulas and programs deleted by M. F. Hasler, following observations by Kevin Ryde, Nov 07 2020

A155881 a(n) is the number of zeros needed to write the integers 1 through Fibonacci(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 3, 5, 8, 24, 43, 67, 121, 188, 409, 708, 1228, 1946, 4131, 6241, 10525, 17866, 29428, 58369, 87881, 156261, 255242, 412545, 767846, 1280460, 2059307, 3343656, 5510186, 9861418, 16472261, 26422596, 43917688, 73697381, 125281166, 206655249
Offset: 1

Views

Author

Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 29 2009

Keywords

Comments

Data suggets a(n) ~= 10 ^ (c * n) where c ~= 0.209. - David A. Corneth, Jan 23 2019

Examples

			F(9)=34, so writing the numbers F(1)..F(9) requires 3 zeros (one each at 10, 20, and 30), thus a(9)=3.
		

Crossrefs

Programs

  • Maple
    A055641 := proc(n) option remember ; local a,d; if n = 0 then RETURN(a) ; fi; a := 0 ; for d in convert(n,base,10) do if d = 0 then a := a+1 ; fi; od: a ; end: A155881 := proc(n) add(A055641(i),i=1..combinat[fibonacci](n)) ; end: for n from 1 do printf("%d,\n",A155881(n)) ; od; # R. J. Mathar, Feb 19 2009
  • Mathematica
    Block[{n = 32, s}, s = DigitCount[Range@ Fibonacci@ n, 10, 0]; Array[Total@ Take[s, Fibonacci@ #] &, n]] (* Michael De Vlieger, Jan 23 2019 *)
  • PARI
    nb(n) = #Set(select(x->(x==0), digits(n))); \\ A055641
    a(n) = sum(k=1, fibonacci(n), nb(k)); \\ Michel Marcus, Jan 23 2019
    
  • PARI
    a(n) = my(n = fibonacci(n), m=logint(n, 10)); (m+1)*(n+1) - (10^(m+1)-1)/9 + (1/2) * sum(j=1, m+1, (n\10^j * (2*n+2 - (1 + n\10^j) * 10 ^ j) - floor(n/10^j+9/10) * (2*n+2 + ((4/5 - floor(n / 10^j + 9 / 10))*10^j)))) \\ David A. Corneth, Jan 23 2019

Formula

a(n) = A061217(Fibonacci(n)) = A061217(A000045(n)). - David A. Corneth, Jan 23 2019

Extensions

8 more terms from R. J. Mathar, Feb 19 2009
9 more terms from Sean A. Irvine, Dec 10 2009
Edited by Jon E. Schoenfield, Jan 22 2019
More terms from David A. Corneth, Jan 23 2019

A364972 Bases >= 2 in which the number of zeros needed to write the numbers 1 through k never equals k for any k.

Original entry on oeis.org

3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 27, 30, 32, 35, 37, 38, 39, 40, 41, 43, 45, 48, 49, 53, 54, 57, 58, 59, 63, 65, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 79, 80, 83, 85, 88, 89, 90, 93, 94, 95, 96, 98, 100
Offset: 1

Views

Author

Gregory Marton and Tanya Khovanova, Aug 14 2023

Keywords

Comments

We gave a theoretical upper bound, and experimentally checked values under that bound.

Examples

			11 and 13 are not in this sequence because exactly 3152738985031 zeros (expressed here for convenience in decimal) are needed to write the numbers from 1 to 3152738985031, and likewise 3950024143546664 for 13.
		

Crossrefs

Cf. A061217 (shows 10 is a term).
Showing 1-6 of 6 results.