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.

A235154 Primes which have one or more occurrences of exactly two different digits.

This page as a plain text file.
%I A235154 #37 May 20 2025 21:33:48
%S A235154 13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,113,
%T A235154 131,151,181,191,199,211,223,227,229,233,277,311,313,331,337,353,373,
%U A235154 383,433,443,449,499,557,577,599,661,677,727,733,757,773,787,797,811
%N A235154 Primes which have one or more occurrences of exactly two different digits.
%C A235154 The first term having a repeated digit is 101.
%C A235154 a(3402) > 10^10.
%H A235154 Michael S. Branicky, <a href="/A235154/b235154.txt">Table of n, a(n) for n = 1..12000</a> (terms 651..3401 from Christopher M. Conrey, terms 1..650 from Colin Barker)
%H A235154 David A. Corneth, <a href="/A235154/a235154.gp.txt">PARI program</a>
%o A235154 (PARI) s=[]; forprime(n=10, 1000, if(#vecsort(eval(Vec(Str(n))),,8)==2, s=concat(s, n))); s
%o A235154 (PARI) is(n)=isprime(n) && #Set(digits(n))==2 \\ _Charles R Greathouse IV_, Feb 23 2017
%o A235154 (PARI) \\ See Corneth link
%o A235154 (Python)
%o A235154 from sympy import isprime
%o A235154 from sympy.utilities.iterables import multiset_permutations
%o A235154 from itertools import count, islice, combinations_with_replacement, product
%o A235154 def agen():
%o A235154     for digits in count(2):
%o A235154         s = set()
%o A235154         for pair in product("0123456789", "1379"):
%o A235154             if pair[0] == pair[1]: continue
%o A235154             for c in combinations_with_replacement(pair, digits):
%o A235154                 if len(set(c)) < 2 or sum(int(ci) for ci in c)%3 == 0:
%o A235154                     continue
%o A235154                 for p in multiset_permutations(c):
%o A235154                     if p[0] == "0": continue
%o A235154                     t = int("".join(p))
%o A235154                     if isprime(t):
%o A235154                         s.add(t)
%o A235154         yield from sorted(s)
%o A235154 print(list(islice(agen(), 100))) # _Michael S. Branicky_, Jan 23 2022
%Y A235154 Cf. A034845, A235155-A235161, A030291.
%K A235154 nonn,base
%O A235154 1,1
%A A235154 _Colin Barker_, Jan 04 2014