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.

Original entry on oeis.org

2, 2, 12, 4, 24, 216, 792, 32, 144, 4410, 396, 108, 208, 1880, 3192, 16, 9240, 72, 24, 6048, 264, 2160, 1872, 270, 20916, 104, 5292, 940, 360, 1596, 756, 8, 132, 4620, 1260, 36, 1728, 12, 49500, 3024, 7560, 3168, 1440, 1080, 2688, 936, 1344, 1035, 44100, 28800
Offset: 1

Views

Author

Ctibor O. Zizka, Mar 10 2025

Keywords

Comments

a(n) is even if n is odd. - Robert Israel, Mar 12 2025

Examples

			n = 1: (2^k - 1) mod (1*k - 1) = 0 is true for least k = 2, thus a(1) = 2.
n = 3: (2^k - 1) mod (3*k - 1) = 0 is true for least k = 12, thus a(3) = 12.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
          for k from 2 by (n mod 2 + 1) do if 2 &^k - 1 mod (n*k-1) = 0 then return k fi od
    end proc:
    map(f, [$1..200]); # Robert Israel, Mar 12 2025
  • Mathematica
    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 *)
  • PARI
    a(n) = my(k=2); while (Mod(2, n*k-1)^k != 1, k++); k; \\ Michel Marcus, Mar 10 2025