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!)
A246398 Smallest number of digits that have to be inserted into or prepended to decimal representation of n, to get a prime. 1
2, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 2, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 2, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 2, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
a(n) = 0 iff n is a prime number, a(A000040(n)) = 0;
a(n) = A055642(A062584(n)) - A055642(n).
LINKS
PROG
(Haskell)
a246398 n = a246398_list !! n
a246398_list = f 0 $ map show a000040_list where
f x pss = (length ps - length xs) :
f (x + 1) (dropWhile (== xs) pss)
where ps = head [qs | qs <- pss, isin xs qs]; xs = show x
isin [] _ = True
isin _ [] = False
isin (u:us) vs = not (null ws) && isin us ws
where ws = dropWhile (/= u) vs
CROSSREFS
Sequence in context: A316825 A333816 A363709 * A051699 A328682 A007920
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Nov 13 2014
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 03:30 EDT 2024. Contains 371906 sequences. (Running on oeis4.)