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

A364185 Leading digit of 11^n.

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Jul 15 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerDigits[11^n][[1]]; Array[a, 100, 0] (* Amiram Eldar, Jul 15 2023 *)
  • PARI
    a(n) = digits(11^n)[1];

Formula

a(n) = A000030(A001020(n)).

A363249 Leading digit of 9^n.

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Jul 15 2023

Keywords

References

  • He, Xinwei; Hildebrand, A J; Li, Yuchen; Zhang, Yunyi, Complexity of Leading Digit Sequences, Discrete Mathematics and Theoretical Computer Science; 22 (2020), #14.

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerDigits[9^n][[1]]; Array[a, 100, 0] (* Amiram Eldar, Jul 15 2023 *)
  • PARI
    a(n) = digits(9^n)[1];

Formula

a(n) = A000030(A001019(n)).
a(n) = A060956(2*n).

A362871 Leading digit of 6^n.

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Jul 15 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerDigits[6^n][[1]]; Array[a, 100, 0] (* Amiram Eldar, Jul 15 2023 *)
  • PARI
    a(n) = digits(6^n)[1];

Formula

a(n) = A000030(A000400(n)).

A363093 Leading digit of 7^n.

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Jul 15 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerDigits[7^n][[1]]; Array[a, 100, 0] (* Amiram Eldar, Jul 15 2023 *)
  • PARI
    a(n) = digits(7^n)[1];

Formula

a(n) = A000030(A000420(n)).

A385431 Leading digit of the decimal expansion of the prime zeta function at n.

Original entry on oeis.org

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

Views

Author

Marco Ripà, Jun 28 2025

Keywords

Comments

For each n = 2, 3, 4, ..., a(n) is the most significant (nonzero) digit of the decimal expansion of P(n) := Sum_{p prime} 1/p^n, the prime zeta function at argument n.
The present sequence starts at n = 2, since the underlying series diverges for any integer less than 2.
It is conjectured that a(n) = A111395(n) for all n >= 10 (see "Is the leading digit of the decimal expansion of the prime zeta function at n equal to the first digit of 5^n, for all integers n >= 10?" in Links).

Examples

			For n = 4, a(4) = 7 since the most significant digit of P(4) = Sum_{p prime} 1/p^4 = 0.07699313976424684494... is 7.
		

References

  • Henri Cohen, Number Theory, Volume II: Analytic and Modern Tools, GTM Vol. 240, Springer, 2007; see pp. 208-209.
  • J. W. L. Glaisher, On the Sums of Inverse Powers of the Prime Numbers, Quart. J. Math. 25, 347-362, 1891.

Crossrefs

Programs

  • Mathematica
    Table[Module[{digits, firstNonZero}, digits = First[RealDigits[N[Sum[MoebiusMu[n]*Log[Zeta[k*n]]/n, {n, 1, 200}], 100]]]; firstNonZero = Select[digits, Function[d, d != 0]][[1]]; firstNonZero], {k, 2, 88}]
    $MaxExtraPrecision = 2^10; a[n_] := RealDigits[ Sum[ MoebiusMu[m]*Log[ Zeta[n*m]]/m,{m, 32}], 10, 16][[1, 1]]; Array[a, 87, 2] - (* Robert G. Wilson v, Jul 11 2025 *)
  • PARI
    a(n) = my(x=sumeulerrat(1/p, n)); while(x<1, x*=10); floor(x); \\ Michel Marcus, Jun 29 2025

Formula

a(n) = most significant (nonzero) digit of P(n), where P(n) := Sum_{p prime} 1/p^n.
a(n) = ld(P(n)), where ld(x) := floor(x/10^floor(log_10(x))) and P(n) := Sum_{k >= 1} moebius(k)*log(zeta(n*k))/k.
For all n > 9, a(n) = most significant (nonzero) digit of 5^n (conjectured).

A155816 First nonzero digit in the decimal expansion of (cos Pi/4)^n.

Original entry on oeis.org

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

Views

Author

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

Keywords

Examples

			(cos Pi/4)^4=0.25, so a(4)=2.
(cos Pi/4)^8=0.0625, so a(8)=6.
		

Crossrefs

Cf. A111395.

Programs

  • Maple
    f:= proc(n) local t,m;
      m:= 1 + ilog10(floor(2^(n/2)));
      floor(10^m * 2^(-n/2))
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 22 2023
  • Mathematica
    With[{c=Cos[Pi/4]},Table[First[RealDigits[N[c^n,20]][[1]]],{n,120}]] (* Harvey P. Dale, Nov 07 2012 *)

Formula

a(2*k) = A111395(k). - Robert Israel, Aug 22 2023

Extensions

More terms from Harvey P. Dale, Nov 07 2012
Offset corrected by Robert Israel, Aug 22 2023

A358196 Numbers k such that 5^k and 8^k have the same leading digit.

Original entry on oeis.org

