cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A348915 #33 Jun 01 2025 18:03:40
%S A348915 1,2,4,3,6,6,8,4,13,8,12,8,14,10,24,5,18,16,20,10,32,14,24,10,31,16,
%T A348915 40,12,30,28,32,6,48,20,48,19,38,22,56,12,42,36,44,16,78,26,48,12,57,
%U A348915 34,72,18,54,44,72,14,80,32,60,32,62,34,104,7,84,52,68,22,96,52,72,22,74
%N A348915 a(n) = Sum_{d|n} d^(d mod 2).
%C A348915 For each divisor d of n, add d if d is odd, otherwise add 1.
%C A348915 Inverse Möbius transform of n^(n mod 2). - _Wesley Ivan Hurt_, Mar 31 2025
%H A348915 Robert Israel, <a href="/A348915/b348915.txt">Table of n, a(n) for n = 1..10000</a>
%H A348915 <a href="/index/Si#SIGMAN">Index entries for sequences related to sigma(n)</a>
%F A348915 a(n) = A000593(n) + A183063(n).
%F A348915 a(n) = A065608(2n) - 2*A065608(n).
%F A348915 a(p) = p+1 for odd primes p. - _Wesley Ivan Hurt_, Nov 28 2021
%F A348915 a(n) = A000203(A000265(n))+A000005(A000265(n))*A007814(n). - _Chai Wah Wu_, Jul 16 2022
%F A348915 a(n) = A000203(n) if n is odd. - _Robert Israel_, Jun 01 2025
%e A348915 For n = 12, the divisors of 12 are 1, 2, 3, 4, 6, 12 with corresponding summands 1, 1, 3, 1, 1, 1, respectively. The sum is then a(12) = 1 + 1 + 3 + 1 + 1 + 1 = 8.
%p A348915 f:= proc(n) local d;
%p A348915   add(d^(d mod 2), d = numtheory:-divisors(n))
%p A348915 end proc;
%p A348915 map(f, [$1..100]); # _Robert Israel_, Jun 01 2025
%t A348915 a[n_] := DivisorSum[n, #^Mod[#, 2] &]; Array[a, 100] (* _Amiram Eldar_, Nov 04 2021 *)
%o A348915 (PARI) a(n) = sumdiv(n, d, if (d%2, d, 1)); \\ _Michel Marcus_, Nov 04 2021
%o A348915 (Python)
%o A348915 from math import prod
%o A348915 from sympy import factorint
%o A348915 def A348915(n):
%o A348915     f = factorint(n>>(m:=(~n&n-1).bit_length())).items()
%o A348915     d = prod(e+1 for p,e in f)
%o A348915     s = prod((p**(e+1)-1)//(p-1) for p, e in f)
%o A348915     return s+d*m # _Chai Wah Wu_, Jul 16 2022
%Y A348915 Cf. A000005 (tau), A000203 (sigma), A000593, A065608, A183063.
%K A348915 nonn
%O A348915 1,2
%A A348915 _Wesley Ivan Hurt_, Nov 03 2021