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 15 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.

A046034 Numbers whose digits are primes.

Original entry on oeis.org

2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 222, 223, 225, 227, 232, 233, 235, 237, 252, 253, 255, 257, 272, 273, 275, 277, 322, 323, 325, 327, 332, 333, 335, 337, 352, 353, 355, 357, 372, 373, 375, 377, 522, 523, 525, 527, 532
Offset: 1

Views

Author

Keywords

Comments

If n is represented as a zerofree base-4 number (see A084544) according to n=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j=0..m} c(d(j))*10^j, where c(k)=2,3,5,7 for k=1..4. - Hieronymus Fischer, May 30 2012
According to A153025, it seems that 5, 235 and 72335 are the only terms whose square is also a term, i.e., which are also in the sequence A275971 of square roots of the terms which are squares, listed in A191486. - M. F. Hasler, Sep 16 2016

Examples

			a(100)   = 2277,
a(10^3)  = 55327,
a(9881)  = 3233232,
a(10^4)  = 3235757,
a(10922) = 3333333,
a(10^5)  = 227233257.
		

Crossrefs

Programs

  • Haskell
    a046034 n = a046034_list !! (n-1)
    a046034_list = filter (all (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [n: n in [2..532] | Set(Intseq(n)) subset [2, 3, 5, 7]];  // Bruno Berselli, Jul 19 2011
    
  • Mathematica
    Table[FromDigits /@ Tuples[{2, 3, 5, 7}, n], {n, 3}] // Flatten (* Michael De Vlieger, Sep 19 2016 *)
  • PARI
    is_A046034(n)=Set(isprime(digits(n)))==[1] \\ M. F. Hasler, Oct 12 2013
    
  • Python
    def A046034(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join(('2357'[(3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3] for j in range(m)))) # Chai Wah Wu, Feb 08 2023

Formula

A055642(a(n)) = A193238(a(n)). - Reinhard Zumkeller, Jul 19 2011
From Hieronymus Fischer, Apr 20, May 30 and Jun 25 2012: (Start)
a(n) = Sum_{j=0..m-1} ((2*b(j)+1) mod 8 + floor(b(j)/4) - floor((b(j)-1)/4))*10^j, where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).
a(n) = Sum_{j=0..m-1} A010877(A005408(b(j)) + A002265(b(j)) - A002265(b(j)-1))*10^j.
Special values:
a(1*(4^n-1)/3) = 2*(10^n-1)/9.
a(2*(4^n-1)/3) = 1*(10^n-1)/3.
a(3*(4^n-1)/3) = 5*(10^n-1)/9.
a(4*(4^n-1)/3) = 7*(10^n-1)/9.
Inequalities:
a(n) <= 2*(10^log_4(3*n+1)-1)/9, equality holds for n = (4^k-1)/3, k>0.
a(n) <= 2*A084544(n), equality holds iff all digits of A084544(n) are 1.
a(n) > A084544(n).
Lower and upper limits:
lim inf a(n)/10^log_4(n) = (7/90)*10^log_4(3) = 0.48232167706987..., for n -> oo.
lim sup a(n)/10^log_4(n) = (2/9)*10^log_4(3) = 1.378061934485343..., for n -> oo.
where 10^log_4(n) = n^1.66096404744...
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(2 + z(j) + 2*z(j)^2 + 2*z(j)^3 - 7*z(j)^4)/(1-z(j)^4), where z(j) = x^4^j.
Also g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1-z(j))*(2 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3)/(1-z(j)^4), where z(j)=x^4^j.
Also: g(x) = (1/(1-x))*(2*h_(4,0)(x) + h_(4,1)(x) + 2*h_(4,2)(x) + 2*h_(4,3)(x) - 7*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3)*x^(k*4^j)/(1-x^4^(j+1)). (End)
Sum_{n>=1} 1/a(n) = 1.857333779940977502574887651449435985318556794733869779170825138954093657197... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

More terms from Cino Hilliard, Aug 06 2006
Typo in second formula corrected by Hieronymus Fischer, May 12 2012
Two typos in example section corrected by Hieronymus Fischer, May 30 2012

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

A055640 Number of nonzero digits in decimal expansion of n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jun 06 2000

Keywords

Comments

Comment from Antti Karttunen, Sep 05 2004: (Start)
Also number of characters needed to write the number n in classical Greek alphabetic system, up to n=999. The Greek alphabetic system assigned values to the letters as follows:
alpha = 1, beta = 2, gamma = 3, delta = 4, epsilon = 5, digamma = 6, zeta = 7, eta = 8, theta = 9, iota = 10, kappa = 20, lambda = 30, mu = 40, nu = 50, xi = 60, omicron = 70, pi = 80, koppa = 90, rho = 100, sigma = 200, tau = 300, upsilon = 400, phi = 500, chi = 600, psi = 700, omega = 800, sampi = 900. (End)
For partial sums see A102685. - Hieronymus Fischer, Jun 06 2012

Examples

			129 is written as rho kappa theta in the old Greek system.
		

References

  • L. Threatte, The Greek Alphabet, in The World's Writing Systems, edited by Peter T. Daniels and William Bright, Oxford Univ. Press, 1996, p. 278.

Crossrefs

Differs from A098378 for the first time at position n=200 with a(200)=1, as only one nonzero Arabic digit (and only one Greek letter) is needed for two hundred, while A098378(200)=2 as two characters are needed in the Ethiopic system.

Programs

Formula

From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j+0.9) - floor(n/10^j)), where m = floor(log_10(n)).
a(n) = m + 1 - A055641(n).
G.f.: (1/(1-x))*Sum_{j>=0} (x^10^j - x^(10*10^j))/(1-x^10^(j+1)). (End)
a(n) = A055642(n) - A055641(n).

