login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = Sum_{d|n} n^(d mod 2).
2

%I #23 Nov 12 2022 21:04:06

%S 1,3,6,6,10,14,14,11,27,22,22,28,26,30,60,20,34,57,38,44,84,46,46,54,

%T 75,54,108,60,58,124,62,37,132,70,140,114,74,78,156,86,82,172,86,92,

%U 270,94,94,104,147,153,204,108,106,220,220,118,228,118,118,248,122,126,378,70,260

%N a(n) = Sum_{d|n} n^(d mod 2).

%C For each divisor d of n, add n if d is odd, otherwise add 1. For example, 6 has 4 divisors 1,2,3,6 which gives a(6) = 6 + 1 + 6 + 1 = 14.

%H Antti Karttunen, <a href="/A349212/b349212.txt">Table of n, a(n) for n = 1..16384</a>

%H Christian Krause, et al, <a href="https://github.com/loda-lang">LODA, an assembly language, a computational model and a tool for mining integer sequences</a>

%F a(n) = A000005(A001787(n)) = A001227(n) * (n+A007814(n)). [The first formula found by LODA miner] - _Antti Karttunen_, Apr 20 2022

%t a[n_] := DivisorSum[n, n^Mod[#, 2] &]; Array[a, 100] (* _Wesley Ivan Hurt_, Nov 12 2022 *)

%o (PARI) A349212(n) = sumdiv(n,d,n^(d%2)); \\ _Antti Karttunen_, Nov 10 2021

%o (Python)

%o from sympy import divisors

%o def a(n): return sum(n**(d%2) for d in divisors(n))

%o print([a(n) for n in range(1, 66)]) # _Michael S. Branicky_, Apr 20 2022

%o (Python)

%o from sympy import divisor_count

%o def A349212(n): return (n+(m:=(~n&n-1).bit_length()))*divisor_count(n>>m) # _Chai Wah Wu_, Jul 16 2022

%Y Cf. A000005, A001227, A001787, A007814, A349213, A348915.

%K nonn

%O 1,2

%A _Wesley Ivan Hurt_, Nov 10 2021