A373495 a(1) = 2; thereafter, a(n) = prime(n)^prime(n-1) (mod 10).
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
Keywords
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.
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
- Robert P. Munafo, Hypercalc - The Calculator That Doesn't Overflow.
- Robert P. Munafo, Sequence A092188, Smallest Positive Integer M such that 2^3^4^5^...^N = M mod N.
- Robert G. Wilson v, Mathematica coding for "SuperPowerMod" from Vardi.
- Wolfram cloud Function Repository, PowerTowerMod.
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
Comments