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.

A366982 a(n) is the smallest odd k > 1 such that n^((k+1)/2) == n (mod k).

This page as a plain text file.
%I A366982 #31 Jan 16 2025 14:17:12
%S A366982 3,3,7,3,3,5,3,3,7,3,3,5,3,3,5,3,3,9,3,3,5,3,3,7,3,3,5,3,3,5,3,3,7,3,
%T A366982 3,5,3,3,11,3,3,5,3,3,5,3,3,11,3,3,5,3,3,7,3,3,5,3,3,5,3,3,9,3,3,5,3,
%U A366982 3,13,3,3,5,3,3,5,3,3,7,3,3,5,3,3,17,3,3
%N A366982 a(n) is the smallest odd k > 1 such that n^((k+1)/2) == n (mod k).
%C A366982 If this sequence is bounded, then it is periodic with period P = LCM(A), where A is the set of all (pairwise distinct) terms.
%C A366982 Note that n^((1729+1)/2) == n (mod 1729) for every n >= 0, where 1729 is the smallest absolute Euler pseudoprime (A033181).
%C A366982 Thus a(n) <= 1729. So, as said, this sequence is periodic.
%C A366982 What is its period?
%C A366982 If the largest term of this sequence is indeed 1729, it should be expected that its period P may be longer than the period of Euler primary pretenders (A309316), namely P > 41#*571#/4 (248 digits).
%H A366982 Antti Karttunen, <a href="/A366982/b366982.txt">Table of n, a(n) for n = 0..65537</a>
%t A366982 a[n_] := Module[{k = 3}, While[PowerMod[n, (k + 1)/2, k] != Mod[n, k], k += 2]; k]; Array[a, 100, 0] (* _Amiram Eldar_, Oct 30 2023 *)
%o A366982 (PARI) a(n) = my(k=3); while (Mod(n, k)^((k+1)/2) != n, k+=2); k; \\ _Michel Marcus_, Oct 31 2023
%Y A366982 Cf. A033181, A309316, A366930, A366973.
%K A366982 nonn
%O A366982 0,1
%A A366982 _Thomas Ordowski_, Oct 30 2023
%E A366982 More terms from _Amiram Eldar_, Oct 30 2023