%I #33 Jan 26 2024 08:34:37
%S 1,3,5,17,217,257,387,8209,20137,37025,59141,65537,283801,649801,
%T 1382401,373164545,535019101,2453039425,4294967297
%N Numbers m such that 4^(m-1) == 1 (mod (m-1)^2 + 1).
%C Also, numbers m such that (4^k)^(m-1) == 1 (mod (m-1)^2 + 1) for all k >= 0.
%C a(20) > 2*10^12, if it exists. - _Giovanni Resta_, Feb 26 2020
%F a(n) = sqrt(A273999(n)-1) + 1. - _Jinyuan Wang_, Feb 24 2020
%e 5 is a term because 4^(5-1) == 1 (mod (5-1)^2+1), i.e., 255 == 0 (mod 17).
%o (Magma) [n: n in [1..100000] | (4^(n-1)-1) mod ((n-1)^2+1) eq 0]
%o (PARI) isok(n) = Mod(4, (n-1)^2+1)^(n-1) == 1; \\ _Michel Marcus_, Jun 02 2016
%Y Prime terms are in A273871.
%Y Contains A000215 (Fermat numbers) as subsequence.
%Y Contains 1 + A247220 as subsequence.
%Y Cf. A019434, A273999.
%K nonn,more
%O 1,2
%A _Jaroslav Krizek_, Jun 01 2016
%E a(14)-a(15) from _Michel Marcus_, Jun 02 2016
%E Edited by _Max Alekseyev_, Apr 30 2018
%E a(16)-a(19) from _Jinyuan Wang_, Feb 24 2020