OFFSET
1,2
COMMENTS
a(2^n) = 2^n, in other cases a(n) < n. Except for the initial 1 all entries are repeated. Apparently no simple formula is known for a(n).
Taking every other term seems to give A101925. - Dominick Cancilla, Aug 03 2010
1/a(n) is the probability that a randomly chosen divisor of n! is odd. This is because the product n! contains the prime factor 2 a total of a(n) - 1 times (cf. A011371) and thus the prime factor 2 can occur in a divisor of n! a total of a(n) times, ranging between 0 and a(n) - 1 times. - Martin Renner, Dec 28 2022
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..2500
Tanya Khovanova, There are no coincidences, arXiv:1410.2193 [math.CO], 2014.
FORMULA
From Paul Barry, Aug 27 2006: (Start)
a(n) = ( Sum_{k=0..n} floor(n/2^k) ) - n + 1.
a(n) = 2 + Sum_{k=0..n} ( floor(n/2^k)-1 ).
a(n) = A005187(n) - n + 1. (End)
a(n) = n + O(log n). - Charles R Greathouse IV, Mar 12 2017
a(n) = A011371(n) + 1 for n > 0. - Martin Renner, Dec 28 2022
MATHEMATICA
a[1]=1; a[n_]:=a[n]=a[Floor[n/2]]+Floor[n/2]; Table[a[n], {n, 100}]
PROG
(PARI) for(n=1, 90, print1(1 - n + sum(k=0, n, n\2^k), ", ")) \\ G. C. Greubel, Mar 11 2017
(PARI) a(n)=sum(k=1, logint(n, 2), n>>k)+1 \\ Charles R Greathouse IV, Mar 12 2017
(PARI) a(n)=n+1-hammingweight(n) \\ Charles R Greathouse IV, Dec 29 2022
(Magma)
A113474:= func< n | n+1-Multiplicity(Intseq(n, 2), 1) >;
[A113474(n): n in [1..90]]; // G. C. Greubel, Sep 28 2024
(SageMath)
def A113474(n): return n+1 - sum((n+0).digits(2))
[A113474(n) for n in range(1, 90)] # G. C. Greubel, Sep 28 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Jan 08 2006
STATUS
approved