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.

Showing 1-10 of 12 results. Next

A019546 Primes whose digits are primes; primes having only {2, 3, 5, 7} as digits.

Original entry on oeis.org

2, 3, 5, 7, 23, 37, 53, 73, 223, 227, 233, 257, 277, 337, 353, 373, 523, 557, 577, 727, 733, 757, 773, 2237, 2273, 2333, 2357, 2377, 2557, 2753, 2777, 3253, 3257, 3323, 3373, 3527, 3533, 3557, 3727, 3733, 5227, 5233, 5237, 5273, 5323, 5333, 5527, 5557
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Intersection of A046034 and A000040; A055642(a(n)) = A193238(a(n)). - Reinhard Zumkeller, Jul 19 2011
Ribenboim mentioned in 2000 the following number as largest known term: 72323252323272325252 * (10^3120 - 1) / (10^20 - 1) + 1. It has 3120 digits, and was discovered by Harvey Dubner in 1992. Larger terms are 22557252272*R(15600)/R(10) and 2255737522*R(15600) where R(n) denotes the n-th repunit (see A002275): Both have 15600 digits and were found in 2002, also by Dubner (see Weisstein link). David Broadhurst reports in 2003 an even longer number with 82000 digits: (10^40950+1) * (10^20055+1) * (10^10374 + 1) * (10^4955 + 1) * (10^2507 + 1) * (10^1261 + 1) * (3*R(1898) + 555531001*10^940 - R(958)) + 1, see link. - Reinhard Zumkeller, Jan 13 2012
The smallest and largest primes that use exactly once the four prime decimal digits are respectively a(27)= 2357 and a(54) = 7523. - Bernard Schott, Apr 27 2023

References

  • Paulo Ribenboim, Prime Number Records (Chap 3), in 'My Numbers, My Friends', Springer-Verlag 2000 NY, page 76.

Crossrefs

Cf. A020463 (subsequence).
A093162, A093164, A093165, A093168, A093169, A093672, A093674, A093675, A093938 and A093941 are subsequences. - XU Pingya, Apr 20 2017

