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

A092188 a(n) = smallest positive integer m such that 2^3^4^5^...^n == m (mod n).

Original entry on oeis.org

2, 2, 4, 2, 2, 1, 8, 8, 2, 2, 8, 5, 8, 2, 16, 2, 8, 18, 12, 8, 2, 16, 8, 2, 18, 26, 8, 11, 2, 2, 32, 2, 2, 22, 8, 31, 18, 5, 32, 2, 8, 27, 24, 17, 16, 8, 32, 43, 2, 2, 44, 45, 26, 2, 8, 56, 40, 47, 32, 33, 2, 8, 64, 57, 2, 5, 36, 62, 22, 60, 8, 1, 68, 2, 56, 57, 44, 8, 32, 80, 2, 2, 8, 2, 70
Offset: 2

Views

Author

N. J. A. Sloane, following a suggestion of J. H. Conway, Apr 02 2004

Keywords

Examples

			2^3^4^5 = 2^3^1024. But 3 == -1 (mod 4), so 3^1024 == 1 (mod 4), so 2^3^1024 == 2^1 (mod 5) since 2^4 == 1 (mod 5). Thus a(5) = 2.
		

Formula

a(n) = n if n is a power of 2; otherwise a(n) = (2^3^4^5^...^n) mod n = A213013(n). [From Max Alekseyev, Jun 02 2012]

Extensions

More terms from Robert Munafo, Apr 11 2004

A373495 a(1) = 2; thereafter, a(n) = prime(n)^prime(n-1) (mod 10).

Original entry on oeis.org

2, 9, 5, 7, 1, 7, 7, 9, 7, 9, 1, 3, 1, 3, 3, 7, 9, 1, 7, 1, 7, 9, 7, 9, 7, 1, 3, 3, 9, 3, 7, 1, 3, 9, 9, 1, 3, 3, 3, 7, 9, 1, 1, 7, 7, 9, 1, 7, 3, 9, 3, 9, 1, 1, 3, 3, 9, 1, 3, 1, 3, 7, 7, 1, 7, 7, 1, 3, 7, 9, 3, 9, 3, 7, 9, 7, 9, 7, 1, 9, 9, 1, 1, 7, 9, 7, 9, 7, 1, 3, 3, 9, 3, 1, 9, 7, 9, 1, 3, 1, 7, 3, 3, 9, 1
Offset: 1

Views

Author

Robert G. Wilson v, Jun 06 2024

Keywords

Comments

This sequence is not periodic.

Examples

			a(2) = 3^2 (mod 10) = 9.
a(3) = 5^3 (mod 10) = 5.
		

References

  • Ilan Vardi, "Computational Recreations in Mathematica," Addison-Wesley Publishing, Redwood City, CA, 1991, p. 226-229.

Crossrefs

Programs

  • Mathematica
    a[n_] := Switch[ Mod[ Prime[n], 10], 1, 1, 3, If[ Mod[ Prime[n -1], 4] == 1, 3, 7], 5, 5, 7, If[ Mod[ Prime[n -1], 4] == 1, 7, 3], 9, 9]; a[1] = 2; a[2] = 9; Array[a, 105]
    Join[{2}, Map[PowerMod[#[[2]], #[[1]], 10] &, Partition[Prime[Range[100]], 2, 1]]] (* Paolo Xausa, Jul 14 2025 *)
  • PARI
    a(n) = if(n<2, 2, lift(Mod(prime(n),10)^prime(n-1))) \\ Hugo Pfoertner, Jul 07 2024

Formula

a(n) = A078422(n-1) mod 10. - R. J. Mathar, Jul 14 2025
Showing 1-2 of 2 results.