login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A321796 Prime p such that the prime before p is a substring of p^3. 0
3, 17, 31, 59, 997, 2837, 57349, 83773, 224813, 861743, 9999991, 61879669, 95895673, 763137931, 1463016067, 1608398527, 6909512173, 38095693807, 94041857089, 4913845865567 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
10^18-11 and 10^31-27 are also terms. - Giovanni Resta, Nov 20 2018
LINKS
EXAMPLE
Prime before 3 is 2 and it is a substring of 3^3 = 27.
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 *)
PROG
(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
CROSSREFS
Cf. A052075.
Sequence in context: A365234 A045437 A343413 * A214093 A309744 A115355
KEYWORD
nonn,base,more
AUTHOR
Paolo P. Lava, Nov 19 2018
EXTENSIONS
a(10)-a(20) from Giovanni Resta, Nov 20 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 29 04:57 EDT 2024. Contains 372097 sequences. (Running on oeis4.)