The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A278909 Binary Smith numbers: composite numbers n such that sum of bits of n = sum of bits of prime factors of n (counted with multiplicity). 11

%I #31 Apr 22 2021 21:54:40

%S 15,51,55,85,125,159,185,190,205,215,222,238,246,249,253,287,303,319,

%T 374,407,438,442,469,471,475,489,494,501,507,591,623,639,670,679,687,

%U 699,730,745,755,763,765,771,799,807,822,830,843,867,890,893,917,923,925,935,939,951,970,973,979,986,989,995,1010,1015,1017,1020,1023,1135,1167,1203,1243

%N Binary Smith numbers: composite numbers n such that sum of bits of n = sum of bits of prime factors of n (counted with multiplicity).

%C Binary equivalent of A006753 as well as A176670. (Since bits can only be 0 or 1, having equal sums of bits is logically equivalent to having the same nonzero bits.)

%C There are 615 terms up to 10^4, 6412 up to 10^5, 66369 up to 10^6, 630106 up to 10^7, 6268949 up to 10^8, 62159262 up to 10^9, and 596587090 up to 10^10. - _Charles R Greathouse IV_, Dec 09 2016

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

%e a(1) = 15, as 15 (1111) in binary has the same number of 1 bits as its prime factors (11 and 101).

%t Select[Range@ 1250, And[CompositeQ@ #, DigitCount[#, 2, 1] = Total@ Flatten@ Apply[DigitCount[#, 2, 1] & /@ ConstantArray[#1, #2] &, FactorInteger@ #, 1]] &] (* _Michael De Vlieger_, Dec 02 2016 *)

%o (SageMath)

%o def numfactorbits(x):

%o if(x<2):

%o return 0;

%o s=0;

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

%o #ensures inequality of numfactorbits(x) and bin(x).count("1") if x is prime

%o if((len(f)==1)&(f[0][1]==1)):

%o return 0;

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

%o s+=bin(f[c][0]).count("1")*f[c][1]

%o return s;

%o counter=2

%o index=1

%o while(index<=10000):

%o if(numfactorbits(counter)==bin(counter).count("1")):

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

%o index+=1;

%o counter+=1;

%o (PARI) is(n) = my(f=factor(n)[, 1]~, expo=factor(n)[, 2]~, v=[], s=0); for(k=1, #f, while(expo[k] > 0, expo[k]--; v=concat(v, f[k]))); for(k=1, #v, v[k]=binary(v[k])); my(w=[]); for(y=1, #v, w=concat(w, v[y])); if(vecsum(w)==vecsum(binary(n)), return(1), return(0))

%o terms(n) = my(i=0); forcomposite(c=1, , if(is(c), print1(c, ", "); i++; if(i==n, break)))

%o /* Print initial 70 terms as follows: */

%o terms(70) \\ _Felix Fröhlich_, Dec 01 2016

%o (PARI) is(n)=my(f=factor(n),t=#f~); (t>1 || (t==1 && f[1,2]>1)) && hammingweight(n)==sum(i=1,t, hammingweight(f[i,1])*f[i,2]) \\ _Charles R Greathouse IV_, Dec 02 2016

%o (Python)

%o from sympy import factorint

%o def sbd(n): return bin(n).count('1')

%o def ok(n):

%o f = factorint(n)

%o return sum(f[p] for p in f) > 1 and sbd(n) == sum(sbd(p)*f[p] for p in f)

%o print(list(filter(ok, range(1244)))) # _Michael S. Branicky_, Apr 22 2021

%Y Cf. A006753, A176670.

%K nonn,base,easy

%O 1,1

%A _Ely Golden_, Nov 30 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 13 03:50 EDT 2024. Contains 372497 sequences. (Running on oeis4.)