A084984 Numbers containing no prime digits.

Original entry on oeis.org

0, 1, 4, 6, 8, 9, 10, 11, 14, 16, 18, 19, 40, 41, 44, 46, 48, 49, 60, 61, 64, 66, 68, 69, 80, 81, 84, 86, 88, 89, 90, 91, 94, 96, 98, 99, 100, 101, 104, 106, 108, 109, 110, 111, 114, 116, 118, 119, 140, 141, 144, 146, 148, 149, 160, 161, 164, 166, 168, 169
Offset: 1

Views

Author

Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 27 2003

Keywords

Comments

Complement of A118950. - Reinhard Zumkeller, Jul 19 2011
If n-1 is represented as a base-6 number (see A007092) according to n-1=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n)= sum_{j=0..m} c(d(j))*10^j, where c(k)=0,1,4,6,8,9 for k=0..5. - Hieronymus Fischer, May 30 2012

Examples

			166 has digits 1 and 6 and they are nonprime digits.
a(1000) = 8686.
a(10^4) = 118186
a(10^5) = 4090986.
a(10^6) = 66466686.
		

Crossrefs

Programs

  • Haskell
    a084984 n = a084984_list !! (n-1)
    a084984_list = filter (not . any (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Magma
    [n: n in [0..169] | forall{d: d in [2,3,5,7] | d notin Set(Intseq(n))}];  // Bruno Berselli, Jul 19 2011
    
  • Mathematica
    npdQ[n_]:=And@@Table[FreeQ[IntegerDigits[n],i],{i,{2,3,5,7}}]; Select[ Range[ 0,200],npdQ] (* Harvey P. Dale, Jul 22 2013 *)
  • PARI
    is(n)=isprime(eval(Vec(Str(n))))==0 \\ Charles R Greathouse IV, Feb 20 2012
    
  • PARI
    my(table=[0,1,4,6,8,9]); \
    a(n) = fromdigits([table[d+1] |d<-digits(n-1,6)]); \\ Kevin Ryde, May 27 2025

Formula

A193238(a(n)) = 0. - Reinhard Zumkeller, Jul 19 2011
a(n) >> n^1.285. - Charles R Greathouse IV, Feb 20 2012
From Hieronymus Fischer, May 30 and Jun 25 2012: (Start)
a(n) = ((2*b_m(n)+1) mod 10 + floor((b_m(n)+4)/5) - floor((b_m(n)+1)/5))*10^m + sum_{j=0..m-1} ((2*b_j(n))) mod 12 + floor(b_j(n)/6) - floor((b_j(n)+1)/6) + floor((b_j(n)+4)/6) - floor((b_j(n)+5)/6)))*10^j, where n>1, b_j(n)) = floor((n-1-6^m)/6^j), m = floor(log_6(n-1)).
Special values:
a(1*6^n+1) = 1*10^n.
a(2*6^n+1) = 4*10^n.
a(3*6^n+1) = 6*10^n.
a(4*6^n+1) = 8*10^n.
a(5*6^n+1) = 9*10^n.
a(2*6^n) = 2*10^n - 1.
a(n) = 10^log_6(n-1) for n=6^k+1, k>0.
Inequalities:
a(n) < 10^log_6(n-1) for 6^k+10.
a(n) > 10^log_6(n-1) for 2*6^k=0.
a(n) <= 4*10^(log_6(n-1)-log_6(2)) = 1.641372618*10^(log_6(n-1)), equality holds for n=2*6^k+1, k>=0.
a(n) > 2*10^(log_6(n-1)-log_6(2)) = 0.820686309*10^(log_6(n-1)).
a(n) = A007092(n-1) iff the digits of A007092(n-1) are 0 or 1, a(n)>A007092(n-1), else.
a(n) >= A202267(n), equality holds if the representation of n-1 as a base-6 number has only digits 0 or 1.
Lower and upper limits:
lim inf a(n)/10^log_6(n) = 2/10^log_6(2) = 0.820686309, for n --> inf.
lim sup a(n)/10^log_6(n) = 4/10^log_6(2) = 1.641372618, for n --> inf.
where 10^log_6(n) = n^1.2850972089...
G.f.: g(x) = (x/(1-x))*sum_{j>=0} 10^j*x^6^j * (1-x^6^j)*((1+x^6^j)^4 + 4(1+2x^6^j) * x^(3*6^j))/(1-x^6^(j+1)).
Also: g(x) = (x/(1-x))*(h_(6,1)(x) + 3*h_(6,2)(x) + 2*h_(6,3)(x) + 2*h_(6,4)(x) + h_(6,5)(x) - 9*h_(6,6)(x)), where h_(6,k)(x) = sum_{j>=0} 10^j*x^(k*6^j)/(1-x^6^(j+1)). (End)
Sum_{n>=2} 1/a(n) = 3.614028405471074989720026361356036456697082276983705341077940360653303099111... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

