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.

A385571 Number of subsets of the first n twin primes (A001097) whose sum is a twin prime.

This page as a plain text file.
%I A385571 #15 Jul 08 2025 18:51:24
%S A385571 1,2,3,5,8,13,22,37,64,119,227,450,884,1673,3019,5113,8877,16119,
%T A385571 30250,57282,109178,210547,412261,819165,1641582,3298602,6600608,
%U A385571 13150469,26176431,52289653,104981405,210846036,420699038,828442946,1610436120,3102364760
%N A385571 Number of subsets of the first n twin primes (A001097) whose sum is a twin prime.
%H A385571 David Radcliffe, <a href="/A385571/b385571.txt">Table of n, a(n) for n = 1..501</a>
%H A385571 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TwinPrimes.html">Twin Primes</a>.
%e A385571 a(5) = 8 subsets: {3}, {5}, {7}, {11}, {13}, {3, 5, 11}, {5, 11, 13} and {7, 11, 13}.
%t A385571 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 *)
%Y A385571 Cf. A001097, A071810.
%K A385571 nonn
%O A385571 1,2
%A A385571 _Ilya Gutkovskiy_, Jul 03 2025
%E A385571 a(23)-a(25) from _Amiram Eldar_, Jul 03 2025
%E A385571 a(26)-a(36) from _David Radcliffe_, Jul 04 2025