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.

A382811 Integers k such that d*2^k - 1 is prime for some divisor d of k.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 10, 12, 13, 16, 17, 18, 19, 21, 28, 30, 31, 36, 42, 46, 54, 60, 61, 63, 75, 81, 88, 89, 99, 102, 104, 106, 107, 108, 115, 123, 126, 127, 132, 133, 204, 214, 216, 225, 249, 264, 270, 286, 304, 306, 324, 330, 342, 352, 362, 384, 390
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 15 2025

Keywords

Examples

			4 is in the sequence because 2*2^4 - 1 = 31 is prime for divisor d = 2 of k = 4.
		

Crossrefs

Supersequence of A000043, A002234.

Programs

  • Magma
    [k: k in [1..400] | not #[d: d in Divisors(k) | IsPrime(d*2^k-1)] eq 0];
    
  • Maple
    filter:= proc(k) ormap(d -> isprime(d*2^k-1),numtheory:-divisors(k)) end proc:
    select(filter, [$1..700]); # Robert Israel, Apr 25 2025
  • Mathematica
    q[k_] := AnyTrue[Divisors[k], PrimeQ[#*2^k - 1] &]; Select[Range[400], q] (* Amiram Eldar, Apr 16 2025 *)
  • PARI
    isok(k) = fordiv(k, d, if (ispseudoprime(d*2^k-1), return(1))); \\ Michel Marcus, Apr 16 2025