0, 5, 9, 15, 19, 29, 34, 39, 44, 49, 54, 59, 98, 102, 108, 112, 118, 122, 132, 137, 142, 147, 152, 162, 191, 195, 201, 205, 211, 215, 225, 230, 235, 240, 245, 250, 255, 284, 294, 298, 304, 308, 318, 328, 333, 338, 343, 348, 387, 391, 397, 401, 407, 411, 421, 426, 431, 436, 441, 446, 451, 480, 490, 494, 500
Offset: 1

Views

Author

Nicolay Avilov, Nov 02 2022

Keywords

Comments

Write lg = log_10, let {x} denote the fractional part of x. Note that {k*lg(5)} = 1 - {k*lg(2)} and that {k*lg(8)} = {k*lg(2)} + 0, 1, or 2, so we have {k > 0 : 5^k and 8^k both start with a} = {k: {k*lg(2)} is in I_a}, where I_a = (1-lg(a+1), 1-lg(a)) intersect (((lg(a))/3, (lg(a+1))/3) U ((lg(a)+1)/3, (lg(a+1)+1)/3) U ((lg(a)+2)/3, (lg(a+1)+2)/3)). Note that I_1 = (1-lg(2), (lg(2)+2)/3), I_3 = ((lg(3)+1)/3, 1-lg(3)), I_5 = (lg(5)/3, lg(6)/3) and that I_a is empty otherwise. As a result, k > 0 is a term if and only if {k*lg(2)} is in (lg(5)/3, lg(6)/3) U ((lg(3)+1)/3, 1-lg(3)) U (1-lg(2), (lg(2)+2)/3). We see that when 5^k and 8^k both start with 1, 3, or 5, 2^k starts with 5, 3, or 1 respectively. - Jianing Song, Dec 26 2022

Examples

			5 is a term because 5^5 = 3125 and 8^5 = 32768;
