Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #18 Nov 12 2022 21:02:19
%S 1,3,2,9,2,14,2,25,3,22,2,50,2,30,4,65,2,57,2,82,4,46,2,146,3,54,4,
%T 114,2,124,2,161,4,70,4,219,2,78,4,242,2,172,2,178,6,94,2,386,3,153,4,
%U 210,2,220,4,338,4,118,2,484,2,126,6,385,4,268,2,274,4,284,2,651,2,150
%N a(n) = Sum_{d|n} n^((d+1) mod 2).
%C For each divisor d of n, add n if d is even, otherwise add 1. For example, the divisors of 6 are 1,2,3,6 which would give a(6) = 1 + 6 + 1 + 6 = 14.
%H Antti Karttunen, <a href="/A349213/b349213.txt">Table of n, a(n) for n = 1..20000</a>
%F a(n) = A001227(n) * (1+n*A007814(n)). - _Chai Wah Wu_, Jul 16 2022
%t a[n_] := DivisorSum[n, n^Mod[# + 1, 2] &]; Array[a, 100] (* _Wesley Ivan Hurt_, Nov 12 2022 *)
%o (PARI) A349213(n) = sumdiv(n,d,n^((1+d)%2)); \\ _Antti Karttunen_, Nov 10 2021
%o (Python)
%o from sympy import divisor_count
%o def A349213(n): return (1+n*(m:=(~n&n-1).bit_length()))*divisor_count(n>>m) # _Chai Wah Wu_, Jul 16 2022
%Y Cf. A001227, A007814, A349211, A349212, A348915.
%K nonn
%O 1,2
%A _Wesley Ivan Hurt_, Nov 10 2021