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!)
A116898 Numbers k such that k! is turned into a prime number by changing its trailing 0's into 1's. 0
2, 10, 34, 499, 1746 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Also numbers k such that n! + R(Z(k)) is prime, where R(t) = (10^t - 1)/9 is the repunit with t digits (A002275) and Z(m) = Sum_{j>=1} floor(m/5^j) is the number of trailing zeros of m! (A027868). The (probable) prime corresponding to a(5)=1746 has 4905 digits. Next term must be greater than 4000.

LINKS

Table of n, a(n) for n=1..5.

EXAMPLE

10 is a term, since 10! = 3628800 and 3628811 is prime.

MAPLE

q:= n-> (f-> isprime(f+(10^padic[ordp](f, 10)-1)/9))(n!):

select(q, [$1..500])[];  # Alois P. Heinz, Feb 10 2021

MATHEMATICA

tz1Q[n_]:=Module[{idn=Split[IntegerDigits[n!]]}, PrimeQ[ FromDigits[ Flatten[ Join[ Most[ idn], Last[idn]/.(0->1)]]]]]; Select[ Range[ 1800], tz1Q] (* Harvey P. Dale, Oct 01 2015 *)

PROG

(Python)

from sympy import isprime

from math import factorial

def ok(n):

  s, zeros = str(factorial(n)), 0

  while s[-1] == '0': s = s[:-1]; zeros += 1

  return isprime(int(s + '1'*zeros))

print([m for m in range(500) if ok(m)]) # Michael S. Branicky, Feb 10 2021

CROSSREFS

Cf. A000142, A002275, A027868.

Sequence in context: A281097 A221492 A318696 * A033261 A236377 A197556

Adjacent sequences:  A116895 A116896 A116897 * A116899 A116900 A116901

KEYWORD

nonn,base,hard,more

AUTHOR

Giovanni Resta, Mar 07 2006

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 28 22:57 EST 2022. Contains 350669 sequences. (Running on oeis4.)