A385571 Number of subsets of the first n twin primes (A001097) whose sum is a twin prime.
1, 2, 3, 5, 8, 13, 22, 37, 64, 119, 227, 450, 884, 1673, 3019, 5113, 8877, 16119, 30250, 57282, 109178, 210547, 412261, 819165, 1641582, 3298602, 6600608, 13150469, 26176431, 52289653, 104981405, 210846036, 420699038, 828442946, 1610436120, 3102364760
Offset: 1
Keywords
Examples
a(5) = 8 subsets: {3}, {5}, {7}, {11}, {13}, {3, 5, 11}, {5, 11, 13} and {7, 11, 13}.
Links
- David Radcliffe, Table of n, a(n) for n = 1..501
- Eric Weisstein's World of Mathematics, Twin Primes.
Programs
-
Mathematica
a[n_] := Module[{t = {} , p = 2}, While[Length[t] < n, p = NextPrime[p]; If[PrimeQ[p - 2] || PrimeQ[p + 2], AppendTo[t, p]]]; Count[Total /@ Subsets[t], ?(PrimeQ[#] && (PrimeQ[# - 2] || PrimeQ[# + 2]) &)]]; Array[a, 20] (* _Amiram Eldar, Jul 03 2025 *)
Extensions
a(23)-a(25) from Amiram Eldar, Jul 03 2025
a(26)-a(36) from David Radcliffe, Jul 04 2025