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.

Previous Showing 11-13 of 13 results.

A174844 Primes that generate three other primes when 2, 6, and 8, respectively, are subtracted from each digit of their decimal representations.

Original entry on oeis.org

9898898899, 889898999999, 889989889889, 898888889989, 989899998889, 999988988989, 988898889999899, 989998888989889, 98888888989989899, 99999998998988999, 888898989989989999, 888998889889898899, 889888889998888999, 889888898999988989, 889988888998998889
Offset: 1

Views

Author

Rick L. Shepherd, Mar 30 2010

Keywords

Comments

Subsequence of A020472. The primes generated from the subtractions are in A020469, A020458, and A020449, respectively. Final digits are necessarily 9 (here), then 7, 3, and 1. Because leading 8's are permitted in the terms here, the primes generated by subtracting 8's may have fewer digits than the others.

Examples

			9898898899 is prime and so are 7676676677, 3232232233, and 1010010011, so it is a term. Although 9349, 9349-2222=7127, 9349-6666=2683, and 9349-8888=461 are four primes, 9349 is not a term as subtracting 6 or 8 from the digits 3 and 4 is not possible (no "borrowing" is permitted).
		

Crossrefs

Programs

  • Maple
    Res:= NULL: count:= 0:
    for d from 2 while count < 100 do
      v:= (10^d-1)/9;
      for m from 1 to d do
        if m mod 3 <> 0 and 2*d+m mod 3 <> 0 then
          for S in combinat:-choose([$1..(d-2)],m-1) do
            q:= 1+add(10^i,i=S);
            if andmap(isprime, [q, 2*v+q, 6*v+q, 8*v+q]) then
               count:= count+1; Res:= Res, 8*v+q;
            fi
          od;
        fi
      od;
    od:
    sort([Res]); # Robert Israel, Nov 14 2022
  • Mathematica
    okQ[n_]:=Module[{idn=IntegerDigits[n]},And@@PrimeQ[FromDigits/@ {idn-2, idn-6, idn-8}]]; Select[Flatten[Table[Select[FromDigits/@ Tuples[ {8,9},n], PrimeQ],{n,18}]],okQ] (* Harvey P. Dale, Jul 27 2011 *)
  • PARI
    {/* Program based on that of M. F. Hasler in A020472. */
    for(nd=1, 20, p=vector(nd, i, 10^(nd-i))~; r=(10^nd-1)/9;
    forvec(v=vector(nd, i, [8+(i==nd), 9]), q=v*p; isprime(q) &&
    isprime(q-2*r ) && isprime(q-6*r ) && isprime(q-8*r ) && print1(q", ")))}
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): # generator of terms
        for d in count(2):
            subs = list(map(int, ["2"*d, "6"*d, "8"*d]))
            for first in product("89", repeat=d-1):
                t = int("".join(first) + "9")
                if isprime(t) and all(isprime(t-s) for s in subs): yield t
    print(list(islice(agen(), 15))) # Michael S. Branicky, Nov 15 2022

A386354 Primes without {6, 7} as digits.

Original entry on oeis.org

2, 3, 5, 11, 13, 19, 23, 29, 31, 41, 43, 53, 59, 83, 89, 101, 103, 109, 113, 131, 139, 149, 151, 181, 191, 193, 199, 211, 223, 229, 233, 239, 241, 251, 281, 283, 293, 311, 313, 331, 349, 353, 359, 383, 389, 401, 409, 419, 421, 431, 433, 439, 443, 449, 491, 499
Offset: 1

Views

Author

Jason Bard, Jul 20 2025

Keywords

Crossrefs

Intersection of A038614 and A038615.

Programs

  • Magma
    [p: p in PrimesUpTo(10^6) | Set(Intseq(p)) subset [0, 1, 2, 3, 4, 5, 8, 9]];
    
  • Mathematica
    Select[Prime[Range[120]], DigitCount[#, 10, 6] == 0 && DigitCount[#, 10, 7] == 0 &]
  • PARI
    primes_with(, 1, [0, 1, 2, 3, 4, 5, 8, 9]) \\ uses function in A385776
  • Python
    print(list(islice(primes_with("01234589"), 41))) # uses function/imports in A385776
    

A386004 Primes whose digit set intersects the odd digits in at most one element and intersects the even digits in at most two elements.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 181, 211, 223, 227, 229, 233, 241, 263, 269, 277, 281, 283, 383, 401, 409, 421, 433, 443, 449, 461, 463, 467, 487, 499, 601, 607, 641, 643, 647, 661, 677, 683, 727, 787, 809, 811, 821, 823, 827, 829, 863
Offset: 1

Views

Author

Jean-Marc Rebert, Jul 14 2025

Keywords

Comments

From David A. Corneth, Jul 14 2025: (Start)
Terms can have at most three distinct digits.
Terms > 5 cannot have a digit 5. Proof: Terms > 5 are odd as they are prime. They cannot have a last digit 5. So if they have a digit 5 then they have at least two distinct odd digits contradicting the sequence definition of having at most one odd digit. (End)

Examples

			101 is a term because it is prime and its digit set is {0, 1} — containing at most one odd digit and no more than two distinct even digits.
1021 is a term because it is prime and its digit set is {0,1,2} — containing at most one odd digit and no more than two distinct even digits.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[150]],Length[Intersection[d=IntegerDigits[#],{1,3,5,7,9}]]<=1 && Length[Intersection[d,{0,2,4,6,8}]]<=2 &] (* Stefano Spezia, Jul 14 2025 *)
  • PARI
    is(n) = if(!isprime(n), return(0)); my(s=Set(digits(n)), odd=0); if(#s>3,return(0)); odd=sum(i=1, #s ,bitand(s[i], 1)); if(odd > 1, return(0)); if(#s-odd > 2, return(0)); 1 \\ David A. Corneth, Jul 14 2025
Previous Showing 11-13 of 13 results.