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.

A197918 Pythagorean primes p such that for all primes q < p, p XOR q is not equal to p - q.

This page as a plain text file.
%I A197918 #52 Sep 08 2022 08:45:59
%S A197918 2,5,17,41,73,97,137,193,257,521,577,641,1033,1153,2081,2113,4129,
%T A197918 7681,8353,8737,9281,10369,10753,12289,16417,17921,18433,21569,25601,
%U A197918 32801,32833,36353,37889,38921,39041,40961,50177,53377,65537,131617,133121,136193,139273,139297,139393,147457,163841
%N A197918 Pythagorean primes p such that for all primes q < p, p XOR q is not equal to p - q.
%C A197918 It is conjectured that with the exception of the first three terms (2,5,17) all of the terms are a subset of all primes p such that p XOR 22 = p + 22.
%C A197918 If the inequality in the definition is replaced with equality the result are the Mersenne primes A000668, which is equivalent to for all primes q<p p XOR q = p - q. This is a direct result of the binary nature of Mersenne primes being all "1's", smaller numbers XORed with them will return the difference. This sequence is a kind of mirror of that, as for no primes q<p p XOR q = p - q.
%C A197918 This sequence is apparently a subset of A081091 Primes of the form 2^i + 2^j + 1, i>j>0, with the added conditions that j <> 1 or 2, and if j can be written as 2n then i cannot be 2n+1. This removes A123250 Primes of form 2^n + 5 (or 2^n + 2^2 +1) for n>0, primes from A140660 3*4^n + 1 (or 2^(2n+1) + 2^(2n) + 1) for n>0, and A057733 Primes of form 2^n + 3 (2^n + 2^1 + 1) for n>1.
%H A197918 Charles R Greathouse IV, <a href="/A197918/b197918.txt">Table of n, a(n) for n = 1..303</a>
%e A197918 5 is a Pythagorean prime (1^2 + 2^2) and a member since ((5 XOR 2) <> (5 - 2)) and ((5 XOR 3) <> (5 - 3)).
%e A197918 13 is a Pythagorean prime (2^2 + 3^2) however it is not a member because 5, a prime less than 13, (13 XOR 5) = (13 - 5).
%o A197918 (Magma)XOR := func<a, b | Seqint([ (adigs[i] + bdigs[i]) mod 2 : i in [1..n]], 2)
%o A197918                        where adigs := Intseq(a, 2, n)
%o A197918                        where bdigs := Intseq(b, 2, n)
%o A197918                        where n := 1 + Ilog2(Max([a, b, 1]))>;
%o A197918 i:=0; k:=0; pn:=0;
%o A197918 for n:= 5 to 10000 by 4 do
%o A197918        if IsPrime(n)  then  pn:=n;  end if;
%o A197918        if (pn eq n) then k:=0;
%o A197918            for j in [2 .. n-2] do
%o A197918                 if IsPrime(j)  then pj:=j;
%o A197918                      if (XOR(pn,pj) ne pn-pj) then i+:=1;
%o A197918                          else k+:=1;
%o A197918                      end if;
%o A197918                 end if;
%o A197918            end for;
%o A197918        end if;
%o A197918        if ((i ne 0) and (k eq 0))  then pn; end if;
%o A197918        i:=0; k:=0;
%o A197918 end for;
%o A197918 (PARI) forprime(p=2,1e6,if(p%4-3==0,next);forprime(q=2,p-1,if(bitxor(p,q)==p-q, next(2)));print1(p", ")) \\ _Charles R Greathouse IV_, Jul 31 2012
%Y A197918 Cf. A000668, A057733, A081091, A123250, A140660, A214643.
%K A197918 nonn,base
%O A197918 1,1
%A A197918 _Brad Clardy_, Oct 24 2011