

A129527


a(2n) = a(n) + 2n, a(2n+1) = 2n + 1.


16



0, 1, 3, 3, 7, 5, 9, 7, 15, 9, 15, 11, 21, 13, 21, 15, 31, 17, 27, 19, 35, 21, 33, 23, 45, 25, 39, 27, 49, 29, 45, 31, 63, 33, 51, 35, 63, 37, 57, 39, 75, 41, 63, 43, 77, 45, 69, 47, 93, 49, 75, 51, 91, 53, 81, 55, 105, 57, 87, 59, 105, 61, 93, 63, 127, 65, 99, 67
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

Sum of odd part of n and its double, fourfold, eightfold etc. <= n.
Starting with 1 = the ruler function triangle A115361 * [1, 2, 3, ...].  Gary W. Adamson, Nov 27 2009
Starting with 1 and parsed into subsets of 1, 2, 4, 8, ... terms, sum of terms in the subsets = A006516: (1, 6, 28, 120, ...). Example: 120 = (15 + 9 + 15 + 11 + 21 + 13 + 21 + 15).  Gary W. Adamson Mar 18 2011
a(n) = Sum(even divisors of 2(n1) not including 2(n1) that are obtained dividing repeatedly by 2) + (greatest odd divisor of 2(n1), including 1), for the initial case 2(11)=0 will be set to 0). E.g., (offset is starting with n=1) a(3) = Sum(even divisors of 2*(31)=2*2=4 not including 4 obtained dividing repeatedly by 2) + greatest odd divisor of 4 = (2)+(1)=3; a(4) = Sum(even divisors of 2*(41)=6 not including 6 obtained dividing repeatedly by 2) + greatest odd divisor of 6 = (0) + (3) = 3; a(5) = Sum(even divisors of 2*(51)=8 not including 8 obtained dividing repeatedly by 2) + greatest odd divisor of 8 = (4+2) + (1) = 7, etc.  David Morales Marciel, Dec 21 2015


LINKS

Robert Israel, Table of n, a(n) for n = 0..10000


FORMULA

G.f.: Sum_{k>=0} x^(2^k)/(1x^(2^k))^2.
Dirichlet g.f.: zeta(s1)*2^s/(2^s1).  Ralf Stephan, Jun 17 2007
G.f. satisfies g(x) = g(x^2) + x/(1x)^2.  Robert Israel, Dec 20 2015
n <= a(n) <= 2n  1 for n > 0.  Charles R Greathouse IV, Feb 09 2016
Conjecture: a(n) = 2*nA000265(n) for n > 0.  Velin Yanev, Jun 23 2017. [Joerg Arndt, Jun 23 2017: For odd n the conjecture holds, for even n induction should work.
Andrey Zabolotskiy, Aug 03 2017: Confirm: induction works, the conjecture holds for all n.]
a(n) for n > 0 is multiplicative with a(2^e) = 2^(e+1)1 and a(p^e) = p^e for prime p > 2 and e >= 0.  Werner Schulte, Jul 02 2018
Inverse Moebius transform of A062570.  Andrew Howroyd, Aug 07 2018
Sum_{k=1..n} a(k) ~ 2*n^2/3.  Vaclav Kotesovec, Jun 11 2020


MAPLE

f:= proc(n) option remember;
if n::odd then n else n + procname(n/2) fi
end proc:
f(0):= 0:
seq(f(n), n=0..100); # Robert Israel, Dec 20 2015


MATHEMATICA

a[n_] := a[n] = If[EvenQ@ n, a[n/2] + n, n]; {0}~Join~Array[a, 67] (* Michael De Vlieger, Jun 26 2017 *)


PROG

(PARI) a(n)=if (n==0, 0, sum(k=0, valuation(n, 2), n/2^k)); \\ corrected by Michel Marcus, Dec 22 2021
(PARI) a(n)=if(n<2, return(n)); my(k=valuation(n, 2)); 2*nn>>k \\ Charles R Greathouse IV, Feb 09 2016
(PARI) a(n)=sumdiv(n, d, eulerphi(2*d)) \\ Andrew Howroyd, Aug 07 2018


CROSSREFS

Row sums of A129265 and A129559.
Cf. A000265, A006516, A062570, A115361.
Sequence in context: A161427 A098688 A129266 * A245550 A318461 A085379
Adjacent sequences: A129524 A129525 A129526 * A129528 A129529 A129530


KEYWORD

nonn,easy,mult


AUTHOR

Ralf Stephan, May 29 2007


STATUS

approved



