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

A386005 Number of stable digits of the integer tetration n^^n (i.e., maximum nonnegative integer m such that n^^n is congruent modulo 10^m to n^^(n + 1)), or -1 if n is a multiple of 10.

Original entry on oeis.org

0, 2, 3, 12, 7, 12, 7, 9, -1, 12, 11, 13, 13, 61, 17, 17, 32, 19, -1, 22, 20, 22, 46, 78, 54, 26, 27, 29, -1, 32, 62, 33, 33, 71, 37, 37, 36, 39, -1, 42, 40, 84, 43, 92, 47, 46, 47, 98, -1, 103, 51, 53, 53, 166, 57, 171, 56, 59, -1, 62, 60, 62, 63, 396, 67, 66
Offset: 2

Views

Author

Marco Ripà, Jul 14 2025

Keywords

Comments

If n is divisible by 10, the corresponding a(n) would be too large to be include in the data section (it would be equal to the number of trailing zeros that appear at the end of n^^n).
This sequence directly follows from the constancy of the "congruence speed" property characterizing tetration (for an explicit formula to calculate a(n) for any n not a multiple of 10, see the linked paper entitled "Number of stable digits of any integer tetration").

Examples

			For n = 5, 5^5^5^5^5 is congruent to 5^5^5^5^5^5 (mod 10^12) and 5^5^5^5^5 is not congruent to 5^5^5^5^5^5 (mod 10^13). Thus, a(5) = 12.
		

References

  • Marco Ripà, La strana coda della serie n^n^...^n, Trento, UNI Service, Nov 2011. ISBN 978-88-6178-789-6.

Crossrefs

Programs

  • Python
    def last_k_digits_tetration(base, height, k):
        mod = 10 ** k
        result = base
        for _ in range(height - 1):
            result = pow(base, result, mod)
        return str(result).zfill(k)
    def count_stable_digits(base, k=500):
        try:
            x = last_k_digits_tetration(base, base, k)
            y = last_k_digits_tetration(base, base + 1, k)
            count = 0
            for i in range(1, k + 1):
                if x[-i] == y[-i]:
                    count += 1
                else:
                    break
            return count
        except:
            return -1
    for n in range(2, 101):
        if n % 10 == 0:
            print(f"n = {n}: -1")
        else:
            print(f"n = {n}: {count_stable_digits(n)}")

Formula

If n == 0 (mod 10), then a(n) = -1, and a(n) = A356946(n) otherwise.

A385978 Number of trailing zeros in (10*n)^(10*n).

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 90, 200, 110, 120, 130, 140, 150, 160, 170, 180, 190, 400, 210, 220, 230, 240, 250, 260, 270, 280, 290, 600, 310, 320, 330, 340, 350, 360, 370, 380, 390, 800, 410, 420, 430, 440, 450, 460, 470, 480, 490, 1000, 510, 520, 530, 540
Offset: 1

Views

Author

Marco Ripà, Jul 13 2025

Keywords

Examples

			a(2) = 20 since 20^(10*2) = 104857600000000000000000000 has 20 trailing zeros.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := 10 n (IntegerExponent[n, 10] + 1)  Table[a[n], {n, 1, 30}]
  • PARI
    a(n) = 10*n*(valuation(n,10)+1); \\ Michel Marcus, Jul 14 2025

Formula

a(n) = 10*n*(A122840(n) + 1).

A386008 a(n) = A386005(n) - n*A373387(n).

Original entry on oeis.org

-2, -1, -1, 2, 1, -2, -1, 0, 9, 1, -1, 0, -1, 1, 1, 0, -4, 0, 19, 1, -2, -1, -2, 3, 2, -1, -1, 0, 29, 1, -2, 0, -1, 1, 1, 0, -2, 0, 39, 1, -2, -2, -1, 2, 1, -1, -1, 0, 49, 1, -1, 0, -1, 1, 1, 0, -2, 0, 59, 1, -2, -1, -1, 6, 1, -1, -3, 0, 69, 1, -1, 0, -2, 1, 2
Offset: 2

Views

Author

Marco Ripà, Jul 14 2025

Keywords

Comments

Assuming that n is not a multiple of 10, this sequence measures the difference between the number of stable digits in n^^n and the product of n times the constant congruence speed of n (see A373387 and A317905).
A negative value of a(n) means that, on average, each iteration n^^b --> n^^(b+1), with b < A372490(n), contributes fewer stable digits than what will be contributed per step once the congruence speed of n reaches its constant value.
Positive values also imply the existence of a pre-period for the given n, and indicate that its average contribution per step exceeds the constant congruence speed of n.
If n == 5 (mod 10) and n <> 5, the pre-period of the congruence speed always has length 2 (i.e., A372490(n) = 3). However, the number of stable digits observed up to that point follows two distinct rules: if n = 20*k + 5 (for positive integer k), then a(n) = (n + 1)*A373387(n); if n = 20*(k - 1) + 15, then it is n*A373387(n) + 1. The resulting residue is A373387(n) in the former case, and 1 in the latter. For n = 5, the pre-period has length 3 (and this is the only such case for n ending in 5).

Examples

			a(3) = -1 since 3^3^3 == 3^3^3^3 (mod 10^2) while 3^3^3 <> 3^3^3^3 (mod 10^3), and the constant congruence speed of 3 is equal to 1. Thus, a(3) = 2 - 3*1.
		

References

  • Marco Ripà, La strana coda della serie n^n^...^n, Trento, UNI Service, Nov 2011. ISBN 978-88-6178-789-6.

Crossrefs

Showing 1-3 of 3 results.