0 added by N. J. A. Sloane, Feb 02 2009
100 added by Arkadiusz Wesolowski, Mar 10 2011
Examples for n>=10^3 added by Hieronymus Fischer, May 30 2012

A202267 Numbers in which all digits are noncomposites (1, 2, 3, 5, 7) or 0.

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 10, 11, 12, 13, 15, 17, 20, 21, 22, 23, 25, 27, 30, 31, 32, 33, 35, 37, 50, 51, 52, 53, 55, 57, 70, 71, 72, 73, 75, 77, 100, 101, 102, 103, 105, 107, 110, 111, 112, 113, 115, 117, 120, 121, 122, 123, 125, 127, 130, 131, 132, 133, 135, 137, 150
Offset: 1

Views

Author

Jaroslav Krizek, Dec 25 2011

Keywords

Comments

If n-1 is represented as a base-6 number (see A007092) according to n-1=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n)= sum_{j=0..m} c(d(j))*10^j, where c(k)=0,1,2,3,5,7 for k=0..5. - Hieronymus Fischer, May 30 2012

Examples

			a(1000) = 5353.
a(10^4) = 115153
a(10^5) = 2070753.
a(10^6) = 33233353.
		

Crossrefs

Supersequence of A001742 and A046034.
Cf. A046034 (numbers in which all digits are primes), A001742 (numbers in which all digits are noncomposites excluding 0), A202268 (numbers in which all digits are nonprimes excluding 0), A084984 (numbers in which all digits are nonprimes), A029581 (numbers in which all digits are composites).

Programs

  • Mathematica
    Union[Flatten[FromDigits/@Tuples[{0,1,2,3,5,7},3]]] (* Harvey P. Dale, Mar 11 2015 *)

Formula

From Hieronymus Fischer, May 30 2012: (Start)
a(n) = (b_m(n)+1) mod 10 + floor((b_m(n)+2)/5) + floor((b_m(n)+1)/5) - 2*floor(b_m(n)/5))*10^m + sum_{j=0..m-1} (b_j(n) mod 6 + floor((b_j(n)+1)/6) + floor((b_j(n)+2)/6) - 2*floor(b_j(n)/6)))*10^j, where n>1, b_j(n)) = floor((n-1-6^m)/6^j), m = floor(log_6(n-1)).
a(1*6^n+1) = 1*10^n.
a(2*6^n+1) = 2*10^n.
a(3*6^n+1) = 3*10^n.
a(4*6^n+1) = 5*10^n.
a(5*6^n+1) = 7*10^n.
a(n) = 10^log_6(n-1) for n=6^k+1, k>0,
a(n) < 10^log_6(n-1) else.
a(n) = A007092(n-1) iff the digits of A007092(n-1) are <= 3, a(n)>A007092(n-1), else.
a(n) <= A084984(n), equality holds if the representation of n-1 as a base-6 number only has digits 0 or 1.
G.f.: g(x) = (x/(1-x))*sum_{j>=0} 10^j*x^6^j *(1-x^6^j)* (1 + 2x^6^j + 3(x^2)^6^j + 5(x^3)^6^j + 7(x^4)^6^j)/(1-x^6^(j+1)).
Also: g(x) = (x/(1-x))*(h_(6,1)(x) + h_(6,2)(x) + h_(6,3)(x) + 2*h_(6,4)(x) + 2*h_(6,5)(x) - 7*h_(6,6)(x)), where h_(6,k)(x) = sum_{j>=0} 10^j*x^(k*6^j)/(1-x^6^(j+1)). (End)
Sum_{n>=2} 1/a(n) = 4.945325883472729555972742252181522711968119529132581193614012706741310832798... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