9 is a term because 5^9 = 1953125 and 8^9 = 134217728.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 500], Equal @@ IntegerDigits[{5, 8}^#][[;; , 1]] &] (* Amiram Eldar, Nov 02 2022 *)
  • PARI
    isok(k) = digits(5^k)[1] == digits(8^k)[1]; \\ Michel Marcus, Nov 02 2022
    
  • Python
    def ok(n): return str(5**n)[0] == str(8**n)[0]
    print([k for k in range(501) if ok(k)]) # Michael S. Branicky, Nov 03 2022

A358197 Numbers k such that 2^k, 5^k and 8^k have the same first digit.

Original entry on oeis.org

0, 5, 15, 98, 108, 118, 191, 201, 211, 284, 294, 304, 387, 397, 407, 480, 490, 500, 583, 593, 603, 676, 686, 696, 779, 789, 872, 882, 892, 965, 975, 985, 1068, 1078, 1088, 1161, 1171, 1181, 1264, 1274, 1284, 1357, 1367, 1377, 1450, 1460, 1470, 1553, 1563, 1573, 1646, 1656, 1666
Offset: 1

Views

Author

Keywords

Comments

The first digit of 2^k is A008952(k) = floor(10^{k*log_10(2)}), the first digit of 5^k is A111395(k) = floor(10^{k*log_10(5)}), and the first digit of 8^k is A008952(3*k) = floor(10^{k*log_10(8)}), where "{x}" denotes the fractional part of x.
All numbers 2^k, 5^k, 8^k for k = a(n) > 0 start only with 3.
From Jianing Song, Dec 26 2022: (Start)
Write lg = log_10. Note that {k*lg(5)} = 1 - {k*lg(2)} and that {k*lg(8)} = {k*lg(2)} + 0, 1, or 2, so we have {k > 0 : 2^k, 5^k, 8^k all start with a} = {k: {k*lg(2)} is in I_a}, where I_a = (lg(a), lg(a+1)) intersect (1-lg(a+1), 1-lg(a)) intersect (((lg(a))/3, (lg(a+1))/3) U ((lg(a)+1)/3, (lg(a+1)+1)/3) U ((lg(a)+2)/3, (lg(a+1)+2)/3)). Note that I_3 = ((lg(3)+1)/3, 1-lg(3)) and I_a is empty otherwise (since (lg(a), lg(a+1)) intersect (1-lg(a+1), 1-lg(a)) is empty). As a result, k > 0 is a term if and only if (lg(3)+1)/3 < {k*lg(2)} < 1-lg(3).
Except for 0, also numbers k in A358196 such that 2^k starts with 3 (see the comment in A358196).
Claim: for n > 1, a(n+1) - a(n) = 10, 73, or 83. Proof: write a = (lg(3)+1)/3, b = 1-lg(3).
Step 1. If k > 0 is a term, then:
(a) {k*lg(2)} is in (a, b-(10*lg(2)-3)) => {(k+10)*lg(2)} is in (a+(10*lg(2)-3), b) => k+10 is a term;
(b) {k*lg(2)} is in (a+(25-83*lg(2)), b) => {(k+83)*lg(2)} is in (a, b-(25-83*lg(2))) => k+83 is a term.
Note that (a, b-(10*lg(2)-3)) U (a+(25-83*lg(2)), b) = (a, b), so at least one of k+10 and k+83 is a term.
Step 2. If k > 0 and k+m are both terms, 0 < m <= 83, then {k*lg(2)} and {(k+m)*lg(2)} are both in (a, b), so m*lg(2) is the range (N-(b-a), N+(b-a)) for some integer N, which implies that m = 10, 20, 73, or 83.
Note that if {k*lg(2)} < 1 - 2*(10*lg(2)-3), then {(k+10)*lg(2)} = {k*lg(2)} + (10*lg(2)-3), {(k+20)*lg(2)} = {k*lg(2)} + 2*(10*lg(2)-3), so {k*lg(2)} < {(k+10)*lg(2)} < {(k+20)*lg(2)}, which means that if k and k+20 are both terms, so is k+10. This shows that the next term after k is either 10, 73, or 83 larger.
We can show similarly that, for k > 0 being a term of this sequence:
(a) if k+73 is a term, then k+83 is a term;
(b) if k+83 is a term, then k+93 is a term;
(c) if k+166 is a term, then k+73 is a term;
(d) if k+10, k+73 are not terms (i.e., the next term is k+83), then k+176, k+196 are terms.
As a result, if we write out the sequence of the first differences, 73 is always followed by two 10's, and 83 is followed by one or two 10's; 83, 10, 10 is always followed by 73, 10, 10, and 83, 10 is always followed by 83, 10, 10. (End)

Examples

			5 is a term because the first digit of 2^5 = 32, 5^5 = 3125, 8^5 = 32768 is 3.
15 is a term because the first digit of 2^15 = 32768, 5^15 = 30517578125, 8^15 = 35184372088832 is 3.
		

Crossrefs

Intersection of A088935 and A358196.

Programs

  • Maple
    ld:= n -> floor(n/10^ilog10(n)):filter:= proc(k) local d;
      d:= ld(2^k);
      ld(5^k) = d and ld(8^k) = d
    end proc:select(filter, [$0..2000]); # Robert Israel, Nov 02 2022
  • Mathematica
    Select[Range[0, 1666], Equal @@ IntegerDigits[{2, 5, 8}^#][[;; , 1]] &] (* Amiram Eldar, Nov 02 2022 *)
  • Python
    def ok(n): return str(2**n)[0] == str(5**n)[0] == str(8**n)[0]
    print([k for k in range(1667) if ok(k)]) # Michael S. Branicky, Nov 03 2022

A364881 First significant digit of the decimal expansion of n/(2^n).

Original entry on oeis.org

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

Views

Author

Ejder Aysun, Aug 10 2023

Keywords

Comments

a(n) is also the first digit of n*5^n = A036291(n).

Examples

			n     n/(2^n)
1     0.5                            a(1) = 5
2     0.5                            a(2) = 5
3     0.375                          a(3) = 3
4     0.25                           a(4) = 2
5     0.15625                        a(5) = 1
6     0.9375                         a(6) = 9
7     0.0546875                      a(7) = 5
8     0.03125                        a(8) = 3
9     0.017578125                    a(9) = 1
10    0.009765625                    a(10) = 9
...
		

Crossrefs

Programs

  • Maple
    a:= n-> parse((""||(n*5^n))[1]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 18 2023
  • Mathematica
    Table[Floor[n/(2^n)/10^Floor[Log10[n/(2^n)]]], {n, 100000}]
  • Python
    def A364881(n): return (n*5**(m:=len(str((1<>n-m) % 10 # Chai Wah Wu, Aug 24 2023

Formula

a(n) = floor(n/(2^n)/10^floor(log_10(n/(2^n)))), for n > 0.
a(n) = floor(n/A000079(n)/10^floor(log_10(n/A000079(n)))).
a(n) = floor(A036291(n)/10^floor(log_10(A036291(n)))).
a(n) = A000030(A036291(n)).

A385495 Most significant nonzero decimal digit of zeta(n)-1, where zeta(n) = Sum_{j >= 1} 1/j^n is the Riemann zeta function.

Original entry on oeis.org

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

Views

Author

Marco Ripà, Jun 30 2025

Keywords

Comments

The sequence starts at n = 2 since the zeta function sum diverges for any integer n < 2.
Conjecture: a(n) = A111395(n) for all n >= 10 (for a weaker conjecture see the comments in the related sequence A385431 and the Mathematics Stack Exchange discussion).

Examples

			For n = 4, a(4) = 8 since the most significant digit of zeta(4)-1 = 0.0823232... is 8 (see A013662).
		

References

  • Henri Cohen, Number Theory, Volume II: Analytic and Modern Tools, GTM Vol. 240, Springer, 2007; see pp. 208-209.

Crossrefs

Programs

  • Mathematica
    Table[First@Select[First@RealDigits[N[Zeta[n] - 1, 100]], # != 0 &], {n, 2, 100}]
Showing 1-10 of 11 results. Next