%I #52 Feb 09 2023 07:24:17
%S 11,13,23,47,193,383,577
%N Primes p such that the number of odd divisors of p-1 is a prime q which is equal to the number of odd divisors of p+1.
%C Conjecture: this sequence is finite.
%C Any further terms are greater than 10^10. - _Charles R Greathouse IV_, Aug 22 2016
%C Any further terms are greater than 2 * 10^12. - _Dana Jacobsen_, Aug 30 2016
%e 11 is in this sequence because there are 2 odd divisors 1 and 5 of 10 and there are 2 odd divisors 1 and 3 of 12, and 2 is a prime.
%p filter:= proc(p) local r,q;
%p r:= numtheory:-tau((p-1)/2^padic:-ordp(p-1,2));
%p if not isprime(r) then return false fi;
%p r = numtheory:-tau((p+1)/2^padic:-ordp(p+1,2))
%p end proc:
%p res:= NULL: p:= 0:
%p while p < 1000 do
%p p:= nextprime(p);
%p if filter(p) then
%p res:= res, p;
%p fi;
%p od:
%p res; # _Robert Israel_, Aug 24 2016
%t okQ[p_?PrimeQ] := Module[{r}, r = DivisorSigma[0, (p-1)/2^IntegerExponent[p-1, 2]]; If[!PrimeQ[r], Return[False]]; r == DivisorSigma[0, (p+1)/2^IntegerExponent[p+1, 2]]];
%t Select[Prime[Range[1000]], okQ] (* _Jean-François Alcover_, Feb 09 2023, after _Robert Israel_ *)
%o (Perl) use ntheory ":all"; forprimes { $n1 = scalar(grep { $_&1 } divisors($_-1)); say if is_prime($n1) && $n1 == scalar(grep { $_&1 } divisors($_+1)); } 1e7; # _Dana Jacobsen_, Aug 24 2016
%o (PARI) f(n)=numdiv(n>>valuation(n,2))
%o is(n)=if(!isprime(n), return(0)); my(q=f(n-1)); isprime(q) && f(n+1)==q \\ _Charles R Greathouse IV_, Aug 24 2016
%Y Cf. A001227, A275418.
%K nonn
%O 1,1
%A _Juri-Stepan Gerasimov_, Aug 23 2016