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.

A143792 a(n) = the number of distinct prime divisors, p, of n that, when p is represented in binary, each p occurs at least once in the binary representation of n.

This page as a plain text file.
%I A143792 #13 Aug 01 2015 13:41:58
%S A143792 0,1,1,1,1,2,1,1,0,2,1,2,1,2,1,1,1,1,1,2,0,2,1,2,0,2,1,2,1,2,1,1,0,2,
%T A143792 0,1,1,2,1,2,1,1,1,2,2,2,1,2,0,1,1,2,1,2,2,2,1,2,1,2,1,2,2,1,0,1,1,2,
%U A143792 0,1,1,1,1,2,2,2,0,2,1,2,0,2,1,1,1,2,1,2,1,3,1,2,1,2,1,2,1,1,1,1,1,2,1,2,2
%N A143792 a(n) = the number of distinct prime divisors, p, of n that, when p is represented in binary, each p occurs at least once in the binary representation of n.
%C A143792 a(2^k * p) = 2, where k = any positive integer and p = any odd prime.
%C A143792 a(p) = 1, where p = any prime.
%C A143792 a(2^k) = 1, where k = any positive integer.
%C A143792 a(n) <= A078826(n). - _Reinhard Zumkeller_, Sep 08 2008
%C A143792 Size of intersection of n-th rows of tables A225243 and A027748. - _Reinhard Zumkeller_, Aug 14 2013
%H A143792 Reinhard Zumkeller, <a href="/A143792/b143792.txt">Table of n, a(n) for n = 1..10000</a>
%e A143792 60 in binary is 111100. The distinct primes dividing 60 are 2 (which is 10 in binary), 3 (11 in binary) and 5 (101) in binary. The string 10 does occur within 111100 like so: 111(10)0. The string 11 also occurs (multiple times) within 111100, in one way like so: (11)1100. But the string 101 does not occur in 111100. Since 2 and 3 occur within 60 (when each of these numbers is written in binary), but 5 does not, then a(60) = 2.
%t A143792 f[n_] := Block[{nb = ToString@ FromDigits@ IntegerDigits[n, 2], psb = ToString@ FromDigits@ IntegerDigits[ #, 2] & /@ First@ Transpose@ FactorInteger@ n, c = 0, k = 1}, lmt = 1 + Length@ psb; While[k < lmt, If[ StringCount[nb, psb[[k]]] > 0, c++ ]; k++ ]; c]; f[1] = 0; Array[f, 105] (* _Robert G. Wilson v_, Sep 22 2008 *)
%o A143792 (Haskell)
%o A143792 import Data.List (intersect)
%o A143792 a143792 n = length $ a225243_row n `intersect` a027748_row (fromIntegral n)
%o A143792 -- _Reinhard Zumkeller_, Aug 14 2013
%Y A143792 Cf. A143791.
%K A143792 base,nonn
%O A143792 1,6
%A A143792 _Leroy Quet_, Sep 01 2008
%E A143792 More terms from _Robert G. Wilson v_, Sep 22 2008