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.

A381923 a(n) is the least k >= 2 such that (2^k - 1) mod (n*k - 1) = 0.

This page as a plain text file.
%I A381923 #20 Mar 12 2025 12:26:21
%S A381923 2,2,12,4,24,216,792,32,144,4410,396,108,208,1880,3192,16,9240,72,24,
%T A381923 6048,264,2160,1872,270,20916,104,5292,940,360,1596,756,8,132,4620,
%U A381923 1260,36,1728,12,49500,3024,7560,3168,1440,1080,2688,936,1344,1035,44100,28800
%N A381923 a(n) is the least k >= 2 such that (2^k - 1) mod (n*k - 1) = 0.
%C A381923 a(n) is even if n is odd. - _Robert Israel_, Mar 12 2025
%H A381923 Robert Israel, <a href="/A381923/b381923.txt">Table of n, a(n) for n = 1..2500</a>
%e A381923 n = 1: (2^k - 1) mod (1*k - 1) = 0 is true for least k = 2, thus a(1) = 2.
%e A381923 n = 3: (2^k - 1) mod (3*k - 1) = 0 is true for least k = 12, thus a(3) = 12.
%p A381923 f:= proc(n) local k;
%p A381923       for k from 2 by (n mod 2 + 1) do if 2 &^k - 1 mod (n*k-1) = 0 then return k fi od
%p A381923 end proc:
%p A381923 map(f, [$1..200]); # _Robert Israel_, Mar 12 2025
%t A381923 a[n_] := Module[{k = 2}, While[n*k-1 != 1 && PowerMod[2, k, n*k-1] != 1, k++]; k]; Array[a, 50] (* _Amiram Eldar_, Mar 10 2025 *)
%o A381923 (PARI) a(n) = my(k=2); while (Mod(2, n*k-1)^k != 1, k++); k; \\ _Michel Marcus_, Mar 10 2025
%Y A381923 Cf. A000225, A081856, A087965.
%K A381923 nonn
%O A381923 1,1
%A A381923 _Ctibor O. Zizka_, Mar 10 2025