login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A335115 a(2*n) = 2*n - a(n), a(2*n+1) = 2*n + 1. 1

%I #16 Dec 02 2020 03:17:19

%S 1,1,3,3,5,3,7,5,9,5,11,9,13,7,15,11,17,9,19,15,21,11,23,15,25,13,27,

%T 21,29,15,31,21,33,17,35,27,37,19,39,25,41,21,43,33,45,23,47,33,49,25,

%U 51,39,53,27,55,35,57,29,59,45,61,31,63,43,65,33,67,51,69,35,71,45,73,37,75

%N a(2*n) = 2*n - a(n), a(2*n+1) = 2*n + 1.

%H Amiram Eldar, <a href="/A335115/b335115.txt">Table of n, a(n) for n = 1..10000</a>

%F G.f.: Sum_{k>=0} (-1)^k * x^(2^k) / (1 - x^(2^k))^2.

%F G.f. A(x) satisfies: A(x) = x / (1 - x)^2 - A(x^2).

%F Dirichlet g.f.: zeta(s-1) / (1 + 2^(-s)).

%F a(n) = Sum_{d|n} A154269(n/d) * d.

%F Sum_{k=1..n} a(k) ~ 2*n^2/5. - _Vaclav Kotesovec_, Jun 11 2020

%F Multiplicative with a(2^e) = A001045(e+1) and a(p^e) = p^e for e >= 0 and prime p > 2. - _Werner Schulte_, Oct 05 2020

%t a[n_] := a[n] = If[EvenQ[n], n - a[n/2], n]; Table[a[n], {n, 1, 75}]

%t nmax = 75; CoefficientList[Series[Sum[(-1)^k x^(2^k)/(1 - x^(2^k))^2, {k, 0, Floor[Log[2, nmax]]}], {x, 0, nmax}], x] // Rest

%t f[p_, e_] := If[p == 2, (2^(e + 1) + (-1)^e)/3, p^e]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* _Amiram Eldar_, Dec 02 2020 *)

%o (PARI) a(n) = my(k=valuation(n,2)); (n<<1 + (n>>k)*(-1)^k)/3; \\ _Kevin Ryde_, Oct 06 2020

%Y Cf. A035263, A050292, A129527, A154269, A001045.

%K nonn,mult

%O 1,3

%A _Ilya Gutkovskiy_, May 23 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 00:00 EDT 2024. Contains 371696 sequences. (Running on oeis4.)