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

A052073 Primes p with the property that nextprime(p) is a substring of p^2.

Original entry on oeis.org

23, 83, 113, 1123, 200003, 328127, 381289, 714597769, 4916552822383
Offset: 1

Views

Author

Patrick De Geest, Jan 15 2000

Keywords

Comments

a(10) > 4*10^13. The prime 482564152712479922509389813571 is also a term. - Giovanni Resta, May 24 2018

Examples

			381289 is a term because nextprime(381289) = 381301 is a substring of 381289^2 = 145381301521.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@Range[1000000],
    StringContainsQ[ToString[#^2], ToString[NextPrime[#]]] &] (* Robert Price, Oct 12 2019 *)

Extensions

a(8) from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Sep 04 2006
a(9) from Giovanni Resta, May 24 2018

A052074 Squares of primes p^2 with the property that nextprime(p) is a substring of p^2.

Original entry on oeis.org

529, 6889, 12769, 1261129, 40001200009, 107667328129, 145381301521, 510649971459777361, 24172491655282243145798689
Offset: 1

Views

Author

Patrick De Geest, Jan 15 2000

Keywords

Examples

			The corresponding primes p are 23, 83, 113, 1123, 200003, 328127, ..., the "next primes" are 29, 89, 127, 1129, 200009, 328129, ..., and these numbers are indeed substrings of 529, 6889, 12769, 1261129, 40001200009, 107667328129, ...
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[37*10^6]]^2,SequenceCount[IntegerDigits[#], IntegerDigits[ NextPrime[ Sqrt[#]]]]>0&] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Jul 13 2016 *)

Extensions

a(8) from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Sep 04 2006
Definition clarified and offset changed by N. J. A. Sloane, Jul 13 2016
a(9) from Giovanni Resta, May 24 2018

A052076 List of cubes p^3 of primes with property that next prime after p is a substring of p^3.

Original entry on oeis.org

1331, 1030301, 11224377919, 40343019516073, 83964379378069, 153551511228149, 153548930496746303, 214889691497505989703913, 79943078473759892945966959, 16573430415736921632549592733, 22837138677705447754568672309, 940309072235302647342697969346063
Offset: 1

Views

Author

Patrick De Geest, Jan 15 2000

Keywords

Crossrefs

Programs

  • Mathematica
    f[0]=8;f[n_]:=Module[{i=PrimePi[f[n-1]^(1/3)]+1},
    While[StringPosition[ToString[Prime[i]^3],ToString[NextPrime[Prime[i]]]]=={}, i++];Prime[i]^3];f/@Range[7] (* Ivan N. Ianakiev, Nov 16 2016 *)
    #^3&/@Select[Prime[Range[10^6]],SequenceCount[IntegerDigits[#^3],IntegerDigits[ NextPrime[ #]]]> 0&] (* Harvey P. Dale, Jul 29 2023 *)

Extensions

More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Sep 12 2006
Definition clarified by Charles R Greathouse IV, Dec 24 2014
a(12) from Giovanni Resta, Jul 02 2018

A294087 Least prime p_k such that (p_k)^n has p_{k+1} as substring.

Original entry on oeis.org

23, 11, 37, 2, 7, 5, 3, 41, 3, 13, 3, 3, 2, 2, 2, 2, 5, 5, 5, 3, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 17, 2, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2
Offset: 2

Views

Author

Paolo P. Lava, Feb 09 2018

Keywords

Comments

It appears that a(n) = 2 for n>153. In other words, for n>153, 3 is always a substring of 2^n. Is there any proof? See A035058.

Examples

			23^2 = 529 and 29 is the prime after 23.
11^3 = 1331 and 13 is the prime after 11.
37^4 = 1874161 and 41 is the prime after 37.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,h,k,n,ok; for h from 2 to q do ok:=1; for n from 1 to q do
    if ok=1 then a:=ithprime(n); b:=nextprime(a); for k from 1 to ilog10(a^h)-ilog10(b)+1 do
    if b=trunc(a^h/10^(k-1)) mod 10^(ilog10(b)+1) then print(a); ok:=0; break;
    fi; od; fi; od; od; end: P(10^6);

A294088 Least prime p_k such that (p_k)^n has p_{k-1} as substring.

Original entry on oeis.org

3701, 3, 43, 3, 3, 3, 5, 5, 7, 11, 11, 3, 3, 5, 3, 3, 3, 3, 5, 3, 5, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 2

Views

Author

Paolo P. Lava, Feb 09 2018

Keywords

Comments

It appears that a(n) = 3 for n>59. In other words, for n>59, 2 is always a substring of 3^n. Is there any proof? See A131625.

Examples

			3701^2 = 13697401 and 3697 is the prime before 3701.
3^3 = 27 and 2 is the prime before 3.
43^4 = 3418801 and 41 is the prime before 43.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,h,k,n,ok; for h from 2 to q do ok:=1; for n from 1 to q do
    if ok=1 then a:=ithprime(n); b:=prevprime(a); for k from 1 to ilog10(a^h)-ilog10(b)+1 do
    if b=trunc(a^h/10^(k-1)) mod 10^(ilog10(b)+1) then print(a); ok:=0; break;
    fi; od; fi; od; od; end: P(10^6);

A321796 Prime p such that the prime before p is a substring of p^3.

Original entry on oeis.org

3, 17, 31, 59, 997, 2837, 57349, 83773, 224813, 861743, 9999991, 61879669, 95895673, 763137931, 1463016067, 1608398527, 6909512173, 38095693807, 94041857089, 4913845865567
Offset: 1

Views

Author

Paolo P. Lava, Nov 19 2018

Keywords

Comments

10^18-11 and 10^31-27 are also terms. - Giovanni Resta, Nov 20 2018

Examples

			Prime before 3 is 2 and it is a substring of 3^3 = 27.
		

Crossrefs

Cf. A052075.

Programs

  • Maple
    P:=proc(q) local a,n; for n from 2 to q do a:=ithprime(n);
    if searchtext(convert(prevprime(a),string),convert(a^3,string))>0
    then print(a); fi; od; end: P(10^5);
  • Mathematica
    sub[x_, y_] := StringPosition @@ ToString /@ {x, y} != {}; p = Prime@ Range@ 100000; p[[Select[Range[2, 100000], sub[p[[#]]^3, p[[# - 1]]] &]]] (* Giovanni Resta, Nov 20 2018 *)
    Select[Prime[Range[700000]],SequenceCount[IntegerDigits[#^3],IntegerDigits[ NextPrime[ #,-1]]]>0&] (* The program generates the first 11 terms of the sequence; to generate all terms, increase the Range constant to 174344399360 but the program will take an extremely long time to run. *) (* Harvey P. Dale, Mar 27 2020 *)
  • Python
    from itertools import count, islice
    from sympy import prevprime, prime
    def A321796_gen(): return filter(lambda p: str(prevprime(p)) in str(p**3), (prime(n) for n in count(2)))
    A321796_list = list(islice(A321796_gen(),5)) # Chai Wah Wu, Jan 20 2022

Extensions

a(10)-a(20) from Giovanni Resta, Nov 20 2018

A383607 Square array read by antidiagonals upwards: T(n,k) is the smallest k-digit prime p such that nextprime(p) is a substring of p^n; or -1 if no such prime exists, n>1, k>0.

Original entry on oeis.org

-1, -1, 23, -1, 11, 113, 2, 37, 101, 1123, 7, 17, 487, 2239, -1, 5, 47, -1, 5659, 34297, 200003, 3, 13, -1, 2399, 91801, 535487, -1, -1, 31, 607, 1279, 31627, 842483, -1, -1, 3, 41, 431, 3163, 12281, 825059, 6315629, 59897017, 714597769, -1, 37, 233, 1931, 15791, 179947, 5623421, -1, 430784719, -1
Offset: 2

Views

Author

Jean-Marc Rebert, May 01 2025

Keywords

Examples

			T(2,3) = 113, because nextprime(113) = 127 is a substring in 113^2 = 12769, starting at position 1, and no smaller 3-digit prime satisfies this condition.
Top left corner begins at T(2,1):
  -1, 23, 113, 1123, ...
  -1, 11, 101, 2239, ...
  -1, 37, 487, 5659, ...
   2, 17,  -1, 2399, ...
  .., .., ..., ...., ...
		

Crossrefs

Programs

  • PARI
    T(n,k) = forprime(p=10^(k-1), 10^k-1, if (#strsplit(Str(p^n), Str(nextprime(p+1))) >= 2, return(p));); return(-1); \\ Michel Marcus, May 02 2025
Showing 1-7 of 7 results.