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.

A336817 Lexicographically earliest sequence of distinct positive numbers such that for any n > 0, a(n) XOR a(n+1) is a prime number (where XOR denotes the bitwise XOR operator).

This page as a plain text file.
%I A336817 #12 Nov 23 2020 17:07:34
%S A336817 1,2,5,6,3,4,7,10,8,11,9,12,14,13,15,16,18,17,19,20,22,21,23,26,24,27,
%T A336817 25,28,30,29,31,34,32,35,33,36,38,37,39,42,40,43,41,44,46,45,47,48,50,
%U A336817 49,51,52,54,53,55,58,56,59,57,60,62,61,63,64,66,65,67
%N A336817 Lexicographically earliest sequence of distinct positive numbers such that for any n > 0, a(n) XOR a(n+1) is a prime number (where XOR denotes the bitwise XOR operator).
%C A336817 By Dirichlet's theorem on arithmetic progressions, we can always extend the sequence: say a(n) < 2^k:
%C A336817 - if a(n) is odd: a(n) and 2^k are coprime and there are infinitely many prime numbers of the form a(n) + m*2^k = a(n) XOR m*2^k, and we can extend the sequence,
%C A336817 - if a(n) is even: a(n)+1 and 2^k are coprime and there are infinitely many prime numbers of the form a(n)+1 + m*2^k = a(n) XOR (1+m*2^k), and we can extend the sequence.
%H A336817 Rémy Sigrist, <a href="/A336817/b336817.txt">Table of n, a(n) for n = 1..10000</a>
%e A336817 The first terms, alongside the corresponding prime numbers, are:
%e A336817   n   a(n)  a(n) XOR a(n+1)
%e A336817   --  ----  ---------------
%e A336817    1     1                3
%e A336817    2     2                7
%e A336817    3     5                3
%e A336817    4     6                5
%e A336817    5     3                7
%e A336817    6     4                3
%e A336817    7     7               13
%e A336817    8    10                2
%e A336817    9     8                3
%e A336817   10    11                2
%o A336817 (PARI) s=0; v=1; for (n=1, 67, print1 (v ", "); s+=2^v; for (w=1, oo, if (!bittest(s, w) && isprime(bitxor(v, w)), v=w; break)))
%Y A336817 See A337013 for the corresponding prime numbers.
%Y A336817 See A308334 for similar sequences.
%K A336817 nonn,base
%O A336817 1,2
%A A336817 _Rémy Sigrist_, Nov 21 2020