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.

A307512 a(n) is the smallest k > 2^n such that 2^(k-1) == 1 (mod (2^n-1)*k).

Original entry on oeis.org

3, 5, 13, 17, 41, 67, 197, 257, 523, 1031, 2069, 4129, 8243, 16451, 32911, 65537, 131479, 262153, 524591, 1048601, 2097229, 4194389, 8388791, 16777441, 33554501, 67108913, 134217757, 268435889, 536871259, 1073741971, 2147484949, 4294967297, 8589934651, 17179869827
Offset: 1

Views

Author

Thomas Ordowski, Apr 12 2019

Keywords

Comments

a(n) = smallest k > 2^n such that k == 1 (mod n) and 2^(k-1) == 1 (mod k), so a(n) is an odd prime or a pseudoprime (Fermat pseudoprime to base 2).
Conjecture: a(n) is composite if and only if n = 2^j and 2^(2^j) + 1 is composite (presumably for all j > 4).
Note that a(2^j) = 2^(2^j) + 1 = A000215(j), the Fermat numbers.
For n <> 2^j, a(n) is the smallest k = 2^n - (2^n mod n) + m*n + 1 for m > 0 such that 2^(k-1) == 1 (mod k).
The last definition, also without the condition n <> 2^j, probably gives only primes.

Examples

			a(32) = 2^(2^5) + 1 = 641*6700417 is the smallest composite term.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 2^n + 1}, While[PowerMod[2, k - 1, (2^n - 1)*k] != 1, k++]; k]; Array[a, 50] (* Amiram Eldar, Apr 12 2019 *)
  • PARI
    a(n) = my(k=2^n+1); while( Mod(2, (2^n-1)*k)^(k-1) != 1, k++); k; \\ Michel Marcus, Apr 25 2019

Formula

a(n) == 1 (mod n).
a(2^j) = A000215(j).

Extensions

More terms from Amiram Eldar, Apr 12 2019