login
Primes p such that p-1 and p+1 have the same number of prime factors with multiplicity.
6

%I #18 May 08 2022 17:14:11

%S 5,19,29,43,67,89,151,173,197,233,271,283,307,317,349,461,491,569,571,

%T 593,653,701,739,751,787,857,859,907,919,1013,1061,1097,1277,1291,

%U 1303,1483,1667,1747,1831,1867,1889,1913,1973,2003,2083,2131,2311,2357,2393

%N Primes p such that p-1 and p+1 have the same number of prime factors with multiplicity.

%H Alois P. Heinz, <a href="/A115103/b115103.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Vincenzo Librandi)

%e 19-1 = 2*3*3 has 3 factors. 19+1 = 2*2*5 has 3 factors. So 19 is in the table.

%p isA115103 := proc(n)

%p if not type(n,prime) then

%p return false;

%p end if;

%p if numtheory[bigomega](n-1) <> numtheory[bigomega](n+1) then

%p false;

%p else

%p true ;

%p end if ;

%p end proc:

%p for n from 2 to 3000 do

%p if isA115103(n) then

%p printf("%d,",n) ;

%p end if;

%p end do: # _R. J. Mathar_, Feb 13 2019

%p # second Maple program:

%p q:= p-> isprime(p) and (f-> f(p+1)=f(p-1))(numtheory[bigomega]):

%p select(q, [$1..3000])[]; # _Alois P. Heinz_, May 08 2022

%t Select[Prime[Range[400]],PrimeOmega[#-1]==PrimeOmega[#+1]&] (* _Harvey P. Dale_, Apr 26 2014 *)

%o (PARI) g(n) = forprime(x=1,n,p1=bigomega(x-1);p2=bigomega(x+1);if(p1==p2,print1(x",")))

%Y Cf. A067386 (without multiplicity), A323498, A323536, A323537.

%K easy,nonn

%O 1,1

%A _Cino Hilliard_, Mar 02 2006