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!)
A331045 a(n) is the least prime number of the form floor(n/10^k) for some k >= 0, or 0 if no such prime number exists. 3
0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 0, 17, 0, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 41, 0, 43, 0, 0, 0, 47, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 61, 0, 0, 0, 0, 0, 67, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 83 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
In other words, a(n) is the least prime prefix of n, or 0 if every prefix of n is nonprime.
This sequence is a variant of A331044.
LINKS
FORMULA
a(n) <= n with equality iff n = 0 or n belongs to A069090.
a(n) >= 0 with equality iff n belongs to A202259.
a(n) <= A331044(n).
EXAMPLE
For n = 23:
- 2 is a prime number,
- hence a(23) = 2.
PROG
(PARI) a(n, base=10) = my (d=digits(n, base), p=0); for (k=1, #d, if (isprime(p=base*p+d[k]), return (p))); return (0)
CROSSREFS
Sequence in context: A071375 A269668 A061397 * A331044 A093438 A211396
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 08 2020
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 23 22:36 EDT 2024. Contains 371917 sequences. (Running on oeis4.)