login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A325934 Primes consisting of a single 1 and at least one copy of some other digit. 1
13, 17, 19, 31, 41, 61, 71, 199, 313, 331, 661, 881, 919, 991, 1777, 1999, 2221, 3313, 3331, 4441, 6661, 7177, 7717, 9199, 31333, 33331, 71777, 99991, 199999, 313333, 331333, 333331, 991999, 999199, 3331333, 3333133, 3333313, 3333331, 9999991, 19999999 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The second Mathematica program below is more complicated than the first but is more efficient. It takes advantage of the observation that any number with a single digit one and one or more copies of another digit from among 2, 4, 5, 6, or 8 can only be prime if the one is the last (least significant) digit. Thus, there is no need to generate or test any permutations of such a number. This means that the program generates and tests only 37.5% as many candidate numbers as the first Mathematica program below. On my laptop computer, in 2019, the first Mathematica program took about 8.2 seconds to compute all terms containing up to 200 digits, whereas the second Mathematica program only took about 6.4 seconds to do the same. - Harvey P. Dale, Sep 20 2019
A further improvement could be made by not testing any permutations of one together with 2, 5, 8, 11, etc. copies of seven, since any such number will have a digital sum of a multiple of three and thus cannot be prime. - Harvey P. Dale, Sep 23 2019
LINKS
MATHEMATICA
Select[Flatten[Table[FromDigits/@Permutations[PadRight[{1}, n, k]], {n, 10}, {k, Range[2, 9]}]], PrimeQ]//Union
Module[{nn=10, c1, c2}, c1=Select[Table[FromDigits[PadLeft[{1}, n, k]], {k, {2, 4, 5, 6, 8}}, {n, 2, nn}]//Flatten, PrimeQ]; c2=Select[FromDigits/@ Flatten[ Permutations/@Flatten[Table[PadLeft[{1}, n, k], {k, {3, 7, 9}}, {n, 2, nn}], 1], 1], PrimeQ]; Sort[Flatten[Join[{c1, c2}]]]] (* Harvey P. Dale, Sep 20 2019 *)
PROG
(PARI) lista(nn) = {forprime(p=1, nn, my(d = digits(p)); if ((#Set(d) == 2) && (#select(x->(x==1), d) == 1), print1(p, ", ")); ); } \\ Michel Marcus, Sep 11 2019
CROSSREFS
Subsequence of A208270. Subsequence of A235154.
Sequence in context: A059500 A104213 A178550 * A105896 A112741 A111380
KEYWORD
nonn,base
AUTHOR
Harvey P. Dale, Sep 09 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 02:16 EDT 2024. Contains 371264 sequences. (Running on oeis4.)