[go: up one dir, main page]

login
Numbers n such that n-1 has the same number of prime factors as n (with multiplicity).
5

%I #34 Nov 30 2016 13:05:54

%S 3,10,15,22,26,28,34,35,39,45,58,76,86,87,94,95,99,117,119,122,123,

%T 125,134,136,142,143,146,148,154,159,165,171,172,175,178,202,203,206,

%U 214,215,218,219,231,245,246,254,285,286,297,299,302,303,327,333,335,351,357,362,370,376,382,388,394,395

%N Numbers n such that n-1 has the same number of prime factors as n (with multiplicity).

%H Ely Golden, <a href="/A278291/b278291.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A045920(n) + 1. - _Robert G. Wilson v_, Nov 17 2016

%e a(1)=3, as both 2 and 3 have 1 prime factor. a(2)=10, as both 9 and 10 have 2 prime factors. a(3)=15, as both 14 and 15 have 2 prime factors.

%t fQ[n_] := PrimeOmega[n - 1] == PrimeOmega[n]; Select[Range@400, fQ] (* _Robert G. Wilson v_, Nov 17 2016 *)

%o (Java) public class A278291{

%o public static void main(String[] args)throws Exception{

%o long dim0=numberOfPrimeFactors(2);//note that this method must be manually implemented by the user

%o long dim1;

%o long counter=3;

%o long index=1;

%o while(index<=10000){

%o dim1=numberOfPrimeFactors(counter);

%o if(dim1==dim0){System.out.println(index+" "+counter);index++;}

%o dim0=dim1;

%o counter++;

%o }

%o }

%o }

%o (SageMath)

%o def bigomega(x):

%o s=0;

%o f=list(factor(x));

%o for c in range(len(f)):

%o s+=f[c][1]

%o return s;

%o dim0=bigomega(2);

%o counter=3

%o index=1

%o while(index<=10000):

%o dim1=bigomega(counter);

%o if(dim1==dim0):

%o print(str(index)+" "+str(counter))

%o index+=1;

%o dim0=dim1;

%o counter+=1;

%o (PARI) is(n) = bigomega(n)==bigomega(n-1) \\ _Felix Fröhlich_, Nov 17 2016

%K nonn

%O 1,1

%A _Ely Golden_, Nov 16 2016