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 10 results.

A075902 Primes p = prime(k) such that the decimal representation of p contains k as a substring.

Original entry on oeis.org

17, 64553, 64567, 64577, 64591, 64601, 64661, 99551, 4303027, 6440999, 14968819, 95517973, 527737957, 1893230839, 1966640443, 1246492090901
Offset: 1

Views

Author

Zak Seidov, Sep 27 2002

Keywords

Comments

prime(k) = 1966640443 for k=96664044. This is the first case in which k is an internal string of prime(k). - Carlos Rivera, Jun 16 2004
2*10^12 < a(17) <= 12426836115943. a(18) <= 21732382677641. a(19) <= 154895576080181. - Donovan Johnson, May 08 2010

Examples

			Pairs {n, prime(n)}: {7, 17}, {6455, 64553}, {6456, 64567}, {6457, 64577}, {6459, 64591}, {6460, 64601}, {6466, 64661}, {9551, 99551}, {303027, 4303027}, {440999, 6440999}, {968819, 14968819}, {5517973, 95517973}.
		

Crossrefs

Programs

  • Mathematica
    Prime[Select[Range[10^6], StringContainsQ[ToString[Prime[#]], ToString[#]] & ]] (* Robert Price, May 27 2019 *)
  • Python
    from sympy import primerange
    [print(i,end=', ') for n,i in enumerate(primerange(1,10**7)) if str(n+1) in str(i)] # Nicholas Stefan Georgescu, Jan 03 2025

Extensions

3 more terms from Carlos Rivera, Jun 16 2004
a(16) from Donovan Johnson, May 08 2010

A067248 Numbers k such that the digits of prime(k) end in k.

Original entry on oeis.org

7, 9551, 303027, 440999, 968819, 5517973, 27737957, 93230839, 46492090901, 426836115943, 732382677641, 4895576080181, 77628540590583, 3475456543097857, 20396537622790811
Offset: 1

Views

Author

Joseph L. Pe, Feb 20 2002

Keywords

Comments

There is no further term up to 115000000. - Farideh Firoozbakht, Jan 01 2007
a(13) > pi(10^15). - Donovan Johnson, May 08 2010

Examples

			Prime(968819) = 14968819 which ends in 968819, so 968819 is a term of the sequence.
		

Crossrefs

Corresponding primes are in A046883.

Programs

  • Mathematica
    (* returns true if a ends with b, false otherwise *) f[a_, b_] := Module[{c, d, e, g, h, i, r}, r = False; c = ToString[a]; d = ToString[b]; e = StringLength[c]; g = StringPosition[c, d]; h = Length[g]; If[h > 0, i = g[[h]]; If[i[[2]] == e, r = True]]; r]; Do[If[f[Prime[n], n], Print[n]], {n, 1, 10^6}]

Extensions

a(6) from Zak Seidov, Sep 27 2002
a(7)-a(8) from Farideh Firoozbakht, Jan 01 2007
a(9)-a(12) from Donovan Johnson, May 08 2010
a(13)-a(14) from Chai Wah Wu, Apr 05 2021
a(15) from Chai Wah Wu, Apr 07 2021

A068575 Numbers n such that, as strings, n is a substring of prime(n).

Original entry on oeis.org

7, 6455, 6456, 6457, 6459, 6460, 6466, 9551, 303027, 440999, 968819, 5517973, 27737957, 93230839, 96664044, 46492090901
Offset: 1

Views

Author

Joseph L. Pe, Mar 26 2002

Keywords

Comments

pi(2*10^12) < a(17) <= 426836115943. a(18) <= 732382677641. a(19) <= 4895576080181. [From Donovan Johnson, May 08 2010]

Examples

			Treated as strings, 6455 is a substring of 64553 = Prime(6455), so 6455 belongs to the sequence.
Pairs {n, prime(n)}: {7, 17}, {6455, 64553}, {6456, 64567}, {6457, 64577}, {6459, 64591}, {6460, 64601}, {6466, 64661}, {9551, 99551}, {303027, 4303027}, {440999, 6440999}, {968819, 14968819}, {5517973, 95517973}.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], StringPosition[ToString[Prime[ # ]], ToString[ # ]] != {} &]
    Select[Range[97*10^4],SequenceCount[IntegerDigits[Prime[#]],IntegerDigits[#]]>0&] (* The program generates the first 11 terms of the sequence. *) (* Harvey P. Dale, Nov 14 2022 *)

Extensions

More terms from Zak Seidov, Sep 27 2002
Three more terms from Farideh Firoozbakht, Jan 06 2007
a(16) from Donovan Johnson, May 08 2010

A074978 Prime(prime(n)) ends with n.

Original entry on oeis.org

6447, 529271, 569513, 996733, 53172153, 837071903, 53552588203, 445839739269, 6130987583999
Offset: 1

Views

Author

Zak Seidov, Oct 06 2002

Keywords

Examples

			prime(prime(6447)) = 806447, prime(prime(529271))=138529271, prime(prime(569513))=150569513, prime(prime(996733))=283996733. Next (if any) n > 6000000.
prime(prime(53172153)) = 23953172153. prime(prime(837071903)) = 489837071903. prime(prime(53552588203)) = 43853552588203. - _Chai Wah Wu_, Apr 05 2021
prime(prime(445839739269)) = 424445839739269, prime(prime(6130987583999)) = 6926130987583999. - _Chai Wah Wu_, Apr 13 2021
		

Crossrefs

Prime(n) ending with n in A046883.

Extensions

a(5)-a(7) from Chai Wah Wu, Apr 05 2021
a(8)-a(9) from Chai Wah Wu, Apr 13 2021

A046884 Doubly automorphic primes: p is k-th prime, ends in k and k is itself prime.

Original entry on oeis.org

17, 99551, 14968819, 95517973
Offset: 1

Views

Author

Keywords

Examples

			p(7)=17 with 7 and 17 both primes. p(9551)=99551 with both 9551 and 99551 primes.
		

Crossrefs

Cf. A046883.

Programs

  • Mathematica
    Select[Prime[Prime[Range[6000000]]],PrimePi[#]==Mod[ #,10^IntegerLength[ PrimePi[#]]]&] (* The program takes a long time to run *) (* Harvey P. Dale, Jul 05 2012 *)
    Prime[Select[Range[5517973],PrimeQ[#]&&StringEndsQ[ToString[Prime[#]],ToString[#]]&]] (* Much faster *) (* Ivan N. Ianakiev, Mar 23 2022 *)

A185999 Automorphic semiprimes: semiprimes, sp, such that sp is the k-th semiprime and sp ends in k.

Original entry on oeis.org

291, 24502749, 36627829, 3547310731, 4721984179, 461808766011
Offset: 1

Views

Author

Keywords

Comments

Analogy, this sequence is to semiprimes (A001358) as A046883 is to the primes (A000040) or as A035383 is to the squares (A000290) among many others.

Crossrefs

Programs

  • Mathematica
    nextSemiPrime[n_] := Block[{k = n + 1}, While[ Plus @@ Last /@ FactorInteger@ k != 2, k++]; k]; c = 1; k = 4; lst = {}; While[k < 8100000000, If[ Mod[k, 10^Floor[1 + Log10@ c]] == c, AppendTo[lst, k]; Print[{c, k}]]; c++; k = nextSemiPrime@ k]; lst
    These terms can be crosschecked by: SemiPrimePi[n_] := Sum[ PrimePi[n/Prime@ i] -i + 1, {i, PrimePi@ Sqrt@ n}]

Extensions

a(6) from Donovan Johnson, Mar 03 2011

A186000 Consider the list s(1), s(2), ... of numbers that are products of exactly n primes; a(n) is the smallest s(j) whose decimal expansion ends in j.

Original entry on oeis.org

1, 17, 291, 12, 56, 78645, 1350, 192, 896, 7936, 36096, 3072, 14336, 250880, 1247232, 49152, 229376, 4014080, 6718464, 786432, 3670016, 64225280, 45203456000, 12582912, 58720256, 622854144, 219792015360, 201326592, 939524096, 8321499136, 37849399296, 3221225472, 15032385536, 263066746880, 2924872728576, 51539607552, 240518168576, 4209067950080, 7044820107264, 824633720832, 3848290697216
Offset: 0

Views

Author

Keywords

Comments

For n = 0, 1, 2, ..., the index j corresponding to a(n) is 1, 7, 91, 2, 6, 8645, 50, 2, 6, 36, 96, 2, 6, 80, 232, 2, 6, 80, 64, 2, 6, 80, >6136, 2, 6, 44, > 564, 2, 6, 36, 96, 2, 6, 80, >286, 2, 6, 80, 64, 2, 6, ..., .

Examples

			a(0) = 1 because 1 is the first and only positive integer (A000027) which is not a prime, a semiprime, a triprime, etc.;
a(1) = 17 because 17 is the seventh term of A000040 (it is also the first term of A046883);
a(2) = 291 because 291 is the 91st term of A001358;
a(3) = 12 because 12 is the second term of A014612;
a(4) = 56 because 56 is the sixth term of A014613; etc.
		

Crossrefs

Programs

  • Mathematica
    nextKthAlmostPrime[n_, k_] := Block[{m = n + 1}, While[ Plus @@ Last /@ FactorInteger@ m != k, m++]; m] (* Eric W. Weisstein, Feb 07 2006 *); f[n_] := Block[{c = 1, kp = 2^n}, While[ Mod[kp, 10^Floor[1 + Log10@ c]] != c, c++; kp = nextKthAlmostPrime[kp, n]]; kp]
    (* These terms can be crosschecked by: *)
    AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]]]]] (* Eric W. Weisstein, Feb 07 2006 *)

Extensions

Edited by N. J. A. Sloane, Mar 04 2011
The missing values, a(22), a(26) & a(34), were supplied to me via email dtd Mar 03 2011 from Donovan Johnson. - Robert G. Wilson v, Mar 22 2011

A306572 Numbers k whose decimal representation ends with that of pi(k) (where pi denotes the prime counting function A000720).

Original entry on oeis.org

16, 17, 132, 254, 374, 494, 1196, 2348, 3487, 4624, 5757, 6886, 11373, 22517, 33597, 44639, 55646, 66644, 77629, 88580, 99550, 99551, 110486, 219572, 328268, 436699, 544946, 653052, 761059, 869024, 976855, 1084604, 1192399, 2159962, 3232398, 4303026, 4303027
Offset: 1

Views

Author

Rémy Sigrist, Feb 24 2019

Keywords

Comments

This sequence contains the automorphic primes (A046883).
If p is an automorphic prime, then p-1 is a term of the sequence.

Examples

			There are 7 prime numbers <= 17, and 17 ends with 7, hence 17 is a term.
There are 13 prime numbers <= 42, and 42 does not end with 13, hence 42 is not a term.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2, 10^6], Mod[#1, 10^(1 + Floor@ Log10[#2])] == #2 & @@ {#, PrimePi@ #} &] (* Michael De Vlieger, Apr 06 2021 *)
  • PARI
    pi=0; for (n=1, 4303027, if (n%10^max(1,#digits(pi+=isprime(n)))==pi, print1 (n ", ")))
    
  • Python
    from sympy import primepi
    A306572_list = [n for n, p in enumerate(primepi(k) for k in range(10**4)) if n > 0 and n % 10**len(str(p)) == p] # Chai Wah Wu, Apr 06 2021

A343128 Numbers k such that prime(prime(prime(k))) ends in k.

Original entry on oeis.org

7, 229, 417, 657, 26203, 32553, 50971, 93487, 231221, 17064941, 54784601, 93007099, 981668491, 16040988367
Offset: 1

Views

Author

Chai Wah Wu, Apr 06 2021

Keywords

Examples

			417 is a term since prime(prime(prime(417))) = 302417.
26203 is a term since prime(prime(prime(26203))) = 73226203.
17064941 is a term since prime(prime(prime(17064941))) = 169217064941.
prime(prime(prime(54784601))) = 647454784601, prime(prime(prime(93007099))) = 1185993007099, prime(prime(prime(981668491))) = 17148981668491, prime(prime(prime(16040988367))) = 390416040988367. - _Chai Wah Wu_, Apr 14 2021
		

Crossrefs

Programs

  • Python
    A343128_list = [n for n in range(1,10**4) if n % 2 and n % 5 and prime(prime(prime(n))) % 10**(len(str(n))) == n]

Extensions

a(11)-a(14) from Chai Wah Wu, Apr 14 2021

A343145 a(n) is the least positive number k such that applying x->prime(x) n times results in a number that ends in k.

Original entry on oeis.org

1, 7, 6447, 7, 1, 1, 69, 9, 1, 1, 1, 7, 1, 1
Offset: 0

Views

Author

Chai Wah Wu, Apr 06 2021

Keywords

Examples

			a(1) = 7 since prime(7) = 17 which ends in 7.
a(2) = 6447 since prime(prime(6447)) = 806447 which ends in 6447.
a(3) = 7 since prime(prime(prime(7)))=277 which ends in 7.
a(4) = 1 since prime(prime(prime(prime(1)))) = 11 which ends in 1.
a(5) = 1 since prime(prime(prime(prime(prime(1))))) = 31 which ends in 1.
a(6) = 69 since prime(prime(prime(prime(prime(prime(69)))))) = 54615469 which ends in 69.
a(7) = 9 since prime(prime(prime(prime(prime(prime(prime(9))))))) = 4535189 which ends in 9.
		

Crossrefs

Programs

  • PARI
    primemap(n, tms) = my(x=n); for(i=1, tms, x=prime(x)); x
    enddigits(n, len) = ((n/10^len - floor(n/10^len)) * 10^len)
    a(n) = for(k=1, oo, my(x=k); if(enddigits(primemap(k, n), #Str(k))==k, return(k))) \\ Felix Fröhlich, Apr 14 2021
  • Python
    def A343145(n):
        k = 1
        while True:
            m = k
            for _ in range(n):
                m = prime(m)
            if m % 10**(len(str(k))) == k:
                return k
            k += 1
            while not (k % 2 and k % 5):
                k += 1
    
Showing 1-10 of 10 results.