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.

A166008 Number of ones in the binary representation of the average of twin prime pairs.

This page as a plain text file.
%I A166008 #15 Sep 08 2022 08:45:48
%S A166008 1,2,2,2,4,3,4,2,4,4,3,4,4,2,4,4,4,4,4,4,5,4,4,6,3,5,4,5,3,4,5,6,6,6,
%T A166008 6,8,2,4,4,3,2,6,8,4,5,4,5,6,6,5,4,5,4,5,7,8,5,7,6,8,8,8,3,3,2,4,6,7,
%U A166008 6,4,4,6,8,3,5,3,5,6,7,7,7,7,4,4,6,7,6
%N A166008 Number of ones in the binary representation of the average of twin prime pairs.
%H A166008 Amiram Eldar, <a href="/A166008/b166008.txt">Table of n, a(n) for n = 1..10000</a>
%F A166008 a(n) = A000120(A014574(n)). - _Michel Marcus_, Dec 19 2019
%e A166008 Third twin prime pair = (11,13) with average 12 = 1100_2, with 2 ones, so a(3)=2.
%t A166008 seq={1}; Do[If[And @@ PrimeQ[6n + {-1, 1}], AppendTo[seq, DigitCount[6n, 2, 1]]], {n, 1, 600}]; seq (* _Amiram Eldar_, Dec 19 2019 *)
%t A166008 DigitCount[#,2,1]&/@(Mean/@Select[Partition[Prime[Range[1000]],2,1],#[[2]]- #[[1]] == 2&]) (* _Harvey P. Dale_, Dec 12 2021 *)
%o A166008 (Magma) [&+Intseq(p+1,2):p in PrimesUpTo(3000)|IsPrime(p+2)]; // _Marius A. Burtea_, Dec 19 2019
%Y A166008 Cf. A000120, A014574, A014499.
%K A166008 base,nonn
%O A166008 1,2
%A A166008 Steven Lubars (lubars(AT)gmail.com), Oct 03 2009
%E A166008 More terms from _Amiram Eldar_, Dec 19 2019