login
a(n) = Sum_{m=1..n} Sum_{k=1..n} [k divides n]*[n/k divides m]*[k divides m + 4].
2

%I #21 May 05 2019 11:57:42

%S 1,2,2,4,2,4,2,6,2,4,2,8,2,4,4,10,2,4,2,8,4,4,2,12,2,4,2,8,2,8,2,14,4,

%T 4,4,8,2,4,4,12,2,8,2,8,4,4,2,20,2,4,4,8,2,4,4,12,4,4,2,16,2,4,4,14,4,

%U 8,2,8,4,8,2,12,2,4,4,8,4,8,2,20,2,4,2,16,4

%N a(n) = Sum_{m=1..n} Sum_{k=1..n} [k divides n]*[n/k divides m]*[k divides m + 4].

%C According to the first Hardy-Littlewood conjecture, the cousin primes have the same asymptotic density as the twin primes. In an analogy of Dirichlet convolutions A147848 corresponds to the twin primes while this sequence corresponds to the cousin primes, and it appears that this sequence differs from A147848 at multiples of 16. See A306653 for comparison.

%H Antti Karttunen, <a href="/A306652/b306652.txt">Table of n, a(n) for n = 1..20000</a>

%H Mats Granvik, <a href="https://mathoverflow.net/q/308990/25104">Arithmetic properties of a sum related to the first Hardy-Littlewood conjecture</a>

%F a(n) = Sum_{m=1..n} Sum_{k=1..n} [k divides n]*[n/k divides m]*[k divides m + 4].

%F a(n) = Sum_{k=1..n}[k divides n]*Sum_{j=1..n}[j divides 4]*[GCD[k, n/k] = j]*j.

%t a[n_] := Sum[Sum[If[Mod[n, k] == 0, If[Mod[m, n/k] == 0, 1, 0], 0]*If[Mod[m + 4, k/1] == 0, 1, 0], {k, 1, n}], {m, 1, n}]; a /@Range[85] (* Dirichlet Convolution. *)

%t a[n_] := Sum[If[Mod[n, k] == 0, Sum[If[Mod[4, j] == 0, If[GCD[k, n/k] == j, j, 0], 0], {j, 1, n}], 0], {k, 1, n}]; a /@Range[85] (* GCD sum. *)

%t a[n_] := Sum[If[Mod[4, j] == 0, j*Count[Divisors[n], d_ /; GCD[d, n/d] == j], 0], {j, 1, n}]; a /@Range[85] (* After Jean-François Alcover in A034444. *)

%o (PARI) A306652(n) = sum(m=1, n, sumdiv(n, k, !(m%(n/k)) && !((m+4)%k))); \\ _Antti Karttunen_, Mar 13 2019

%Y Cf. A147848, A306652, A298825, A008683.

%K nonn

%O 1,2

%A _Mats Granvik_, Mar 03 2019