login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A039996 Primes embedded in prime(n) as substrings. 72
1, 1, 1, 1, 1, 2, 2, 1, 3, 2, 2, 3, 1, 2, 2, 3, 2, 1, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 1, 4, 3, 4, 5, 3, 1, 2, 3, 2, 3, 5, 4, 1, 2, 3, 4, 2, 3, 4, 3, 3, 4, 4, 3, 3, 4, 3, 2, 4, 3, 2, 4, 4, 3, 4, 4, 5, 3, 4, 4, 2, 4, 4, 4, 5, 5, 3, 3, 4, 1, 1, 3, 2, 4, 3, 3, 3, 1, 3, 2, 2, 3, 4, 2, 1, 1, 3, 2, 3, 5, 3, 4, 3, 3, 2, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,6

LINKS

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

FORMULA

a(n) = A039997(prime(n)).

a(n) <= A039994(n). - Charles R Greathouse IV, Apr 22 2015

EXAMPLE

a(26) = 1 since the only prime substring of "101" is 101.

MATHEMATICA

f[n_] := Block[{id = IntegerDigits@ Prime@n, len = Floor[ Log[10, Prime@n] + 1]}, Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[id, k, 1], {k, len}], 1]], True]]; Array[f, 105] (* Robert G. Wilson v, Jun 28 2010 *)

PROG

(PARI) dp(n)=if(n<12, return(if(isprime(n), [n], []))); my(v=vecsort(select(isprime, eval(Vec(Str(n)))), , 8), t); while(n>9, if(gcd(n%10, 10)>1, n\=10; next); t=10; while((t*=10)<n*10, if(isprime(n%t), v=concat(v, n%t))); v=vecsort(v, , 8); n\=10); v

a(n)=#dp(prime(n)) \\ Charles R Greathouse IV, Apr 22 2015

CROSSREFS

Cf. A039994.

Sequence in context: A235061 A283004 A111709 * A039994 A228425 A316842

Adjacent sequences:  A039993 A039994 A039995 * A039997 A039998 A039999

KEYWORD

nonn,base

AUTHOR

David W. Wilson

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 April 18 12:34 EDT 2019. Contains 322209 sequences. (Running on oeis4.)