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.

A380984 Primes p such that p*(p-1) consists of exactly two different decimal digits.

This page as a plain text file.
%I A380984 #23 Feb 20 2025 06:32:38
%S A380984 5,7,11,17,67,101,167,1667,166667,666667,66666667,666666667,
%T A380984 1666666667,66666666667,166666666667,166666666666667,
%U A380984 66666666666666666667
%N A380984 Primes p such that p*(p-1) consists of exactly two different decimal digits.
%C A380984 Primes in A380974.
%C A380984 Contains (10^k+2)/6 for k in A076850 and (2*10^k + 1)/3 for k in A096507.  It is conjectured that these sequences are infinite.
%C A380984 The last decimal digit of a(n)*(a(n)-1) is either 0, 2 or 6. - _Chai Wah Wu_, Feb 19 2025
%e A380984 a(5) = 67 is a term because it is prime and 67 * 66 = 4422 consists of digits 2 and 4.
%p A380984 p:= 1: R:= NULL: count:= 0:
%p A380984 while count < 11 do
%p A380984 p:= nextprime(p);
%p A380984 if nops(convert(convert(p*(p-1),base,10),set)) = 2 then
%p A380984      R:= R,p; count:= count+1
%p A380984 fi;
%p A380984 od:
%p A380984 R;
%t A380984 Select[Prime[Range[10^6]],Length[Union[IntegerDigits[#(#-1)]]]==2&] (* _James C. McMahon_, Feb 13 2025 *)
%o A380984 (PARI) isok(k) = isprime(k) && #Set(digits(k*(k-1))) == 2; \\ _Michel Marcus_, Feb 11 2025
%o A380984 (Python)
%o A380984 from math import isqrt
%o A380984 from itertools import count, combinations, product, islice
%o A380984 from sympy import isprime
%o A380984 def A380984_gen(): # generator of terms
%o A380984     for n in count(1):
%o A380984         c = []
%o A380984         for a in combinations('0123456789',2):
%o A380984             if '0' in a or '2' in a or '6' in a:
%o A380984                 for b in product(a,repeat=n):
%o A380984                     if b[0] != '0' and b[-1] in {'0','2','6'} and b != (a[0],)*n and b != (a[1],)*n:
%o A380984                         m = int(''.join(b))
%o A380984                         q = isqrt(m)
%o A380984                         if q*(q+1)==m and isprime(q+1):
%o A380984                             c.append(q+1)
%o A380984         yield from sorted(c)
%o A380984 A380984_list = list(islice(A380984_gen(),10)) # _Chai Wah Wu_, Feb 19 2025
%Y A380984 Cf. A076850, A096507, A380974.
%K A380984 nonn,base,more
%O A380984 1,1
%A A380984 _Robert Israel_, Feb 11 2025
%E A380984 a(12)-a(17) from _Jinyuan Wang_, Feb 12 2025