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.

Showing 1-3 of 3 results.

A039996 Number of distinct primes embedded in prime(n) as substrings.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Examples

			a(26) = 1 since the only prime substring of "101" is 101.
a(48) = 4 since the only distinct prime substrings of "223" are 2, 3, 23, 223. - _David A. Corneth_, Jul 06 2020
		

Crossrefs

Programs

  • Maple
    a:= n-> (s-> nops(select(t -> t[1]<>"0" and isprime(parse(t)),
            {seq(seq(s[i..j], i=1..j), j=1..length(s))})))(""||(ithprime(n))):
    seq(a(n), n=1..105);  # Alois P. Heinz, Jul 29 2025
  • 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 *)
  • 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)Charles R Greathouse IV, Apr 22 2015

Formula

a(n) = A039997(prime(n)).
a(n) <= A039994(n). - Charles R Greathouse IV, Apr 22 2015
a(n) = A079066(n) + 1. - Alois P. Heinz, Jul 29 2025

Extensions

Name corrected by David A. Corneth, Jul 06 2020

A178596 Records in A039996.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 23, 25, 26, 27, 28, 29
Offset: 1

Views

Author

Zak Seidov, May 30 2010

Keywords

Examples

			a(17)=20 because A178597(17)=749502, prime(749502)=11373379, and there are 20 primes embedded in 11373379: {3, 7, 11, 13, 17, 31, 71, 79, 97, 113, 131, 179, 317, 797, 971, 11317, 17971, 131797, 317971, 1317971}.
		

Crossrefs

Extensions

a(18)-a(24) from Donovan Johnson, Jun 10 2010

A179908 First appearance of n in A039996: Primes embedded in prime(n).

Original entry on oeis.org

1, 6, 9, 30, 33, 203, 270, 220, 1476, 1368, 2638, 10561, 10726, 18926, 87984, 86693, 101294, 170447, 734638, 749502, 1503095, 6475615, 3131428, 7364000, 6504583, 27508889, 56295291, 66084700, 98097954
Offset: 1

Views

Author

Robert G. Wilson v, Aug 01 2010

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[ {id = IntegerDigits@n}, len = Length@ id - 1; Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[ id, k, 1], {k, len}], 1]], True] + 1]; t = Table[0, {30}]; p = 2; While[p < 2*10^9, a = f@p; If[ t[[a]] == 0, pp = PrimePi@p; t[[a]] = pp; Print[{a, p, pp}]]; p = NextPrime@p]; t
Showing 1-3 of 3 results.