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.

A126206 Number of 4's in the decimal expansion of 4^n.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 1, 1, 0, 2, 1, 3, 0, 1, 2, 2, 2, 1, 1, 3, 0, 3, 3, 3, 2, 2, 2, 3, 1, 2, 2, 3, 4, 3, 1, 3, 3, 4, 2, 4, 2, 4, 2, 2, 3, 4, 3, 3, 3, 3, 2, 2, 3, 5, 2, 4, 2, 4, 4, 3, 3, 3, 4, 4, 6, 5, 5, 4, 2, 9, 5, 2, 4, 6, 4, 7, 4, 2, 5, 4, 3, 4, 8, 4, 7, 9, 2, 8, 4, 7, 3, 10, 9, 5, 3, 5, 8, 8, 3, 10, 4
Offset: 0

Views

Author

Keywords

Examples

			a(11)=3 because 4^11 = 4194304 with three 4's.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,x,y,w,cont; y:=4; k:=y; for i from 0 by 1 to n do x:=y^i; cont:=0; while x>0 do w:=x-trunc(x/10)*10; if w=k then cont:=cont+1; fi; x:=trunc(x/10); od; print(cont); od; end: P(100);
    # Alternative:
    map(n -> numboccur(4, convert(4^n,base,10)), [$0..100]); # Robert Israel, Jul 18 2018
  • Mathematica
    DigitCount[4^#,10,4]&/@Range[0,150]  (* Harvey P. Dale, Feb 01 2011 *)

A126205 Number of 3's in decimal expansion of 3^n, with n>=0.

Original entry on oeis.org

0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 1, 1, 1, 1, 0, 1, 3, 2, 1, 1, 1, 1, 0, 0, 4, 1, 3, 1, 1, 0, 1, 1, 3, 1, 1, 0, 3, 2, 3, 2, 4, 1, 2, 3, 4, 0, 4, 2, 3, 3, 0, 7, 2, 2, 4, 4, 3, 2, 3, 4, 5, 6, 2, 4, 8, 3, 1, 2, 6, 3, 4, 5, 4, 3, 2, 6, 5, 4, 8, 0, 4, 4, 7, 2, 4, 3, 6, 5, 8, 5, 3, 7, 3, 2, 4, 5
Offset: 0

Views

Author

Keywords

Examples

			a(21)=3 because 3^21=10460353203 with three 3's.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,x,y,w,cont; y:=3; k:=y; for i from 0 by 1 to n do x:=y^i; cont:=0; while x>0 do w:=x-trunc(x/10)*10; if w=k then cont:=cont+1; fi; x:=trunc(x/10); od; print(cont); od; end: P(100);
  • Mathematica
    DigitCount[3^Range[0,100],10,3] (* Harvey P. Dale, May 26 2015 *)

A126207 Number of 5's in decimal expansion of 5^n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 3, 3, 3, 2, 2, 1, 2, 2, 3, 3, 3, 2, 2, 4, 2, 3, 5, 3, 2, 3, 3, 2, 5, 4, 3, 5, 2, 6, 5, 1, 2, 1, 6, 5, 6, 4, 4, 3, 2, 4, 9, 9, 9, 4, 4, 2, 5, 2, 4, 5, 5, 7, 8, 6, 5, 5, 5, 7, 6, 11, 7, 7, 5, 5, 6, 7, 6, 8, 8, 10, 5, 6, 7, 8, 9, 4, 10, 7, 4, 8, 10, 9, 6, 5, 6, 10, 6
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,x,y,w,cont; y:=5; k:=y; for i from 0 by 1 to n do x:=y^i; cont:=0; while x>0 do w:=x-trunc(x/10)*10; if w=k then cont:=cont+1; fi; x:=trunc(x/10); od; print(cont); od; end: P(100);

A126208 Number of 6's in decimal expansion of 6^n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 3, 1, 3, 2, 4, 2, 2, 3, 3, 1, 1, 4, 4, 2, 4, 3, 3, 2, 3, 1, 1, 3, 3, 4, 1, 3, 4, 7, 3, 2, 2, 4, 6, 4, 4, 3, 3, 3, 2, 5, 6, 1, 2, 5, 8, 7, 6, 4, 3, 6, 5, 5, 9, 6, 7, 7, 7, 5, 13, 8, 4, 5, 5, 2, 7, 4, 6, 5, 5, 12, 11, 4, 10, 7, 5, 11, 14, 9, 9, 9, 9, 7, 8, 10, 6, 8, 9, 6, 6, 7, 12, 9, 12, 11
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,x,y,w,cont; y:=6; k:=y; for i from 0 by 1 to n do x:=y^i; cont:=0; while x>0 do w:=x-trunc(x/10)*10; if w=k then cont:=cont+1; fi; x:=trunc(x/10); od; print(cont); od; end: P(100);

A126210 Number of 8's in decimal expansion of 8^n.

Original entry on oeis.org

0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2, 1, 4, 1, 4, 1, 3, 4, 4, 1, 3, 3, 2, 2, 3, 0, 2, 4, 1, 3, 1, 1, 4, 3, 3, 3, 4, 5, 3, 4, 4, 5, 4, 4, 3, 5, 7, 4, 10, 5, 3, 7, 7, 4, 8, 3, 6, 7, 4, 10, 6, 5, 3, 5, 10, 8, 9, 7, 10, 5, 12, 6, 10, 5, 7, 2, 9, 11, 9, 11, 7, 7, 5, 2, 9, 6, 7, 5, 13, 12, 10, 8, 4, 9, 6, 6, 10, 10
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,x,y,w,cont; y:=8; k:=y; for i from 0 by 1 to n do x:=y^i; cont:=0; while x>0 do w:=x-trunc(x/10)*10; if w=k then cont:=cont+1; fi; x:=trunc(x/10); od; print(cont); od; end: P(100);
  • Mathematica
    DigitCount[8^Range[0,100],10,8] (* Harvey P. Dale, Jan 28 2013 *)

A126211 Number of 9's in decimal expansion of 9^n.

Original entry on oeis.org

0, 1, 0, 1, 0, 2, 0, 2, 0, 1, 0, 2, 1, 1, 2, 3, 0, 3, 5, 3, 2, 5, 2, 5, 2, 4, 3, 5, 0, 3, 2, 4, 3, 3, 2, 4, 4, 5, 3, 2, 3, 6, 2, 3, 4, 5, 2, 6, 2, 3, 1, 8, 6, 6, 5, 3, 7, 7, 2, 5, 8, 8, 6, 5, 5, 8, 10, 6, 3, 9, 7, 8, 5, 7, 6, 8, 6, 10, 7, 5, 6, 10, 10, 10, 8, 9, 7, 12, 14, 12, 7, 6, 8, 5, 10, 10, 2, 14, 6, 6
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,x,y,w,cont; y:=9; k:=y; for i from 0 by 1 to n do x:=y^i; cont:=0; while x>0 do w:=x-trunc(x/10)*10; if w=k then cont:=cont+1; fi; x:=trunc(x/10); od; print(cont); od; end: P(100);
Showing 1-6 of 6 results.