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 25 results. Next

A125117 First differences of A034887.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This sequence is not periodic because log(2)/log(10) is an irrational number. - T. D. Noe, Jan 10 2007
The sequence consists only of 0's and 1's. Sequence A276397 (with a 0 prefixed) is similar but differs from a(42) on. Sequence A144597 differs only from a(102) on. - M. F. Hasler, Oct 07 2016

Examples

			a(1)=0 because 2^(1+1)=4 (one digit) 2^1=2 (one digit) and the difference is 0.
a(3)=1 because 2^(3+1)=16 (two digits) 2^(3)=8 (one digit) and the difference is 1.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,j,k,w,old; k:=2; for i from 1 by 1 to n do j:=k^i; w:=0; while j>0 do w:=w+1; j:=trunc(j/10); od; if i>1 then print(w-old); old:=w; else old:=w; fi; od; end: P(1000);
  • Mathematica
    Differences[IntegerLength[2^Range[0, 100]]] (* Paolo Xausa, Jun 08 2024 *)
  • PARI
    a(n)=logint(2^(n+1),10)-logint(2^n,10) \\ Charles R Greathouse IV, Oct 19 2016

Formula

a(n) = number_of_digits{2^(n+1)} - number_of_digits{2^(n)} with n>=0.

A372804 Decimal expansion of Sum_{k >= 1, A034887(k) even} 1/2^k.

Original entry on oeis.org

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

Views

Author

Paolo Xausa, May 13 2024

Keywords

Examples

			0.1112195121951219512195121951220497309227983312303343426891...
		

Crossrefs

Programs

  • Mathematica
    First[RealDigits[Sum[If[OddQ[IntegerLength[2^k]], 0, 1/2^k], {k, 350}], 10, 100]]

Formula

Approximately 114/1025, correct to 30 digits: see Example 4.2 (b) in Borwein and Borwein (1992), p. 634.

A000689 Final decimal digit of 2^n.

Original entry on oeis.org

1, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6, 2, 4, 8, 6
Offset: 0

Views

Author

Keywords

Comments

These are the analogs of the powers of 2 in carryless arithmetic mod 10.
Let G = {2,4,8,6}. Let o be defined as XoY = least significant digit in XY. Then (G,o) is an Abelian group wherein 2 is a generator (also see the first comment under A001148). - K.V.Iyer, Mar 12 2010
This is also the decimal expansion of 227/1818. - Kritsada Moomuang, Dec 21 2021

Examples

			G.f. = 1 + 2*x + 4*x^2 + 8*x^3 + 6*x^4 + 2*x^5 + 4*x^6 + 8*x^7 + 6*x^8 + ...
		

Crossrefs

Programs

  • Haskell
    a000689 n = a000689_list !! n
    a000689_list = 1 : cycle [2,4,8,6]  -- Reinhard Zumkeller, Sep 15 2011
  • Magma
    [2^n mod 10: n in [0..150]]; // Vincenzo Librandi, Apr 12 2011
    
  • Mathematica
    Table[PowerMod[2, n, 10], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
  • PARI
    for(n=0,80, if(n,{x=(n+3)%4+1; print1(10-(4*x^3+47*x-27*x^2)/3,", ")},{print1("1, ")}))
    
  • SageMath
    [power_mod(2,n,10)for n in range(0, 81)] # Zerinvary Lajos, Nov 03 2009
    

Formula

Periodic with period 4.
a(n) = 2^n mod 10.
a(n) = A002081(n) - A002081(n-1), for n > 0.
From R. J. Mathar, Apr 13 2010: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3), n > 3.
G.f.: (x+3*x^2+5*x^3+1)/((1-x) * (1+x^2)). (End)
For n >= 1, a(n) = 10 - (4x^3 + 47x - 27x^2)/3, where x = (n+3) mod 4 + 1.
For n >= 1, a(n) = A070402(n) + 5*floor( ((n-1) mod 4)/2 ).
G.f.: 1 / (1 - 2*x / (1 + 5*x^3 / (1 + x / (1 - 3*x / (1 + 3*x))))). - Michael Somos, May 12 2012
a(n) = 5 + cos((n*Pi)/2) - 3*sin((n*Pi)/2) for n >= 1. - Kritsada Moomuang, Dec 21 2021

A210434 Number of digits in 4^n.

Original entry on oeis.org

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

Views

Author

Luc Comeau-Montasse, Mar 21 2012

Keywords

Comments

Since log10(4) = A114493 ~ 0.60205 (= twice log10(2) = 0.30102999566...), the first 98 terms are equal to floor(n*3/5)+1. - M. F. Hasler, Mar 31 2025

