OFFSET
1,3
COMMENTS
The binary representation of a(n) shows which prime numbers divide n, but not the multiplicities. a(2)=1, a(3)=10, a(4)=1, a(5)=100, a(6)=11, a(10)=101, a(30)=111, etc.
For n > 1, a(n) gives the (one-based) index of the column where n is located in array A285321. A008479 gives the other index. - Antti Karttunen, Apr 17 2017
From Antti Karttunen, Jun 18 & 20 2017: (Start)
A268335 gives all n such that a(n) = A248663(n); the squarefree numbers (A005117) are all the n such that a(n) = A285330(n) = A048675(n).
For all n > 1 for which the value of A285331(n) is well-defined, we have A285331(a(n)) <= floor(A285331(n)/2), because then n is included in the binary tree A285332 and a(n) is one of its ancestors (in that tree), and thus must be at least one step nearer to its root than n itself.
Conjecture: Starting at any n and iterating the map n -> a(n), we will always reach 0 (see A288569). This conjecture is equivalent to the conjecture that at any n that is neither a prime nor a power of two, we will eventually hit a prime number (which then becomes a power of two in the next iteration). If this conjecture is false then sequence A285332 cannot be a permutation of natural numbers. On the other hand, if the conjecture is true, then A285332 must be a permutation of natural numbers, because all primes and powers of 2 occur in definite positions in that tree. This conjecture also implies the conjectures made in A019565 and A285320 that essentially claim that there are neither finite nor infinite cycles in A019565.
If there are any 2-cycles in this sequence, then both terms of the cycle should be present in A286611 and the larger one should be present in A286612.
(End)
Binary rank of the distinct prime indices of n, where the binary rank of an integer partition y is given by Sum_i 2^(y_i-1). For all prime indices (with multiplicity) we have A048675. - Gus Wiseman, May 25 2024
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000 [First 1000 terms from T. D. Noe]
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)
EXAMPLE
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.
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 *)
PROG
(Haskell)
a087207 = sum . map ((2 ^) . (subtract 1) . a049084) . a027748_row
-- Reinhard Zumkeller, Jul 16 2013
(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<<primepi(p-1), factor(n)[, 1])) \\ Significantly faster than using sum(...). - 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)
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):
KEYWORD
nonn,base,nice
AUTHOR
Mitch Cervinka (puritan(AT)planetkc.com), Oct 26 2003
EXTENSIONS
Name clarified by Antti Karttunen, Jun 18 2017
STATUS
approved