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-8 of 8 results.

A045708 Primes with first digit 2.

Original entry on oeis.org

2, 23, 29, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000040.
For primes with initial digit d (1 <= d <= 9) see A045707, A045708, A045709, A045710, A045711, A045712, A045713, A045714, A045715; A073517, A073516, A073515, A073514, A073513, A073512, A073511, A073510, A073509
Cf. A000030, subsequence of A208272.
Column k=2 of A262369.

Programs

  • Haskell
    a045708 n = a045708_list !! (n-1)
    a045708_list = filter ((== 2) . a000030) a000040_list
    -- Reinhard Zumkeller, Mar 16 2012
    
  • Magma
    [p: p in PrimesUpTo(2300) | Intseq(p)[#Intseq(p)] eq 2]; // Vincenzo Librandi, Aug 08 2014
    
  • Mathematica
    Select[Table[Prime[n], {n, 3000}], First[IntegerDigits[#]]==2 &] (* Vincenzo Librandi, Aug 08 2014 *)
  • Python
    from sympy import isprime
    def agen(limit=float('inf')):
      yield 2
      digits, adder = 1, 20
      while True:
        for i in range(1, 10**digits, 2):
          test = adder + i
          if test > limit: return
          if isprime(test): yield test
        digits, adder = digits+1, adder*10
    agento = lambda lim: agen(limit=lim)
    print(list(agento(2222))) # Michael S. Branicky, Feb 23 2021
    
  • Python
    from sympy import primepi
    def A045708(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x+primepi(min(((m:=10**(l:=len(str(x))-1))<<1)-1,x))-primepi(min(3*m-1,x))+sum(primepi(((m:=10**i)<<1)-1)-primepi(3*m-1) for i in range(l))
        return bisection(f,n,n) # Chai Wah Wu, Dec 07 2024

Formula

See A045707 for comments on density of these sequences.

Extensions

More terms from Erich Friedman.
Offset fixed by Reinhard Zumkeller, Mar 15 2012

A257667 Primes containing a digit 5.

Original entry on oeis.org

5, 53, 59, 151, 157, 251, 257, 353, 359, 457, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 653, 659, 751, 757, 853, 857, 859, 953, 1051, 1151, 1153, 1259, 1451, 1453, 1459, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579
Offset: 1

Views

Author

Vincenzo Librandi, May 03 2015

Keywords

Comments

Subsequence of primes of A011535. - Michel Marcus, May 03 2015
Primes in A062671. - Bruno Berselli, May 03 2015

Crossrefs

Cf. prime numbers containing the string k: A208270 (k=1), A208272 (k=2), A212525 (k=3), this sequence (k=5), A257668 (k=7), A166571 (k=10), A166572 (k=11), A243529 (k=12), A166573 (k=13), A243530 (k=14), A243531 (k=15), A243532 (k=16), A166579 (k=17), A243527 (k=111), A166580 (k=222), A166581 (k=333), A166582 (k=444).
Cf. A011535, A062671, A243531 (subsequence).

Programs

  • Magma
    [p: p in PrimesUpTo(1600) | 5 in Intseq(p)];
    
  • Mathematica
    Select[Prime[Range[250]], ! StringFreeQ[ToString[#], "5"] &]
  • PARI
    forprime(p=1, 1600, if(vecsearch(vecsort(digits(p)), 5), print1(p, ", "))) \\ Derek Orr, May 05 2015; corrected by Michel Marcus, Oct 30 2023
  • Sage
    [p for p in primes(1600) if 5 in p.digits(base=10)] # Bruno Berselli, May 03 2015
    

Formula

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

A243529 Prime numbers containing the string 12.

Original entry on oeis.org

127, 1123, 1129, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 2129, 3121, 4127, 4129, 6121, 7121, 7127, 7129, 8123, 9127, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, 11287
Offset: 1

Views

Author

Vincenzo Librandi, Jun 06 2014

Keywords

Comments

Subsequence of A208272. [Bruno Berselli, May 06 2015]

Crossrefs

Cf. similar sequences listed in A257667.

Programs

  • Mathematica
    Select[Prime[Range[2000]], ! StringFreeQ[ToString[#], "12" ] &]
  • PARI
    contains(n,k)=my(N=digits(n),K=digits(k)); for(i=0,#N-#K, for(j=1,#K,if(N[i+j]!=K[j],next(2))); return(1)); 0
    is(n)=isprime(n) && contains(n,12) \\ Charles R Greathouse IV, Jun 20 2014

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Jun 20 2014

A284290 Primes containing a digit 4.

Original entry on oeis.org

41, 43, 47, 149, 241, 347, 349, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 541, 547, 641, 643, 647, 743, 941, 947, 1049, 1249, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489
Offset: 1

Views

Author

Jaroslav Krizek, Mar 24 2017

Keywords

Comments

Subsequence of A011534 and A062669.

Crossrefs

Cf. Primes containing a digit k for k = 0 - 9: A056709 (k = 0), A208270 (k = 1), A208272 (k = 2), A212525 (k = 3), A284290 (k = 4), A257667 (k = 5), A284291 (k = 6), A257668 (k = 7), A284292 (k = 8), A106093 (k = 9).

Programs

  • Magma
    [p: p in PrimesUpTo(10000) | 4 in Intseq(p)]
  • Mathematica
    Select[Range[1500], PrimeQ[#] && MemberQ[IntegerDigits[#], 4] &] (* Amiram Eldar, Nov 09 2019 *)

A284291 Primes containing a digit 6.

Original entry on oeis.org

61, 67, 163, 167, 263, 269, 367, 461, 463, 467, 563, 569, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 761, 769, 863, 967, 1061, 1063, 1069, 1163, 1361, 1367, 1567, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663
Offset: 1

Views

Author

Jaroslav Krizek, Mar 24 2017

Keywords

Comments

Subsequence of A011536 and A062673.

Crossrefs

Primes containing a digit k for k = 0 - 9: A056709 (k = 0), A208270 (k = 1), A208272 (k = 2), A212525 (k = 3), A284290 (k = 4), A257667 (k = 5), A284291 (k = 6), A257668 (k = 7), A284292 (k = 8), A106093 (k = 9).

Programs

  • Magma
    [p: p in PrimesUpTo(10000) | 6 in Intseq(p)];
  • Mathematica
    Select[Range[2000], PrimeQ[#] && MemberQ[IntegerDigits[#], 6] &] (* Amiram Eldar, Nov 09 2019 *)

A284292 Primes containing a digit 8.

Original entry on oeis.org

83, 89, 181, 281, 283, 383, 389, 487, 587, 683, 787, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 983, 1087, 1181, 1187, 1283, 1289, 1381, 1481, 1483, 1487, 1489, 1583, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867
Offset: 1

Views

Author

Jaroslav Krizek, Mar 25 2017

Keywords

Comments

Subsequence of A011538 and A062677.
Differs from A062677 which contains also the composites 6889 = 83^2, 7387 = 83*89, 23489=83*283, 25187=89*283, 31789 = 83*383 etc. - R. J. Mathar, Mar 27 2017

Crossrefs

Cf. Primes containing a digit k for k = 0 - 9: A056709 (k = 0), A208270 (k = 1), A208272 (k = 2), A212525 (k = 3), A284290 (k = 4), A257667 (k = 5), A284291 (k = 6), A257668 (k = 7), this sequence (k = 8), A106093 (k = 9).

Programs

  • Magma
    [p: p in PrimesUpTo(10000) | 8 in Intseq(p)];
    
  • Maple
    isA284292 := proc(n)
        if isprime(n) then
            convert(convert(n,base,10),set) ;
            if 8 in % then
                true;
            else
                false;
            end if;
        else
            false;
        end if;
    end proc:
    for n from 1 to 2000 do
        if isA284292(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Mar 27 2017
  • Mathematica
    Select[Prime@ Range@ 500, MemberQ[ IntegerDigits@ #, 8] &] (* Giovanni Resta, Mar 25 2017 *)
  • Python
    from sympy import primerange
    print([n for n in primerange(2, 2000) if '8' in str(n)]) # Indranil Ghosh, Mar 25 2017

A036433 Number of divisors is a digit in the base 10 representation of n.

Original entry on oeis.org

1, 2, 14, 23, 29, 34, 46, 63, 68, 74, 76, 78, 88, 94, 116, 127, 128, 134, 138, 141, 142, 143, 145, 146, 164, 182, 184, 186, 189, 194, 196, 211, 214, 223, 227, 229, 233, 236, 238, 239, 241, 247, 248, 249, 251, 254, 257, 258, 261, 263, 268, 269, 271, 274, 277
Offset: 1

Views

Author

Simon Colton (simonco(AT)cs.york.ac.uk)

Keywords

Comments

Invented by the HR concept formation program.

Examples

			14 has 4 divisors and 4 is a digit in the base 10 representation of 14.
		

Crossrefs

Programs

  • Haskell
    a036433 n = a036433_list !! (n-1)
    a036433_list = filter f [1..] where
       f x = d < 10 && ("0123456789" !! d) `elem` show x where d = a000005 x
    -- Reinhard Zumkeller, Mar 15 2012
    
  • Mathematica
    Select[Range[300],MemberQ[IntegerDigits[#],DivisorSigma[0,#]]&] (* Harvey P. Dale, Sep 02 2013 *)
  • Python
    from sympy import divisor_count
    A036433_list = []
    for i in range(1,10**5):
        d = divisor_count(i)
        if d < 10 and str(d) in str(i):
            A036433_list.append(i) # Chai Wah Wu, Jan 07 2015

A208273 Composite numbers containing a digit 2.

Original entry on oeis.org

12, 20, 21, 22, 24, 25, 26, 27, 28, 32, 42, 52, 62, 72, 82, 92, 102, 112, 120, 121, 122, 123, 124, 125, 126, 128, 129, 132, 142, 152, 162, 172, 182, 192, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221
Offset: 1

Views

Author

Jaroslav Krizek, Mar 04 2012

Keywords

Comments

Subsequence of A011532. Complement of A208272 with respect to A011532.

Crossrefs

Cf. A208272 (primes containing a digit 2), A011532 (numbers containing a digit 2).

Programs

  • Maple
    filter:= proc(n) not isprime(n) and member(2,convert(n,base,10)) end proc:
    select(filter, [$4..300]); # Robert Israel, Oct 09 2024
  • Mathematica
    Select[Range[300], ! PrimeQ[#] && MemberQ[IntegerDigits[#], 2] &] (* T. D. Noe, Mar 06 2012 *)
    Select[Range[300],CompositeQ[#]&&DigitCount[#,10,2]>0&] (* Harvey P. Dale, Sep 08 2024 *)
Showing 1-8 of 8 results.