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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A035232 Number of substrings of n which are primes. 5
0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 2, 0, 1, 0, 2, 0, 1, 1, 1, 2, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 3, 1, 1, 0, 1, 1, 2, 0, 1, 0, 2, 0, 0, 1, 1, 2, 3, 1, 2, 1, 2, 1, 2, 0, 1, 1, 1, 0, 1, 0, 2, 0, 0, 1, 2, 2, 3, 1, 2, 1, 2, 1, 2, 0, 0, 1, 2, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 2, 0, 0, 0, 1, 1, 2, 0, 1 (list; graph; refs; listen; history; internal format)
OFFSET

1,13

COMMENTS

No leading 0's allowed in substrings.

EXAMPLE

The primes occurring as substrings of 37 are 3, 7, 37, so a(37)=3. a(22)=2, since the prime 2 occurs twice as a substring.

MATHEMATICA

a[n_] := Block[{s = IntegerDigits[n], c = 0, d = {}}, l = Length[s]; t = Flatten[ Table[ Take[s, {i, j}], {i, 1, l}, {j, i, l}], 1]; k = l(l + 1)/2; While[k > 0, If[ t[[k]][[1]] != 0, d = Append[d, FromDigits[ t[[k]] ]]]; k-- ]; Count[ PrimeQ[d], True]]; Table[ a[n], {n, 1, 105}]

CROSSREFS

Cf. A039997, A039995.

Sequence in context: A193403 A039997 A039995 * A091603 A194942 A129688

Adjacent sequences:  A035229 A035230 A035231 * A035233 A035234 A035235

KEYWORD

base,easy,nonn

AUTHOR

Erich Friedman (erich.friedman(AT)stetson.edu)

EXTENSIONS

Edited by Robert G. Wilson v (rgwv(AT)rgwv.com), Feb 24 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 14 23:53 EST 2012. Contains 205689 sequences.