cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A079066 "Memory" of prime(n): the number of distinct (previous) primes contained as substrings in prime(n).

This page as a plain text file.
%I A079066 #22 Jul 29 2025 17:26:51
%S A079066 0,0,0,0,0,1,1,0,2,1,1,2,0,1,1,2,1,0,1,1,2,1,1,0,1,0,1,1,0,3,2,3,4,2,
%T A079066 0,1,2,1,2,4,3,0,1,2,3,1,2,3,2,2,3,3,2,2,3,2,1,3,2,1,3,3,2,3,3,4,2,3,
%U A079066 3,1,3,3,3,4,4,2,2,3,0,0,2,1,3,2,2,2,0,2,1,1,2,3,1,0,0,2,1,2,4,2,3,2,2,1,3
%N A079066 "Memory" of prime(n): the number of distinct (previous) primes contained as substrings in prime(n).
%H A079066 Reinhard Zumkeller, <a href="/A079066/b079066.txt">Table of n, a(n) for n = 1..10000</a>
%F A079066 a(n) = A039997(prime(n)) - 1.
%F A079066 a(n) = A039996(n) - 1. - _Alois P. Heinz_, Jul 29 2025
%e A079066 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.
%p A079066 a:= n-> (s-> -1+nops(select(t -> t[1]<>"0" and isprime(parse(t)),
%p A079066         {seq(seq(s[i..j], i=1..j), j=1..length(s))})))(""||(ithprime(n))):
%p A079066 seq(a(n), n=1..105);  # _Alois P. Heinz_, Jul 29 2025
%t A079066 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
%o A079066 (Haskell)
%o A079066 import Data.List (isInfixOf)
%o A079066 a079066 n =
%o A079066    length $ filter (`isInfixOf` (primesDec !! n)) $ take n primesDec
%o A079066 primesDec = "_" : map show a000040_list
%o A079066 -- _Reinhard Zumkeller_, Jul 19 2011
%Y A079066 Cf. A079075, A035232, A039996, A039997.
%Y A079066 Cf. A033274, A179909, A179910, A179911, A179912, A179913, A179914, A179915, A179916, A179917, A179918, A179919, A179922.
%K A079066 base,easy,nonn
%O A079066 1,9
%A A079066 _Joseph L. Pe_, Feb 02 2003
%E A079066 Edited by _Robert G. Wilson v_, Feb 25 2003
%E A079066 Name clarified by _Sean A. Irvine_, Jul 29 2025