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!)
A144095 a(n) = number of exponents of the prime-factorization of n that occur somewhere in n when the exponents and n are represented in base 2. 3

%I #12 Nov 01 2017 09:19:20

%S 0,1,1,1,1,2,1,0,1,2,1,2,1,2,2,1,1,2,1,2,2,2,1,2,1,2,1,2,1,3,1,0,2,2,

%T 2,2,1,2,2,1,1,3,1,2,2,2,1,2,1,2,2,2,1,2,2,2,2,2,1,3,1,2,1,0,2,3,1,2,

%U 2,3,1,1,1,2,2,2,2,3,1,2,1,2,1,3,2,2,2,2,1,3,2,2,2,2,2,1,1,2,2,2,1,3,1,2,3

%N a(n) = number of exponents of the prime-factorization of n that occur somewhere in n when the exponents and n are represented in base 2.

%C a(n) = A001221(n) if n is not included in sequence A144096.

%H Antti Karttunen, <a href="/A144095/b144095.txt">Table of n, a(n) for n = 1..16384</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%e 40 has the prime-factorization 2^3 * 5^1, so the exponents are 3 and 1. 40 in binary is 101000. 3 = 11 in binary. 11 does not occur anywhere in 101000. 1 is 1 in binary. 1 does occur (twice) in 101000. So a(40) = 1, since one exponent occurs in the binary representation of n.

%e From _Antti Karttunen_, Nov 01 2017: (Start)

%e For n = 6 = 2^1 * 3^1, the binary representation "1" of exponent 1 (of 2) is found from the binary representation "110" of 6, like is found also the exponent of 3 (which is also 1), thus a(6) = 2.

%e For n = 8 = 2^3, the binary representation "11" of the only exponent 3 is not found from the binary representation "1000" of 8, thus a(8) = 0.

%e For n = 24 = 2^3 * 3^1, both the binary representation "11" of exponent 3 and the binary representation "1" of exponent 1 are found from the binary representation "11000" of 24, thus a(24) = 2.

%e (End)

%p A144095 := proc(n) local n2,a,ifa,e2,p ; n2 := convert(n,base,2) ; ifa := ifactors(n)[2] ; a := 0 ; for p in ifa do e2 := convert( op(2,p),base,2) ; if verify(n2,e2,'superlist') then a := a+1 ; fi; od: RETURN(a) ; end: for n from 1 to 200 do printf("%d,",A144095(n)) ; od: # _R. J. Mathar_, Sep 17 2008

%o (PARI)

%o is_vecsuffix(va,vb) = { my(ka=#va,kb=#vb,i=kb); if(ka < kb,0,while(i>0,if(va[(ka-kb)+i] != vb[i],return(0),i = i-1)); (1)); };

%o is_base2infix(a,b) = { my(va=binary(a),vb=binary(b)); while(#va >= #vb, if(is_vecsuffix(va,vb),return(1),a \= 2; va=binary(a))); (0); };

%o A144095(n) = vecsum(apply(e -> is_base2infix(n,e), factorint(n)[, 2])); \\ _Antti Karttunen_, Nov 01 2017

%Y Cf. A144096.

%Y Differs from A293439 for the first time at n=24.

%K base,nonn

%O 1,6

%A _Leroy Quet_, Sep 10 2008

%E More terms from _R. J. Mathar_, Sep 17 2008

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 August 12 18:44 EDT 2024. Contains 375113 sequences. (Running on oeis4.)