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

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

Rémy Sigrist, Jan 08 2020

Keywords

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.

Examples

			For n = 23:
- 2 is a prime number,
- hence a(23) = 2.
		

Crossrefs

Programs

  • 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)

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).

A331097 a(n) is the greatest prime number of the form n mod (10^k) for some k > 0, or 0 if no such prime number exists.

Original entry on oeis.org

0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 11, 2, 13, 0, 5, 0, 17, 0, 19, 0, 0, 2, 23, 0, 5, 0, 7, 0, 29, 0, 31, 2, 3, 0, 5, 0, 37, 0, 0, 0, 41, 2, 43, 0, 5, 0, 47, 0, 0, 0, 0, 2, 53, 0, 5, 0, 7, 0, 59, 0, 61, 2, 3, 0, 5, 0, 67, 0, 0, 0, 71, 2, 73, 0, 5, 0, 7, 0, 79, 0
Offset: 0

Views

Author

Rémy Sigrist, Jan 09 2020

Keywords

Comments

In other words, a(n) is the largest prime suffix of n, or 0 if no such suffix exists.

Examples

			For n = 42:
- 42 mod (10^k) = 42 is not prime for k >= 2,
- 42 mod 10 = 2 is prime,
- hence a(42) = 2.
		

Crossrefs

Cf. A047814, A331044, A331102 (binary analog).

Programs

  • PARI
    a(n,base=10) = my (d=digits(n, base), s); for (k=1, #d, if (isprime(s=fromdigits(d[k..#d], base)), return (s))); 0

Formula

a(n) <= n with equality iff n = 0 or n is a prime number.

A331046 Numbers k such that floor(k/10^m) is a prime number for some m >= 0.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 43, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 83, 89, 97, 101, 103, 107, 109, 110, 111, 112, 113
Offset: 1

Views

Author

Rémy Sigrist, Jan 08 2020

Keywords

Comments

In other words, these are the numbers with a prime prefix.
For any m > 0:
- let f(m) be the proportion of positive numbers <= 10^m belonging to this sequence,
- we have f(m) = Sum_{p < 10^m in A069090} 1/10^A055642(p),
- also f(m) <= f(m+1) <= 1,
- so {f(m)} has a limit, say F, as m tends to infinity,
- what is the value of F?

Examples

			The number 2 is prime, so every number in A217394 belongs to this sequence.
		

Crossrefs

Cf. A055642, A069090, A202259 (complement), A217394, A331044, A331045.

Programs

  • PARI
    is(n,base=10) = while (n, if (isprime(n), return (1), n\=base)); return (0)
Showing 1-3 of 3 results.