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.

This page as a plain text file.
%I A165319 #20 Jul 30 2025 17:39:10
%S A165319 2,5,7,13,23,29,37,41,53,61,73,101,103,109,113,127,137,151,157,167,
%T A165319 173,181,193,229,257,263,269,277,281,311,313,317,353,373,383,389,397,
%U A165319 401,409,421,433,439,457,461,487,509,541,569,593,601,613,617,631,641,653
%N A165319 Primes p where the number of divisors of p+1 is a power of 2.
%H A165319 Alois P. Heinz, <a href="/A165319/b165319.txt">Table of n, a(n) for n = 1..20000</a>
%p A165319 b:= proc(n) option remember; is(n=2^ilog2(n)) end:
%p A165319 a:= proc(n) option remember; local p; p:= `if`(n=1, 1, a(n-1));
%p A165319       do p:= nextprime(p);
%p A165319          if andmap(b, map(i-> i[2]+1, ifactors(p+1)[2])) then break fi
%p A165319       od; p
%p A165319     end:
%p A165319 seq(a(n), n=1..55);  # _Alois P. Heinz_, Sep 05 2019
%t A165319 okQ[p_] := PrimeQ[p] && IntegerQ[Log[2, DivisorSigma[0, p+1]]];
%t A165319 Select[Prime[Range[200]], okQ] (* _Jean-François Alcover_, May 20 2020 *)
%t A165319 Select[Prime[Range[150]],IntegerQ[Log2[DivisorSigma[0,#+1]]]&] (* _Harvey P. Dale_, Jul 30 2025 *)
%o A165319 (PARI) isok(p) = isprime(p) && (nd = numdiv(p+1)) && (nd == 2^valuation(nd, 2)); \\ _Michel Marcus_, Sep 05 2019
%Y A165319 Cf. A165318, A165320.
%Y A165319 Cf. A008329. [_R. J. Mathar_, Sep 20 2009]
%K A165319 nonn
%O A165319 1,1
%A A165319 _Leroy Quet_, Sep 14 2009
%E A165319 Extended by _R. J. Mathar_, Sep 20 2009