%I #48 Feb 16 2025 08:32:35
%S 2,3,5,11,23,47,283,719,1439,2879,34549,138197,531441,1594323,4782969,
%T 14348907,43046721,86093443,344373773,688747547,3486784401
%N Smallest k such that 2^^n is not congruent to 2^^(n-1) mod k, where 2^^n denotes the power tower 2^2^...^2 (in which 2 appears n times).
%C This sequence shares many terms with A056637, the least prime of class n-. Note that 3^(n-1) is an upper bound for each term and the upper bound is reached for n=13 and n=14. Are all subsequent terms 3^(n-1)? The Mathematica code uses the TowerMod function in the CNT package, which is described in the book by Bressoud and Wagon. - _T. D. Noe_, Mar 13 2009
%C For n=15, n=16, and n=17, the terms are also of the form 3^(n-1), but for n=18 and n=19, the terms are prime. - _Wayne VanWeerthuizen_, Aug 26 2014
%C A185816(a(n)) = n. - _Reinhard Zumkeller_, Sep 02 2014
%C Prime terms seen up to n=20 are in eleven instances of the form j*a(n-1)+1, for j=2, 4, 6, or 12. Note, though, that a(2)=5 and a(8)=719 are exceptions to this pattern. - _Wayne VanWeerthuizen_, Sep 06 2014
%D David Bressoud and Stan Wagon, A Course in Computational Number Theory, Key College Pub., 2000, p. 96.
%D Stan Wagon, posting to Problem of the Week mailing list, Dec 15 1997.
%H D. Bressoud, <a href="http://www.macalester.edu/~bressoud/books/CNT.m">CNT.m</a> Computational Number Theory Mathematica package.
%H Stan Wagon, <a href="http://mathforum.org/wagon/fall97/putnam.html">Putnam Problem Notes</a>
%H Eric W. Weisstein, <a href="https://mathworld.wolfram.com/PowerTower.html">MathWorld: Power Tower</a>
%e 2^^2=2^2=4 and 2^^3=2^2^2=16. We find 4 = 16 (mod k) until k=5. So a(3)=5. - _T. D. Noe_, Mar 13 2009
%t Needs["CNT`"]; k=1; Table[While[TowerMod[2,n,k]==TowerMod[2,n-1,k], k++ ]; k, {n,10}] (* _T. D. Noe_, Mar 13 2009 *)
%Y Cf. A056637, A173927, A185816, A246491.
%K nonn,more
%O 1,1
%A _R. K. Guy_
%E Improved the name and changed the offset because I just prepended a term. - _T. D. Noe_, Mar 13 2009
%E Corrected and extended by _T. D. Noe_, Mar 13 2009
%E Terms a(15)-a(19) from _Wayne VanWeerthuizen_, Aug 26 2014
%E Terms a(20)-a(21) from _Wayne VanWeerthuizen_, Sep 06 2014