A087207 A binary representation of the primes that divide a number, shown in decimal.
0, 1, 2, 1, 4, 3, 8, 1, 2, 5, 16, 3, 32, 9, 6, 1, 64, 3, 128, 5, 10, 17, 256, 3, 4, 33, 2, 9, 512, 7, 1024, 1, 18, 65, 12, 3, 2048, 129, 34, 5, 4096, 11, 8192, 17, 6, 257, 16384, 3, 8, 5, 66, 33, 32768, 3, 20, 9, 130, 513, 65536, 7, 131072, 1025, 10, 1, 36, 19, 262144, 65, 258
Offset: 1
Examples
a(38) = 129 because 38 = 2*19 = prime(1)*prime(8) and 129 = 2^0 + 2^7 (in binary 10000001). a(140) = 13, binary 1101 because 140 is divisible by the first, third and fourth primes and 2^(1-1) + 2^(3-1) + 2^(4-1) = 13.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..10000 [First 1000 terms from _T. D. Noe_]
- Index entries for sequences related to binary expansion of n
- Index entries for sequences computed from indices in prime factorization
Crossrefs
For partial sums see A288566.
Cf. A000040, A000120, A001221, A005117, A008479, A019565, A055396, A285320, A285321, A285329, A285330, A285332.
Sequences with related definitions: A007947, A008472, A027748, A048675, A248663, A276379 (same sequence shown in base 2), A288569, A289271, A297404.
Cf. A286608 (numbers n for which a(n) < n), A286609 (n for which a(n) > n), and also A286611, A286612.
Positions of particular values are: A000079\{1} (1), A000244\{1} (2), A033845 (3), A000351\{1} (4), A033846 (5), A033849 (6), A143207 (7), A000420\{1} (8), A033847 (9), A033850 (10), A033851 (12), A147576 (14), A147571 (15), A001020\{1} (16), A033848 (17).
A048675 gives binary rank of prime indices.
Binary indices (listed A048793):
Programs
-
Haskell
a087207 = sum . map ((2 ^) . (subtract 1) . a049084) . a027748_row -- Reinhard Zumkeller, Jul 16 2013
-
Mathematica
a[n_] := Total[ 2^(PrimePi /@ FactorInteger[n][[All, 1]] - 1)]; a[1] = 0; Table[a[n], {n, 1, 69}] (* Jean-François Alcover, Dec 12 2011 *)
-
PARI
a(n) = {if (n==1, 0, my(f=factor(n), v = []); forprime(p=2, vecmax(f[,1]), v = concat(v, vecsearch(f[,1], p)!=0);); fromdigits(Vecrev(v), 2));} \\ Michel Marcus, Jun 05 2017
-
PARI
A087207(n)=vecsum(apply(p->1<
M. F. Hasler, Jun 23 2017 -
Python
from sympy import factorint, primepi def a(n): return sum(2**primepi(i - 1) for i in factorint(n)) print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 06 2017
-
Scheme
(definec (A087207 n) (if (= 1 n) 0 (+ (A000079 (+ -1 (A055396 n))) (A087207 (A028234 n))))) ;; This uses memoization-macro definec (define (A087207 n) (A048675 (A007947 n))) ;; Needs code from A007947 and A048675. - Antti Karttunen, Jun 19 2017
Formula
Additive with a(p^e) = 2^(i-1) where p is the i-th prime. - Vladeta Jovovic, Oct 29 2003
A000120(a(n)) = A001221(n); a(n) = Sum(2^(A049084(p)-1): p prime-factor of n). - Reinhard Zumkeller, Nov 30 2003
G.f.: Sum_{k>=1} 2^(k-1)*x^prime(k)/(1-x^prime(k)). - Franklin T. Adams-Watters, Sep 01 2009
From Antti Karttunen, Apr 17 2017, Jun 19 2017 & Dec 06 2018: (Start)
(End)
From Peter Munn, Jan 08 2020: (Start)
a(A003961(n)) = 2*a(n).
a(n^2) = a(n).
(End)
Extensions
Name clarified by Antti Karttunen, Jun 18 2017
Comments