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.

A157971 Odious twin locations: first members of pairs of consecutive odious numbers.

This page as a plain text file.
%I A157971 #34 Jun 16 2025 08:45:31
%S A157971 1,7,13,21,25,31,37,41,49,55,61,69,73,81,87,93,97,103,109,117,121,127,
%T A157971 133,137,145,151,157,161,167,173,181,185,193,199,205,213,217,223,229,
%U A157971 233,241,247,253,261,265,273,279,285,289,295
%N A157971 Odious twin locations: first members of pairs of consecutive odious numbers.
%C A157971 An odious number (A000069) is a nonnegative integer with an odd number of ones in its binary expansion.
%C A157971 In the reference it is shown that these odious twins alternate with the evil twins (see A157970), which are pairs of consecutive evil numbers (A001969) having even numbers of ones in their binary expansions.
%H A157971 Amiram Eldar, <a href="/A157971/b157971.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Harvey P. Dale)
%H A157971 Chris Bernhardt, <a href="https://pdfslide.net/documents/evil-twins-alternate-with-odious-twins-fairfield-twinspdf-evil-twins-alternate.html">Evil twins alternate with odious twins</a>, Math. Mag. 82 (2009), pp. 57-62; also on <a href="https://www.jstor.org/stable/27643161">JSTOR</a>.
%H A157971 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/OdiousNumber.html">Odious Number</a>.
%F A157971 a(n) = A248057(n) - 1. - _Amiram Eldar_, Jun 16 2025
%e A157971 The sequence of odious numbers (A000069) begins 1,2,4,7,8,11,13,14,16,19,21,..., so the first few odious twins are at 1,7,13, ... .
%t A157971 SequencePosition[Table[If[OddQ[DigitCount[n,2,1]],1,0],{n,300}],{1,1}][[All,1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Oct 05 2016 *)
%o A157971 (PARI) lista(nn) = select(n->((hammingweight(n) % 2) && (hammingweight(n+1) % 2)), vector(nn, i, i)); \\ _Michel Marcus_, Jul 10 2014
%Y A157971 Cf. A000069, A091855, A157970, A248057.
%K A157971 nonn,easy
%O A157971 1,2
%A A157971 _John W. Layman_, Mar 10 2009
%E A157971 Comment corrected by _Jeff Aronson_. - _N. J. A. Sloane_, Oct 04 2020