Examples

			a(4) = 3 because 4^4 = 256, which has 3 digits.
a(5) = 4 because 4^5 = 1024, which has 4 digits.
		

Crossrefs

Programs

  • Magma
    [#Intseq(4^n): n in [0..68]]; // Bruno Berselli, Mar 22 2012
    
  • Maple
    a:= n-> length(4^n): seq(a(n), n=0..100); # Alois P. Heinz, Mar 22 2012
  • Mathematica
    Table[Length[IntegerDigits[4^n]], {n, 0, 68}] (* Bruno Berselli, Mar 22 2012 *)
  • PARI
    apply( {A210434(n)=logint(4^n,10)+1}, [0..66]) \\ M. F. Hasler, Mar 31 2025
    
  • PARI
    a(n)=log(4)*n\log(10)+1 \\ correct up to n ~ 10^precision, with default precision = 38. - M. F. Hasler, Mar 31 2025
    
  • Python
    from math import log
    def A210434(n): return int(n*log(4,10))+1 if n<1e16 else "not enough precision" # M. F. Hasler, Mar 31 2025

Formula

a(n) = A055642(A000302(n)) = A055642(4^n) = floor(log_10(10*(4^n))). - Jonathan Vos Post, Mar 22 2012

A210435 Number of digits in 5^n.

Original entry on oeis.org

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

Views

Author

Luc Comeau-Montasse, Mar 21 2012

Keywords

Examples

			a(4) = 3 because 5^4 = 625, which has 3 digits.
a(5) = 4 because 5^5 = 3125, which has 4 digits.
		

Crossrefs

Number of digits in b^n: A034887 (b=2), A034888 (b=3), A210434 (b=4), A210435 (b=5), A210436 (b=6), A210062 (b=7).

Programs

  • Magma
    [#Intseq(5^n): n in [0..67]]; // Bruno Berselli, Mar 22 2012
    
  • Maple
    a:= n-> length(5^n): seq(a(n), n=0..100); # Alois P. Heinz, Mar 22 2012
  • Mathematica
    Table[Length[IntegerDigits[5^n]], {n, 0, 67}] (* Bruno Berselli, Mar 22 2012 *)
    IntegerLength[5^Range[0,70]] (* Harvey P. Dale, Mar 26 2013 *)
  • PARI
    a(n) = #Str(5^n); \\ Michel Marcus, Oct 27 2015

Formula

a(n) = A055642(A000351(n)) = A055642(5^n) = floor(log_10(10*(5^n))). [Jonathan Vos Post, Mar 22 2012]
a(n) + A034887(n) = n+1. - Michel Marcus, Oct 27 2015

A210436 Number of digits in 6^n.

Original entry on oeis.org

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

Views

Author

Luc Comeau-Montasse, Mar 21 2012

Keywords

Examples

			a(4) = 4 because 6^4 = 1296, which has 4 digits.
a(5) = 4 because 6^5 = 7776, which has 4 digits.
		

Crossrefs

Programs

  • Magma
    [#Intseq(6^n): n in [0..67]]; // Bruno Berselli, Mar 22 2012
  • Maple
    a:= n-> length(6^n): seq (a(n), n=0..100); # Alois P. Heinz, Mar 22 2012
  • Mathematica
    Table[Length[IntegerDigits[6^n]], {n, 0, 99}] (* Alonso del Arte, Mar 22 2012 *)

Formula

a(n) = A055642(A000400(n)) = A055642(6^n) = floor(log_10(10*(6^n))). - Jonathan Vos Post, Mar 23 2012

A210062 Number of digits in 7^n.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 28, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 55, 56, 57
Offset: 0

Views

Author

Luc Comeau-Montasse, Mar 16 2012

Keywords

Crossrefs

Number of digits in b^n: A034887 (b=2), A034888 (b=3), A210434 (b=4), A210435 (b=5), A210436 (b=6), this sequence (b=7).

Programs

  • Magma
    [#Intseq(7^n): n in [0..67]]; // Bruno Berselli, Mar 22 2012
  • Mathematica
    Table[Length[IntegerDigits[7^n]], {n, 0, 100}] (* T. D. Noe, Mar 20 2012 *)

Formula

a(n) = A055642(A000420(n)) = A055642(7^n) = floor(log_10(10*(7^n))). [Jonathan Vos Post, Mar 23 2012]

A055253 Number of even digits in 2^n.

Original entry on oeis.org

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

Views

Author

Asher Auel, May 05 2000

Keywords

Crossrefs

Programs

  • Maple
    A055253 := proc(val) local i, j, k, n; n := 2^val; j := 0; k := floor(ln(n)/ln(10))+1; for i from 1 to k do if (n mod 10) mod 2 = 0 then j := j+1 fi; n := floor(n/10); od; RETURN(j); end: seq(A055253(n),n=0..110); # Jaap Spies, Dec 30 2003
  • Mathematica
    Table[Length@ Select[IntegerDigits[2^n], EvenQ], {n, 0, 120}] (* or *)
    Table[Total@ Pick[DigitCount[2^n], {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, 1], {n, 0, 120}] (* Michael De Vlieger, May 01 2016 *)
    Count[IntegerDigits[#],?EvenQ]&/@(2^Range[0,100]) (* _Harvey P. Dale, Mar 25 2020 *)
  • PARI
    a(n) = #select(x->(x % 2) == 0, digits(2^n)); \\ Michel Marcus, May 01 2016
    
  • Python
    def a(n): return sum(1 for d in str(1<Michael S. Branicky, Dec 23 2022

Extensions

More terms from Jaap Spies, Dec 30 2003

A055254 Number of odd digits in 2^n.

Original entry on oeis.org

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

Views

Author

Asher Auel, May 05 2000

Keywords

Comments

Related sequence b(n) = Number of digits in 2^n that are at least 5. a(0) = 1, b(0) = 0 and a(n+1) = b(n), as a digit with value 5 of higher in 2^n will generate an odd digit in 2^(n+1). In the Nieuw Archief voor Wiskunde link there is a proof that sum(k>=, b(k)/2^k) = 2/9. - Jaap Spies, Mar 13 2009

Examples

			2^30 = 1073741824 and 1073741824 contains 5 odd decimal digits hence a(30)=5.
		

References

  • J. Borwein, D. Bailey and R. Girgensohn, Experimentation in mathematics : computational paths to discovery, A. K. Peters, 2004, pp. 14-15.

Crossrefs

Programs

  • Maple
    A055254 := proc(val) local i, j, k, n; n := 2^val; j := 0; k := floor(ln(n)/ln(10))+1; for i from 1 to k do if (n mod 10) mod 2 = 1 then j := j+1 fi; n := floor(n/10); od; RETURN(j); end: seq(A055254(n),n=0..110); # Jaap Spies
  • Mathematica
    A055254[N_] := Count[ #, True] & /@ Map[OddQ, IntegerDigits /@ (2^# & /@ Range[N])] (* This generates a table of the number of odd digits in the first N powers of two *) (* Douglas Skinner (skinnerd(AT)comcast.net), Dec 06 2007 *)
    Table[Count[IntegerDigits[2^n],?OddQ],{n,0,90}] (* _Harvey P. Dale, Mar 25 2015 *)
  • PARI
    a(n)=my(d=digits(2^n)%2);sum(i=1,#d,d[i]) \\ Charles R Greathouse IV, Jun 04 2013
    
  • Perl
    sub a{my $m;map $m+=1&$_,split //,1<
    				
  • Python
    def a(n): return sum(1 for d in str(1<Michael S. Branicky, Dec 23 2022

Formula

Sum(k>=0,a(k)/2^k)=11/9 (for a proof see the comment above). [Corrected by Jaap Spies, Mar 13 2009]

Extensions

More terms from Jaap Spies, Dec 30 2003

A077352 a(n) = (concatenation in ascending order of divisors of 2^n)/2^n.

Original entry on oeis.org

1, 6, 31, 156, 7801, 390051, 19502551, 9751275501, 4875637750501, 2437818875250501, 12189094376252505001, 60945471881262525005001, 304727359406312625025005001, 1523636797031563125125025005001, 76181839851578156256251250250050001, 3809091992578907812812562512502500050001
Offset: 0

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Examples

			a(6) = 1248163264/64 = 19502551.
		

Crossrefs

Programs

  • Maple
    a:= n-> parse(cat(2^i$i=0..n))/2^n:
    seq(a(n), n=0..15);  # Alois P. Heinz, May 16 2025
  • Mathematica
    A077352[n_] := FromDigits[Flatten[IntegerDigits[Divisors[#]]]]/# & [2^n];
    Array[A077352, 16, 0] (* or *)
    FoldList[10^IntegerLength[2^#2]*#/2 + 1 &, 1, Range[15]] (* Paolo Xausa, May 19 2025 *)

Formula

For n>=1, a(n) = (a(n-1)*2^(n-1)*10^(floor(log_10(2^n))+1)+2^n)/2^n. - Sam Alexander, Feb 27 2005

Extensions

Offset corrected by Sean A. Irvine, May 16 2025
Showing 1-10 of 25 results. Next