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.

A245974 Tower of 7's mod n.

This page as a plain text file.
%I A245974 #23 Sep 21 2022 04:15:45
%S A245974 0,1,1,3,3,1,0,7,7,3,2,7,6,7,13,7,12,7,7,3,7,13,20,7,18,19,16,7,1,13,
%T A245974 19,23,13,29,28,7,34,7,19,23,26,7,7,35,43,43,37,7,0,43,46,19,11,43,13,
%U A245974 7,7,1,7,43,6,19,7,55,58,13,63,63,43,63,66,7,30
%N A245974 Tower of 7's mod n.
%C A245974 a(n) = (7^(7^(7^(7^(7^ ... ))))) mod n, provided sufficient 7's are in the tower such that adding more doesn't affect the value of a(n).
%H A245974 Wayne VanWeerthuizen, <a href="/A245974/b245974.txt">Table of n, a(n) for n = 1..10000</a>
%F A245974 a(n) = 7^a(A000010(n)) mod n. For n <= 10, a(n) = (7^7) mod n.
%e A245974 a(2) = 1, as 7^X is odd for any whole number X.
%e A245974 a(11) = 2, as 7^(7^7) == 7^(7^(7^7)) == 7^(7^(7^(7^7))) == 2 (mod 11).
%p A245974 A:= proc(n) option remember; 7 &^ A(numtheory:-phi(n)) mod n end proc:
%p A245974 A(2):= 1;
%p A245974 seq(A(n), n=2..100);
%t A245974 a[n_] := a[n] = Switch[n, 1, 0, 2, 1, _, 7^a[EulerPhi[n]]]~Mod~n;
%t A245974 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Sep 21 2022 *)
%o A245974 (Sage)
%o A245974 def a(n):
%o A245974     if ( n <= 10 ):
%o A245974         return 823543%n
%o A245974     else:
%o A245974         return power_mod(7,a(euler_phi(n)),n)
%Y A245974 Cf. A240162, A245970, A245971, A245972, A245973.
%K A245974 nonn,easy
%O A245974 1,4
%A A245974 _Wayne VanWeerthuizen_, Aug 08 2014