cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Leroy Quet, Sep 10 2008

Keywords

Comments

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

Examples

			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.
From _Antti Karttunen_, Nov 01 2017: (Start)
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.
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.
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.
(End)
		

Crossrefs

Cf. A144096.
Differs from A293439 for the first time at n=24.

Programs

  • Maple
    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
  • PARI
    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)); };
    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); };
    A144095(n) = vecsum(apply(e -> is_base2infix(n,e), factorint(n)[, 2])); \\ Antti Karttunen, Nov 01 2017

Extensions

More terms from R. J. Mathar, Sep 17 2008