Programs

  • Haskell
    a019546 n = a019546_list !! (n-1)
    a019546_list = filter (all (`elem` "2357") . show )
                          ([2,3,5] ++ (drop 2 a003631_list))
    -- Or, much more efficient:
    a019546_list = filter ((== 1) . a010051) $
                          [2,3,5,7] ++ h ["3","7"] where
       h xs = (map read xs') ++ h xs' where
         xs' = concat $ map (f xs) "2357"
         f xs d = map (d :) xs
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [p: p in PrimesUpTo(5600) | Set(Intseq(p)) subset [2,3,5,7]]; // Bruno Berselli, Jan 13 2012
    
  • Mathematica
    Select[Prime[Range[700]], Complement[IntegerDigits[#], {2, 3, 5, 7}] == {} &] (* Alonso del Arte, Aug 27 2012 *)
    Select[Prime[Range[700]], AllTrue[IntegerDigits[#], PrimeQ] &] (* Ivan N. Ianakiev, Jun 23 2018 *)
    Select[Flatten[Table[FromDigits/@Tuples[{2,3,5,7},n],{n,4}]],PrimeQ] (* Harvey P. Dale, Apr 05 2025 *)
  • PARI
    is_A019546(n)=isprime(n) & !setminus(Set(Vec(Str(n))),Vec("2357")) \\ M. F. Hasler, Jan 13 2012
    
  • PARI
    print1(2); for(d=1,4, forstep(i=1,4^d-1,[1,1,2], p=sum(j=0,d-1,10^j*[2,3,5,7][(i>>(2*j))%4+1]); if(isprime(p), print1(", "p)))) \\ Charles R Greathouse IV, Apr 29 2015
    
  • Python
    from itertools import product
    from sympy import isprime
    A019546_list = [2,3,5,7]+[p for p in (int(''.join(d)+e) for l in range(1,5) for d in product('2357',repeat=l) for e in '37') if isprime(p)] # Chai Wah Wu, Jun 04 2021

Extensions

More terms from Cino Hilliard, Aug 06 2006
Thanks to Charles R Greathouse IV and T. D. Noe for massive editing support.

A034844 Primes with only nonprime decimal digits.

Original entry on oeis.org

11, 19, 41, 61, 89, 101, 109, 149, 181, 191, 199, 401, 409, 419, 449, 461, 491, 499, 601, 619, 641, 661, 691, 809, 811, 881, 911, 919, 941, 991, 1009, 1019, 1049, 1061, 1069, 1091, 1109, 1181, 1409, 1481, 1489, 1499, 1601, 1609, 1619, 1669, 1699, 1801, 1811
Offset: 1

Views

Author

Keywords

Comments

A109066(n) = 0 iff prime(n) is in this sequence. [Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012]
Or, primes p such that A193238(p) = 0. - M. F. Hasler, Aug 27 2012
Intersection of A084984 and A000040; complement of A179336 (within the primes A000040). [Reinhard Zumkeller, Jul 19 2011, edited by M. F. Hasler, Aug 27 2012]
The smallest prime that contains all the six nonprime decimal digits is a(694) = 104869 (see Prime Curios! link). - Bernard Schott, Mar 21 2023

Examples

			E.g. 149 is a prime made of nonprime digits(1,4,9).
991 is a prime without any prime digits.
		

Crossrefs

Programs

  • Haskell
    a034844 n = a034844_list !! (n-1)
    a034844_list = filter (not . any  (`elem` "2357") . show ) a000040_list
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [p: p in PrimesUpTo(2000) | forall{d: d in [2,3,5,7] | d notin Set(Intseq(p))}];  // Bruno Berselli, Jul 27 2011
    
  • Mathematica
    Select[Prime[Range[279]], Intersection[IntegerDigits[#], {2, 3, 5, 7}] == {} &] (* Jayanta Basu, Apr 18 2013 *)
    Union[Select[Flatten[Table[FromDigits/@Tuples[{1,4,6,8,9,0},n],{n,2,4}]],PrimeQ]] (* Harvey P. Dale, Dec 08 2014 *)
  • PARI
    is_A034844(n)=isprime(n)&!apply(x->isprime(x),eval(Vec(Str(n)))) \\ M. F. Hasler, Aug 27 2012
    
  • PARI
    is_A034844(n)=isprime(n)&!setintersect(Set(Vec(Str(n))),Vec("2357")) \\ M. F. Hasler, Aug 27 2012
    
  • Python
    from sympy import isprime
    from itertools import product
    def auptod(maxdigits):
        alst = []
        for d in range(1, maxdigits+1):
            for p in product("014689", repeat=d-1):
                if d > 1 and p[0] == "0": continue
                for end in "19":
                    s = "".join(p) + end
                    t = int(s)
                    if isprime(t): alst.append(t)
        return alst
    print(auptod(4)) # Michael S. Branicky, Nov 19 2021

Formula

a(n) >> n^1.285. [Charles R Greathouse IV, Feb 20 2012]

Extensions

Edited by N. J. A. Sloane, Feb 22 2009 at the suggestion of R. J. Mathar

A033274 Primes that do not contain any other prime as a proper substring.

Original entry on oeis.org

2, 3, 5, 7, 11, 19, 41, 61, 89, 101, 109, 149, 181, 401, 409, 449, 491, 499, 601, 691, 809, 881, 991, 1009, 1049, 1069, 1481, 1609, 1669, 1699, 1801, 4001, 4049, 4481, 4649, 4801, 4909, 4969, 6091, 6469, 6481, 6869, 6949, 8009, 8069, 8081, 8609, 8669, 8681
Offset: 1

Views

Author

Keywords

Comments

If there is more than one digit, all digits must be nonprime numbers.
A179335(n) = prime(n) iff prime(n) is in this sequence. For n > 4, prime(n) is in this sequence iff A109066(n) = 0. - Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012
A079066(n) = 0 iff prime(n) is in this sequence. [Corrected by M. F. Hasler, Aug 27 2012]
What are the asymptotics of this sequence? - Charles R Greathouse IV, Aug 27 2012

Examples

			149 is a term as 1, 4, 9, 14, 49 are all nonprimes.
199 is not a term as 19 is a prime.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a033274 n = a033274_list !! (n-1)
    a033274_list = map (a000040 . (+ 1)) $ elemIndices 0 a079066_list
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Mathematica
    f[n_] := Block[ {id = IntegerDigits@n}, len = Length@ id - 1; Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[ id, k, 1], {k, len}], 1]], True] + 1]; Select[ Prime@ Range@ 1100, f@# == 1 &] (* Robert G. Wilson v, Aug 01 2010 *)
    Select[Prime[Range[1100]],NoneTrue[Flatten[Table[FromDigits/@Partition[IntegerDigits[#],d,1],{d,IntegerLength[#]-1}]],PrimeQ]&] (* Harvey P. Dale, Apr 19 2025 *)
  • Python
    from sympy import isprime
    def ok(n):
        if n in {2, 3, 5, 7}: return True
        s = str(n)
        if set(s) & {"2", "3", "5", "7"} or not isprime(n): return False
        ss2 = set(s[i:i+l] for i in range(len(s)-1) for l in range(2, len(s)))
        return not any(isprime(int(ss)) for ss in ss2)
    print([k for k in range(9000) if ok(k)]) # Michael S. Branicky, Jun 29 2022

Extensions

Edited by N. J. A. Sloane at the suggestion of Luca Colucci, Apr 03 2008

A193238 Number of prime digits in decimal representation of n.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 19 2011

Keywords

Crossrefs

Programs

Formula

a(A084984(n))=0; a(A118950(n))>0; a(A092620(n))=1; a(A092624(n))=2; a(A092625(n))=3; a(A046034(n))=A055642(A046034(n));
a(A000040(n)) = A109066(n).
From Hieronymus Fischer, May 30 2012: (Start)
a(n) = sum_{j=1..m+1} (floor(n/10^j+0.3) + floor(n/10^j+0.5) + floor(n/10^j+0.8) - floor(n/10^j+0.2) - floor(n/10^j+0.4) - floor(n/10^j+0.6)), where m=floor(log_10(n)), n>0.
a(10n+k) = a(n) + a(k), 0<=k<10, n>=0.
a(n) = a(floor(n/10)) + a(n mod 10), n>=0.
a(n) = sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.
a(A046034(n)) = floor(log_4(3n+1)), n>0.
a(A211681(n)) = 1 + floor((n-1)/4), n>0.
G.f.: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j) + x^(3*10^j)+ x^(5*10^j) + x^(7*10^j))*(1-x^10^j)/(1-x^10^(j+1)).
Also: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j)- x^(4*10^j)+ x^(5*10^j)- x^(6*10^j)+ x^(7*10^j)- x^(8*10^j))/(1-x^10^(j+1)). (End)

A179336 Primes containing at least one prime digit in base 10.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 23, 29, 31, 37, 43, 47, 53, 59, 67, 71, 73, 79, 83, 97, 103, 107, 113, 127, 131, 137, 139, 151, 157, 163, 167, 173, 179, 193, 197, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 11 2010

Keywords

Comments

a(n) = A080608(n) for n<28; A080608 is a subsequence;
A179335(n) < 10 iff prime(n) is in this sequence;
A109066(n) > 0 iff prime(n) is in this sequence. [Corrected by M. F. Hasler, Aug 27 2012]

Crossrefs

Intersection of A118950 and A000040; relative complement A000040 \ A034844.

Programs

  • Haskell
    a179336 n = a179336_list !! (n-1)
    a179336_list = filter (any (`elem` "2357") . show ) a000040_list
    -- Reinhard Zumkeller, Jul 19 2011

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Nov 01 2022

A155548 Primes p such that p and the p-th prime have the same number of prime digits.

Original entry on oeis.org

2, 3, 7, 17, 37, 47, 73, 83, 89, 97, 113, 163, 179, 193, 197, 251, 347, 359, 383, 397, 421, 431, 443, 487, 541, 547, 571, 593, 607, 617, 631, 653, 673, 677, 719, 727, 743, 751, 761, 787, 821, 829, 857, 877, 881, 883, 947, 971, 1009, 1013, 1019, 1021, 1051, 1087
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 24 2009

Keywords

Comments

Prime digit = 2, 3, 5 or 7.

Examples

			2 is a term because 2 is prime, prime(2)=3, and 2 and 3 each have 1 prime digit.
3 is a term because 3 is prime, prime(3)=5, and 3 and 5 each have 1 prime digit.
4 is not a term because 4 is not prime.
5 is prime, but prime(5)=11, and 5 has 1 prime digit while 11 has 0 prime digits, so 5 is not a term.
		

Crossrefs

Programs

  • Maple
    mm := proc (m) options operator, arrow: convert(m, base, 10) end proc: a := proc (n) local t, s, j: t := 0: s := 0: for j to nops(mm(n)) do if isprime(mm(n)[j]) = true then t := t+1 else end if end do: for j to nops(mm(ithprime(n))) do if isprime(mm(ithprime(n))[j]) = true then s := s+1 else end if end do: if isprime(n) = true and t = s then n else end if end proc: seq(a(n), n = 1 .. 1300); # Emeric Deutsch, Jan 28 2009

Extensions

Corrected (added 761, 857; deleted 977) and extended by Emeric Deutsch, Jan 28 2009
Edited by Jon E. Schoenfield, Jan 20 2019

A156343 Primes with equal number of prime and nonprime digits.

Original entry on oeis.org

13, 17, 29, 31, 43, 47, 59, 67, 71, 79, 83, 97, 1033, 1123, 1153, 1213, 1217, 1229, 1231, 1259, 1279, 1283, 1297, 1303, 1307, 1321, 1367, 1423, 1427, 1433, 1453, 1531, 1543, 1559, 1567, 1571, 1579, 1583, 1597, 1627, 1637, 1657, 1721, 1747, 1759, 1783, 1787
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 08 2009

Keywords

Comments

Prime digits are 2, 3, 5 or 7. Nonprime digits are 0, 1, 4, 6, 8 or 9.
Complement of (A154385 U A154386). [Juri-Stepan Gerasimov, Nov 29 2009]

Examples

			13 (1=nonprime, 3=prime) = a(1).
		

Crossrefs

Programs

  • Maple
    A109066c := proc(n) nops(convert(n,base,10))-A109066(n) ; end:
    A109066 := proc(n) local dgs,a ; dgs := convert(n,base,10) ; a := 0 ; for i in dgs do if isprime(i) then a := a+1 ; fi; od: a ; end:
    for i from 1 to 400 do p := ithprime(i) ; if A109066(p) = A109066c(p) then printf("%d,",p) ; fi; od: # R. J. Mathar, Feb 09 2009
  • Mathematica
    Select[Prime[Range[5,300]],Length[Select[IntegerDigits[#],PrimeQ]]==Length[ Select[ IntegerDigits[ #],!PrimeQ[ #]&]]&] (* Harvey P. Dale, Dec 15 2022 *)
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        s, counts = str(n), [0, 0]
        for c in s: counts[int(c in "2357")] += 1
        return counts[0] == counts[1]
    print([k for k in range(10**4) if ok(k)]) # Michael S. Branicky, Apr 23 2024

A155552 Primes p such that (number of prime digits of p) > (number of prime digits of prime(p)).

Original entry on oeis.org

5, 13, 23, 29, 43, 53, 79, 127, 157, 167, 173, 223, 227, 229, 233, 239, 257, 263, 271, 277, 283, 293, 313, 317, 337, 353, 373, 379, 433, 523, 557, 563, 577, 647, 757, 773, 797, 839, 853, 859, 863, 887, 977, 1103, 1117, 1123, 1153, 1171, 1187, 1193, 1217
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 24 2009

Keywords

Crossrefs

Programs

Extensions

Corrected (337 inserted, 761 removed etc.) by R. J. Mathar, May 15 2010

A155555 Primes p such that (number of prime digits of p) < (number of prime digits of prime(p)).

Original entry on oeis.org

11, 19, 31, 41, 59, 61, 67, 71, 101, 103, 107, 109, 131, 137, 139, 149, 151, 181, 191, 199, 211, 241, 269, 281, 307, 311, 331, 349, 367, 389, 401, 409, 419, 439, 449, 457, 461, 463, 467, 479, 491, 499, 503, 509, 521, 569, 587, 599, 601, 613, 619, 641, 643
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 24 2009

Keywords

Comments

Prime digits are 2, 3, 5, 7.

Crossrefs

Programs

  • PARI
    dp(n)=d=digits(n);c=0;for(i=1,#d,if(isprime(d[i]),c+=1));c
    forprime(p=1,500,if(dp(p)Derek Orr, Feb 28 2017

Extensions

Corrected (87 removed) by R. J. Mathar, May 15 2010

A154762 Primes with the same number of decimal digits that are {1, 9} as {2, 3, 5, 7}.

Original entry on oeis.org

13, 17, 29, 31, 59, 71, 79, 97, 103, 107, 163, 167, 241, 269, 281, 349, 389, 421, 431, 439, 479, 509, 541, 569, 613, 617, 631, 659, 701, 709, 761, 769, 821, 829, 839, 859, 907, 947, 967, 983, 1063, 1087, 1123, 1153, 1213, 1217, 1229, 1231, 1259, 1279, 1297
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 15 2009

Keywords

Comments

Primes with the same number of prime decimal digits as odd nonprime digits.

Programs

  • Maple
    digs1or9 := proc(n) local a,c; a := 0 ; for c in convert(n,base,10) do if c in {1,9} then a := a+1 ; end if; end do; a; end proc: A109066 := proc(n) local a,d; p := ithprime(n) ; a := 0 ; for d in convert(p,base,10) do if isprime(d) then a := a+1 ; end if; end do; a; end proc: for n from 1 to 400 do p := ithprime(n) ; if digs1or9(p) = A109066(n) then printf("%d,",p) ; fi; od: # R. J. Mathar, Oct 22 2009
  • Mathematica
    ddQ[n_]:=Module[{idn=IntegerDigits[n]},Count[idn,1|9]==Count[idn, 2|3|5|7]]; Select[Prime[Range[250]],ddQ] (* Harvey P. Dale, Nov 29 2011 *)
Showing 1-10 of 12 results. Next