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

A023415 If any power of 2 ends with k 8's and 9's, they must be the first k terms of this sequence in reverse order.

Original entry on oeis.org

8, 8, 8, 9, 8, 9, 9, 8, 9, 8, 9, 8, 8, 9, 9, 8, 9, 8, 9, 9, 9, 8, 8, 8, 8, 9, 8, 8, 8, 8, 9, 9, 9, 9, 8, 9, 8, 8, 9, 9, 8, 8, 9, 9, 8, 9, 8, 8, 9, 8, 9, 8, 9, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 9, 8, 8, 8, 9, 9, 8, 8, 9, 8, 8, 9, 9, 8, 8, 9, 9, 9, 8, 9, 9, 9, 9, 9, 9, 8, 8, 9, 8, 8, 9, 9, 9, 9, 9, 9, 8, 8, 8, 9, 9, 8, 8, 8
Offset: 1

Views

Author

Keywords

Comments

Upper limit of backward value of 2^n and n!. - Simon Plouffe, Mar 23 2009

Crossrefs

Cf. A145679.

Programs

  • Python
    # upper limit of backward value of 2^n
    a,i=8,0; x=a
    while i < 200:
         i+=1; print(x, end=',')
         if a%2**(i+1) == 0: x=8
         else: x=9
         a+=x*10**i
    # Cezary Glowacz, Mar 11 2017

A158624 Upper limit of backward value of 5^n.

Original entry on oeis.org

5, 2, 6, 5, 6, 7, 9, 5, 7, 8, 7, 9, 6, 9, 9, 7, 6, 5, 7, 8, 8, 5, 5, 7, 6, 9, 7, 5, 9, 9, 5, 7, 8, 9, 5, 8, 6, 7, 7, 5, 6, 5, 6, 9, 5, 7, 5, 6, 6, 9, 6, 7, 7, 6, 7, 6, 8, 8, 5, 8, 5, 6, 7, 5, 8, 9, 6, 6, 7, 5, 9, 5, 7, 9, 8, 6, 8, 8, 7, 9, 5, 8, 8, 5, 8, 5, 9, 5, 5, 8, 9, 7, 7, 9, 7, 7, 9, 6, 7, 6, 8, 9, 7, 6, 6
Offset: 0

Views

Author

Simon Plouffe, Mar 23 2009

Keywords

Comments

Digits are all in {5,6,7,8,9} after 2nd term.
The other limit, related to odd n, is in A158625.
The first digit of the backward value of 5^n is always a(0)=5. The second digit is a(-1)=2 from n=2 on. The third digit is a(-2)=6 for all even n >= 4. The fourth digit is a(-3)=5 for n=6+4k, k >= 0. The fifth digit is a(-4)=6 for n=10+8k, k >= 0. The 6th digit is a(-5)=7 for n=10+16k, k >= 0. The 7th digit is a(-6)=9 for n=10+32k, k >= 0.

Examples

			5^3 = 125 so the backward value is 0.521, 5^10 = 9765625, so the backward value is 0.5265679. The upper limit of all values is a constant, which appears to be 0.5265679578796997657885576975995789586775656...
		

Crossrefs