Examples added by Hieronymus Fischer, May 30 2012

A109066 Number of prime digits in n-th prime.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Jun 17 2005

Keywords

Comments

The prime A000040(n) is in A034844 iff a(n) = 0; it is in A179336 iff a(n) > 0. [Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012]

Crossrefs

Cf. A019546 (primes whose digits are primes), A092629 (number of prime digits is nonprime), A104250 (sum of prime digits of n-th prime).

Programs

  • Mathematica
    a[n_]:=Count[PrimeQ/@IntegerDigits[Prime[n]], True]
  • PARI
    a(n) = vecsum(apply(x->isprime(x), digits(prime(n)))); \\ Michel Marcus, Mar 15 2019

Formula

a(n) = A193238(A000040(n)). [Reinhard Zumkeller, Jul 19 2011]

A118950 Numbers containing at least one prime digit.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 112
Offset: 1

Views

Author

Rick L. Shepherd, May 06 2006

Keywords

Comments

A193238(a(n)) > 0; complement of A084984; A092620, A092624 and A092625 are subsequences. - Reinhard Zumkeller, Jul 19 2011

Crossrefs

Programs

  • Haskell
    a118950 n = a118950_list !! (n-1)
    a118950_list = filter (any (`elem` "2357") . show ) [0..]
    -- Reinhard Zumkeller, Jul 19 2011
    
  • Mathematica
    Select[Range[150],AnyTrue[IntegerDigits[#],PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 19 2018 *)
  • PARI
    is(n)=!!#select(isprime, digits(n)) \\ Charles R Greathouse IV, Sep 15 2015

Formula

a(n) = n + O(n^k) with k = log 6/log 10 = 0.77815.... - Charles R Greathouse IV, Sep 15 2015

A092620 Numbers with exactly one prime digit.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 20, 21, 24, 26, 28, 29, 30, 31, 34, 36, 38, 39, 42, 43, 45, 47, 50, 51, 54, 56, 58, 59, 62, 63, 65, 67, 70, 71, 74, 76, 78, 79, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 112, 113, 115, 117, 120, 121, 124, 126, 128, 129, 130, 131, 134
Offset: 1

Views

Author

Jani Melik, Apr 11 2004

Keywords

Comments

A193238(a(n))=1; subsequence of A118950. - Reinhard Zumkeller, Jul 19 2011

Examples

			12 has one prime digit, 2;
102 has one prime digit, 2.
		

Crossrefs

Subsequence of A118950.

Programs

  • Haskell
    import Data.List (elemIndices)
    a092620 n = a092620_list !! (n-1)
    a092620_list = elemIndices 1 a193238_list
    -- Reinhard Zumkeller, Jul 19 2011
  • Maple
    stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_n:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( isprime(i)='true' and ts_stpf(i) =0) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_n(300);
  • Mathematica
    Select[Range[150],Count[IntegerDigits[#],?(PrimeQ)]==1&] (* _Harvey P. Dale, Mar 23 2018 *)

Formula

There are 6^n*(n-1/6)*2/3 n-digit members of this sequence for n > 1. - Charles R Greathouse IV, Apr 23 2022

A085557 Numbers that have more prime digits than nonprime digits.

Original entry on oeis.org

2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 122, 123, 125, 127, 132, 133, 135, 137, 152, 153, 155, 157, 172, 173, 175, 177, 202, 203, 205, 207, 212, 213, 215, 217, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232
Offset: 1

Views

Author

Jason Earls, Jul 04 2003

Keywords

Comments

Begins to differ from A046034 at the 21st term (which is the first 3-digit term).

Examples

			133 is in the sequence as the prime digits are 3 and 3 (those are two digits; counted with multiplicity) and one nonprime digit 1 and so there are more prime digits than nonprime digits. - _David A. Corneth_, Sep 06 2020
		

Crossrefs

Programs

  • PARI
    is(n) = my(d = digits(n), c = 0); for(i = 1, #d, if(isprime(d[i]), c++)); c<<1 > #d \\ David A. Corneth, Sep 06 2020
    
  • Python
    from itertools import count, islice
    def A085557_gen(startvalue=1): # generator of terms
        return filter(lambda n:len(s:=str(n))<(sum(1 for d in s if d in {'2','3','5','7'})<<1),count(max(startvalue,1)))
    A085557_list = list(islice(A085557_gen(),20)) # Chai Wah Wu, Feb 08 2023
Showing 1-10 of 15 results. Next