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.

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

Original entry on oeis.org

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, 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, 8, 2, 8, 4, 8, 2, 12, 2, 4, 4, 8, 4, 8, 2, 20, 2, 4, 2, 16, 4
Offset: 1

Views

Author

Mats Granvik, Mar 03 2019

Keywords

Comments

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.

Crossrefs

Programs

  • Mathematica
    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. *)
    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. *)
    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. *)
  • PARI
    A306652(n) = sum(m=1, n, sumdiv(n, k, !(m%(n/k)) && !((m+4)%k))); \\ Antti Karttunen, Mar 13 2019

Formula

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