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-2 of 2 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

A372600 Least prime whose decimal representation has n distinct substrings which are also prime.

Original entry on oeis.org

2, 13, 23, 113, 131, 137, 1013, 1031, 1279, 1237, 1973, 6173, 10139, 10193, 10391, 10739, 10937, 12739, 12379, 36137, 100937, 101693, 102931, 102397, 103913, 106319, 106937, 109379, 123479, 123973, 125791, 123719, 361973, 852937, 1006937, 1019731, 1023173, 1021973, 1024379, 1027319
Offset: 1

Views

Author

Robert G. Wilson v, May 06 2024

Keywords

Comments

First occurrence n of pi(a(n)) in A039994: 1, 6, 9, 30, 32, 33, 170, 173, 207, 203, 298, 804, ..., .

Examples

			A039994(1) = 1, is the first occurrence of 1 which is the index of the prime 2;
A039994(6) = 2, is the first occurrence of 2 and 6 is the index of the prime 13;
A039994(9) = 3, is the first occurrence of 3 and 9 is the index of the prime 23;
A039994(30) = 4, is the first occurrence of 4 and 30 is the index of the prime 113; etc.
		

Crossrefs

Cf. A039994.

Programs

  • Mathematica
    f[p_] := Count[ PrimeQ[ Union[ FromDigits@# & /@ Rest@ Subsets[ IntegerDigits@ p]]], True]; t[_] := 0; p = 2; While[p < 10000001, a = f@ p; If[ t[a] == 0, t[a] = p]; p = NextPrime@ p]; t /@ Range@ 56
Showing 1-2 of 2 results.