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.

A349330 a(n) = Sum_{d|n} d^c(d), where c is the characteristic function of squares (A010052).

This page as a plain text file.
%I A349330 #24 Mar 31 2025 14:12:32
%S A349330 1,2,2,6,2,4,2,7,11,4,2,9,2,4,4,23,2,14,2,9,4,4,2,11,27,4,12,9,2,8,2,
%T A349330 24,4,4,4,55,2,4,4,11,2,8,2,9,14,4,2,28,51,30,4,9,2,16,4,11,4,4,2,15,
%U A349330 2,4,14,88,4,8,2,9,4,8,2,58,2,4,30,9,4,8,2,28,93,4,2,15,4,4,4
%N A349330 a(n) = Sum_{d|n} d^c(d), where c is the characteristic function of squares (A010052).
%C A349330 For each divisor d of n, add d if d is a square, otherwise add 1 [see example].
%C A349330 Inverse Möbius transform of n^c(n), where c = A010052. - _Wesley Ivan Hurt_, Mar 31 2025
%H A349330 Antti Karttunen, <a href="/A349330/b349330.txt">Table of n, a(n) for n = 1..20000</a>
%F A349330 a(p) = 2 iff p is prime. - _Wesley Ivan Hurt_, Nov 28 2021
%F A349330 a(n) = A035316(n) + A056595(n). - _R. J. Mathar_, Aug 18 2024
%e A349330 The divisors of 12 are 1, 2, 3, 4, 6, and 12 with squares 1 and 4, so a(12) = 1 + 1 + 1 + 4 + 1 + 1 = 9 (respectively).
%t A349330 a[n_] := DivisorSum[n, If[IntegerQ @ Sqrt[#], #, 1] &]; Array[a, 100] (* _Amiram Eldar_, Nov 15 2021 *)
%o A349330 (PARI) a(n) = sumdiv(n, d, if (issquare(d), d, 1)); \\ _Michel Marcus_, Nov 15 2021
%o A349330 (PARI) a(n) = {my(f = factor(n), cf = f, res); cf[,2]\=2; res = numdiv(f)-prod(i = 1, #f~, cf[i, 2]+1); res+=prod(i = 1, #f~, ((f[i,1]^(2*(cf[i,2]+1))-1)/(f[i,1]^2-1))); res } \\ _David A. Corneth_, Nov 16 2021
%Y A349330 Cf. A010052, A035316.
%K A349330 nonn
%O A349330 1,2
%A A349330 _Wesley Ivan Hurt_, Nov 15 2021