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.

A078348 Primes p such that every decimal digit d in p appears exactly d times.

This page as a plain text file.
%I A078348 #18 Aug 11 2022 03:19:19
%S A078348 3313,3331,32233,32323,33223,123323,132233,223133,223313,223331,
%T A078348 231323,233231,312233,321323,323123,3344443,3434443,3443443,4434343,
%U A078348 4443433,14334443,14443343,14443433,31434443,31443443,33434441,33555553
%N A078348 Primes p such that every decimal digit d in p appears exactly d times.
%C A078348 The largest term is the prime 99999999988888888777777766666655555444223343.
%H A078348 Giovanni Resta, <a href="/A078348/b078348.txt">Table of n, a(n) for n = 1..10000</a>
%e A078348 In the prime 3313 the digit "1" appears exactly one time and the digit "3" appears exactly three times.
%t A078348 ddp[x_]:=Select[FromDigits/@Permutations[Flatten[PadRight[{},#,#]&/@x]], PrimeQ]; Take[Flatten[ddp/@Subsets[Range[5]]]//Sort,40] (* _Harvey P. Dale_, May 13 2020 *)
%o A078348 (Python)
%o A078348 from sympy import isprime
%o A078348 from itertools import chain, combinations as C, count, islice
%o A078348 from sympy.utilities.iterables import multiset_permutations as mp
%o A078348 def powerset(s):
%o A078348     return chain.from_iterable(C(s, r) for r in range(len(s)+1))
%o A078348 def agen():
%o A078348     sumlst = [[] for i in range(46)]
%o A078348     for s in powerset(range(1, 10)): sumlst[sum(s)].append(s)
%o A078348     for numdigits in count(1):
%o A078348         found = set()
%o A078348         for t in sumlst[numdigits]:
%o A078348             diglst = "".join(str(i)*i for i in t)
%o A078348             for m in mp(diglst, numdigits):
%o A078348                 t = int("".join(m))
%o A078348                 if isprime(t): found.add(t)
%o A078348         yield from sorted(found)
%o A078348 print(list(islice(agen(), 30))) # _Michael S. Branicky_, Aug 10 2022
%Y A078348 Primes in A108571.
%K A078348 base,easy,fini,nonn
%O A078348 1,1
%A A078348 _Carlos Rivera_, Nov 22 2002