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

A380199 Smallest number of leading digits of A002110(n) (primorial(n)) that form a prime (or 0 if none exist).

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 4, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 26, 3, 1, 1, 1, 4, 7, 1, 1, 3, 2, 1, 1, 17, 1, 2, 2, 6, 0, 1, 0, 25, 2, 2, 1, 3, 1, 21, 1, 32, 2, 2, 2, 25, 1, 1, 1, 0, 1, 10, 9, 2, 0, 1, 3, 0, 0, 17, 1, 6
Offset: 0

Views

Author

Jean-Marc Rebert, Jan 16 2025

Keywords

Examples

			For n = 2, primorial(2) = 6, 6 is not prime, a(2) = 0.
For n = 10, primorial(10) = 6469693230, 6469 is the smallest prime, a(10) = 4.
 n  primorial(n) a(n)
 0            1  0
 1            2  1
 2            6  0
 3           30  1
 4          210  1
 5         2310  1
 6        30030  1
 7       510510  1
 8      9699690  0
 9    223092870  1
10   6469693230  4
		

Crossrefs

Programs

  • Mathematica
    lim=84;p=FoldList[Times, 1, Prime[Range[lim]]];Table[l=Length[IntegerDigits[p[[n]]]];a=0;Do[If[PrimeQ[FromDigits[Take[IntegerDigits[p[[n]]],i]]],a=i;Break[]],{i,l}];a,{n,lim}] (* James C. McMahon, Jan 29 2025 *)
  • PARI
    a(n) = my(d=digits(factorback(primes(n)))); for(k=1, #d, if (isprime(fromdigits(Vec(d, k))), return(k))); return (0); \\ Michel Marcus, Jan 19 2025
Showing 1-1 of 1 results.