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.

A165319 Primes p where the number of divisors of p+1 is a power of 2.

Original entry on oeis.org

2, 5, 7, 13, 23, 29, 37, 41, 53, 61, 73, 101, 103, 109, 113, 127, 137, 151, 157, 167, 173, 181, 193, 229, 257, 263, 269, 277, 281, 311, 313, 317, 353, 373, 383, 389, 397, 401, 409, 421, 433, 439, 457, 461, 487, 509, 541, 569, 593, 601, 613, 617, 631, 641, 653
Offset: 1

Views

Author

Leroy Quet, Sep 14 2009

Keywords

Crossrefs

Cf. A008329. [R. J. Mathar, Sep 20 2009]

Programs

  • Maple
    b:= proc(n) option remember; is(n=2^ilog2(n)) end:
    a:= proc(n) option remember; local p; p:= `if`(n=1, 1, a(n-1));
          do p:= nextprime(p);
             if andmap(b, map(i-> i[2]+1, ifactors(p+1)[2])) then break fi
          od; p
        end:
    seq(a(n), n=1..55);  # Alois P. Heinz, Sep 05 2019
  • Mathematica
    okQ[p_] := PrimeQ[p] && IntegerQ[Log[2, DivisorSigma[0, p+1]]];
    Select[Prime[Range[200]], okQ] (* Jean-François Alcover, May 20 2020 *)
    Select[Prime[Range[150]],IntegerQ[Log2[DivisorSigma[0,#+1]]]&] (* Harvey P. Dale, Jul 30 2025 *)
  • PARI
    isok(p) = isprime(p) && (nd = numdiv(p+1)) && (nd == 2^valuation(nd, 2)); \\ Michel Marcus, Sep 05 2019

Extensions

Extended by R. J. Mathar, Sep 20 2009