Programs

  • Magma
    D:=87; e:=6; for d in [2..D-1] do t:=Modexp(5, e, 10^(d+1)); if t div 10^d lt 5 then e+:=2^(d-2); end if; end for; t:=Modexp(5, e, 10^D); IntegerToSequence(t, 10); // Jon E. Schoenfield, Feb 07 2018
  • Maple
    A158624:= proc(N)
    local m,n,A;
    m[2]:= 3;
    for n from 3 to N do
      A:= 5&^m[n-1] mod 10^n;
      if A > 5*10^(n-1) then m[n]:= m[n-1]
      else m[n]:= m[n-1]+2^(n-3)
      end if
    end do:
    convert(5&^m[N] mod 10^(N),base,10);
    end proc; # Robert Israel, Apr 01 2012
  • Mathematica
    A158624[k_] := Module[{m, n, a}, m[2] = 3; For[n = 3, n <= k, n++, a = PowerMod[5, m[n-1], 10^n]; If[ a > 5*10^(n-1), m[n] = m[n-1], m[n] = m[n-1] + 2^(n-3)]]; IntegerDigits[PowerMod[5, m[k], 10^k]] // Reverse]; A158624[105] (* Jean-François Alcover, Dec 21 2012, translated from Robert Israel's Maple program *)

A158625 Lower limit of backward value of 5^n.

Original entry on oeis.org

5, 2, 1, 3, 0, 2, 3, 3, 0, 4, 3, 1, 1, 3, 1, 1, 2, 4, 2, 1, 0, 3, 1, 3, 3, 0, 0, 0, 2, 3, 1, 4, 1, 0, 2, 1, 0, 3, 4, 3, 0, 2, 1, 2, 2, 1, 1, 4, 4, 3, 4, 0, 2, 0, 4, 0, 2, 2, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 3, 3, 2, 0, 1, 1, 4, 4, 2, 0, 1, 4, 2, 4, 1, 2, 0, 4
Offset: 1

Views

Author

Simon Plouffe, Mar 23 2009

Keywords

Comments

Digits are all in {0,1,2,3,4} after the first term.
The upper limit is A158624, 0.5265679578796997657885576975995789586775656...
The sequence is not eventually periodic. Assuming any period results in a condition a(1)=0 mod 10 which contradicts a(1)=5. - Cezary Glowacz, Jul 22 2024

Examples

			5^3 = 125 so the backward value is 0.521, 5^10 = 9765625, so backward value is 0.5265679. The lower limit of all values is a constant, which appears to be 0.521302330431131124210313300023141021034302...
From _N. J. A. Sloane_, May 11 2018: (Start)
To describe this another way:  write down the decimal expansion of powers of 5:
  1
  5
  25
  125
  625
  3125
  ...
keep going forever.
Write them backwards:
  1
  5
  52
  526
  5213
  ...
After a while the beginning digits are all the same.
That's the sequence. (End)
		

Crossrefs

Programs

  • Magma
    D:=87; e:=6; for d in [2..D-1] do t:=Modexp(5,e,10^(d+1)); if t div 10^d ge 5 then e+:=2^(d-2); end if; end for; t:=Modexp(5,e,10^D); IntegerToSequence(t,10); // Jon E. Schoenfield, Feb 05 2018
  • Python
    # lower limit of backward sequence of 5^n
    a,i=5,0; x=a
    while i < 100:
         i+=1; print(x, end=',')
         x=(-a//pow(5,i)*pow(3,i))%5; a+=x*pow(10,i)
    # Cezary Glowacz, Jul 29 2024
    

Formula

a(n) >= 0 and is the minimum satisfying (Sum_{i=1..n} a(i)*10^(i-1)) == 0 (mod 5^n), for n >= 2. - Cezary Glowacz, Jul 24 2024

A374015 Residue modulo 5 of n! divided by the highest power of 10 which divides n!.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 2, 4, 2, 3, 3, 3, 1, 3, 2, 3, 3, 1, 3, 2, 4, 4, 3, 4, 1, 4, 4, 3, 4, 1, 3, 3, 1, 3, 2, 2, 2, 4, 2, 3, 2, 2, 4, 2, 3, 1, 1, 2, 1, 4, 2, 2, 4, 2, 3, 4, 4, 3, 4, 1, 1, 1, 2, 1, 4, 1, 1, 2, 1, 4, 3, 3, 1, 3, 2, 4, 4, 3, 4, 1, 3, 3, 1, 3, 2, 2, 2, 4, 2, 3, 2, 2, 4, 2, 3, 1, 1, 2, 1, 4, 4, 4, 3, 4, 1, 3
Offset: 0

Views

Author

Cezary Glowacz, Jun 25 2024

Keywords

Comments

The sequence is not eventually periodic. This because by induction on k the eventual period must be a multiple of 5^k for every k.
a(5^k) = 2^k mod 5.
From Cezary Glowacz, Feb 07 2025: (Start)
The proportions p(m,s) of counts of pairs of consecutive terms s among a(1),...,a(m) converge to equidistribution (and as an immediate consequence, so do proportions of individual terms).
This can be seen, for example, by stating p(5^(4(n+1)+1)-1,s) as affine functions of p(5^(4n+1)-1,t) and examining the convergence of p(5^(4n+1)-1,u) to the equidistribution. Then, p(m,s) converges to the equidistribution because the maximum over s of the absolute values of deviations from 1/16 of p(m,s) for m>k*5^(4n+1)-1 is less than the corresponding maximum over t for p(5^(4n+1)-1,t) plus 2/(5^(4n+1)) + 1/k.
Consecutive terms 1,2,3 do not occur, so that triples do not have a similar equidistribution.
(End)
If n > 0 is not divisible by 5, a(n) == n * a(n-1) (mod 5). - Robert Israel, Jul 05 2024

Examples

			a(5) = 1*2*3*4*5/10 mod 5 = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (f-> irem(f/10^padic[ordp](f, 10), 5))(n!):
    seq(a(n), n=0..105);  # Alois P. Heinz, Jun 25 2024
  • Mathematica
    a[n_]:=Mod[n!/10^IntegerExponent[n!, 10],5]; Array[a,106,0] (* Stefano Spezia, Jun 25 2024 *)
  • PARI
    a(n)=if(n>4, my(k=n\5); return(lift((n%5)!*a(k)*Mod(2,5)^k))); n!%5 \\ Charles R Greathouse IV, Jan 24 2025
  • Python
    v=[[((1,1,2,1,4)[j]*2**(i*j))%5 for j in range(5)] for i in range(4)]
    def a(n):
        c,p=0,1
        while n: c,n,p=(c+1)%4,n//5,(v[c][n%5]*p)%5
        return(p) # Cezary Glowacz, Feb 05 2025
    

Formula

a(n) = A010874(A004154(n)).
Showing 1-4 of 4 results.