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.

A371354 Primes p such that p, q and p + q but not q - p have distinct digits, where q is the next prime after p.

This page as a plain text file.
%I A371354 #7 Mar 22 2024 17:22:23
%S A371354 21067,46279,46831,47659,62017,124853,241567,347629,410257,428093,
%T A371354 456901,476059,528719,638179,685471,789631,869521,1024357,2014357,
%U A371354 2146853,2354167,3268549,3407659,3682457,3825649,4021357,4026571,4180679,4213567,4562791,7685401,8602417,20418637,41870293,76820453,390465721
%N A371354 Primes p such that p, q and p + q but not q - p have distinct digits, where q is the next prime after p.
%C A371354 Primes p = prime(k) such that p, prime(k+1) and p + prime(k+1) are in A010784 but p is not in A356196 (as prime(k+1) - p is not in A010784).
%e A371354 a(3) = 46831 is a term because it is prime, the next prime is 46853, and 46831, 46853 and 46831 + 46853 = 93684 have distinct digits but 46853 - 46831 = 22 does not.
%p A371354 isdd:= proc(n) local L;
%p A371354   L:= convert(n,base,10);
%p A371354   nops(L) = nops(convert(L,set))
%p A371354 end proc:
%p A371354 Res:= NULL:
%p A371354 for d from 1 to 9 do
%p A371354   for t in combinat:-permute([$0..9],d) do
%p A371354     if t[1] = 0 then next fi;
%p A371354     p:= add(t[i]*10^(d-i),i=1..d);
%p A371354     if isprime(p) then
%p A371354       q:= nextprime(p);
%p A371354       if not(isdd(q-p)) and isdd(q) and isdd(p+q) then
%p A371354          Res:= Res,p;
%p A371354       fi
%p A371354     fi
%p A371354 od od:
%p A371354 Res;
%Y A371354 Cf. A010784, A356196.
%K A371354 nonn,fini,full,base
%O A371354 1,1
%A A371354 _Zak Seidov_ and _Robert Israel_, Mar 19 2024