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.

A322358 Number of distinct twin prime pairs p, p+2 such that both of them divide n.

This page as a plain text file.
%I A322358 #12 Jan 01 2024 08:00:35
%S A322358 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
%T A322358 1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
%U A322358 0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2
%N A322358 Number of distinct twin prime pairs p, p+2 such that both of them divide n.
%H A322358 Antti Karttunen, <a href="/A322358/b322358.txt">Table of n, a(n) for n = 1..100000</a>
%F A322358 a(n) = A001221(A322356(n)) = A001222(A322356(n)).
%F A322358 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A209328 = 0.107983... . - _Amiram Eldar_, Jan 01 2024
%e A322358 For n = 45 = 3^2 * 5, there exists one twin prime pair (3,5) whose both members divide 45, thus a(45) = 1.
%e A322358 For n = 105 = 3 * 5 * 7, there exists two twin prime pairs, (3,5) and (5,7) whose both members divide 105, thus a(105) = 2.
%t A322358 f[p_, n_] := If[PrimeQ[p + 2] && Divisible[n, p*(p + 2)], 1, 0]; a[n_] := Plus @@ (f[#, n] & /@ FactorInteger[n][[;; , 1]]); Array[a, 105] (* _Amiram Eldar_, Dec 16 2018 *)
%o A322358 (PARI) A322358(n) = { my(ps=factor(n)[,1]~); sum(i=1,#ps,isprime(ps[i]+2)*!(n%(ps[i]+2))); };
%Y A322358 Cf. A001359, A006512, A209328, A322356.
%K A322358 nonn
%O A322358 1,105
%A A322358 _Antti Karttunen_, Dec 16 2018