OFFSET
1,9
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A039997(prime(n)) - 1.
EXAMPLE
The primes contained as substrings in prime(3) = 113 are 3, 11, 13. Hence a(30) = 3. 113 is the smallest prime with memory = 3.
MATHEMATICA
ub = 105; tprime = Table[ToString[Prime[i]], {i, 1, ub}]; a = {}; For[i = 1, i <= ub, i++, m = 0; For[j = 1, j < i, j++, If[Length[StringPosition[tprime[[i]], tprime[[j]]]] > 0, m = m + 1]]; a = Append[a, m]]; a
PROG
(Haskell)
import Data.List (isInfixOf)
a079066 n =
length $ filter (`isInfixOf` (primesDec !! n)) $ take n primesDec
primesDec = "_" : map show a000040_list
-- Reinhard Zumkeller, Jul 19 2011
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Joseph L. Pe, Feb 02 2003
EXTENSIONS
Edited by Robert G. Wilson v, Feb 25 2003
STATUS
approved