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-5 of 5 results.

A109066 Number of prime digits in n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 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, 1, 2, 1, 2, 1, 0, 1, 2, 1, 1, 2, 1, 0, 0, 1, 1, 0, 1, 3, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 1, 2, 2, 2, 1, 2, 2, 2, 3, 2, 1, 3, 2, 2, 3, 2, 2, 1, 2, 0, 0, 0, 1, 1, 2, 1, 1, 0, 2, 0, 1, 1, 1, 1, 0, 0, 2, 1, 2, 3, 1, 2, 3, 2, 1, 2
Offset: 1

Views

Author

Zak Seidov, Jun 17 2005

Keywords

Comments

The prime A000040(n) is in A034844 iff a(n) = 0; it is in A179336 iff a(n) > 0. [Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012]

Crossrefs

Cf. A019546 (primes whose digits are primes), A092629 (number of prime digits is nonprime), A104250 (sum of prime digits of n-th prime).

Programs

  • Mathematica
    a[n_]:=Count[PrimeQ/@IntegerDigits[Prime[n]], True]
  • PARI
    a(n) = vecsum(apply(x->isprime(x), digits(prime(n)))); \\ Michel Marcus, Mar 15 2019

Formula

a(n) = A193238(A000040(n)). [Reinhard Zumkeller, Jul 19 2011]

A179335 a(n) is the smallest prime which appears as a substring of the decimal representation of prime(n).

Original entry on oeis.org

2, 3, 5, 7, 11, 3, 7, 19, 2, 2, 3, 3, 41, 3, 7, 3, 5, 61, 7, 7, 3, 7, 3, 89, 7, 101, 3, 7, 109, 3, 2, 3, 3, 3, 149, 5, 5, 3, 7, 3, 7, 181, 19, 3, 7, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 401, 409, 19, 2, 3, 3, 3, 3, 449, 5, 61, 3, 7, 7, 7
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 11 2010

Keywords

Comments

a(n) < 10 iff prime(n) is in A179336;
a(n) = prime(n) iff prime(n) is in A033274. [Corrected by M. F. Hasler, Aug 27 2012]

Crossrefs

Programs

  • PARI
    A179335(n)={my(p=prime(n),m=0,M); for(d=1,n, M=10^d; n=p; until(n<=M || !n\=10, isprime(n%M) & (!m || m>n%M) & m=n%M); m & return(m))} \\ M. F. Hasler, Aug 27 2012
    
  • Python
    from sympy import isprime, prime
    def a(n):
        s = str(prime(n))
        ss = set(int(s[i:i+1+l]) for i in range(len(s)) for l in range(len(s)))
        return min(t for t in ss if isprime(t))
    print([a(n) for n in range(1, 94)]) # Michael S. Branicky, Jun 29 2022

A104251 Sum of nonprime digits of n-th prime.

Original entry on oeis.org

0, 0, 0, 0, 2, 1, 1, 10, 0, 9, 1, 0, 5, 4, 4, 0, 9, 7, 6, 1, 0, 9, 8, 17, 9, 2, 1, 1, 10, 2, 1, 2, 1, 10, 14, 2, 1, 7, 7, 1, 10, 10, 11, 10, 10, 19, 2, 0, 0, 9, 0, 9, 5, 1, 0, 6, 15, 1, 0, 9, 8, 9, 0, 2, 1, 1, 1, 0, 4, 13, 0, 9, 6, 0, 9, 8, 17, 9, 5, 13, 14, 5, 5, 4, 13, 8, 17, 4, 11, 10, 10, 13, 12
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Examples

			a(6)=1 because sum of composite (nonprime) digits of prime(6)=13 is 1.
		

Crossrefs

Cf. A000040 (primes).
Cf. A007605 (sum of digits of primes), A104250 (sum of prime digits of n-th prime).

Formula

a(n) = A007605(n) - A104250(n).

A104260 Sum of odd digits (1,3,5,7,9) of n-th prime.

Original entry on oeis.org

0, 3, 5, 7, 2, 4, 8, 10, 3, 9, 4, 10, 1, 3, 7, 8, 14, 1, 7, 8, 10, 16, 3, 9, 16, 2, 4, 8, 10, 5, 8, 5, 11, 13, 10, 7, 13, 4, 8, 11, 17, 2, 11, 13, 17, 19, 2, 3, 7, 9, 6, 12, 1, 6, 12, 3, 9, 8, 14, 1, 3, 12, 10, 5, 7, 11, 7, 13, 10, 12, 11, 17, 10, 13, 19, 6, 12, 19, 1, 9, 10, 1, 4, 6, 12, 3, 9, 12
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Crossrefs

Sum of even digits (2, 4, 6, 8) of n-th prime: A104261, sum of prime digits (2, 3, 5, 7) of n-th prime: A104250, sum of composite (nonprime) digits (1, 4, 6, 8, 9) of n-th prime: A104251, sum of digits of primes: A007605, primes: A000040.

Programs

  • Mathematica
    sodod={};Do[id=IntegerDigits[Prime[i]];lid=Length[id];sod=Sum[If[OddQ[id[[k]]], id[[k]], 0], {k, lid}];sodod={sodod, sod}, {i, 200}];sodod//Flatten
    f[n_] := Plus @@ Select[ IntegerDigits[ Prime[n]], OddQ[ # ] &]; Table[ f[n], {n, 88}] (* Robert G. Wilson v, Nov 03 2005 *)

Formula

a(n) = A007605(n) - A104261(n).

A104261 Sum of even digits (0,2,4,6,8) of n-th prime.

Original entry on oeis.org

2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 4, 4, 4, 0, 0, 6, 6, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 6, 6, 0, 0, 8, 0, 0, 0, 0, 2, 4, 4, 4, 2, 2, 6, 2, 2, 8, 8, 2, 2, 10, 10, 2, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 6, 0, 0, 8, 8, 0, 4, 4, 4, 6, 4, 4, 4, 8, 8, 4, 10, 10, 10, 4, 12, 4, 4, 0, 0, 2, 2, 4, 4, 0
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Crossrefs

Sum of odd digits (1, 3, 5, 7, 9) of n-th prime: A104260, sum of prime digits (2, 3, 5, 7) of n-th prime: A104250, sum of composite (nonprime) digits (1, 4, 6, 8, 9) of n-th prime: A104251, sum of digits of primes: A007605, primes: A000040.

Programs

  • Mathematica
    sodev={};Do[id=IntegerDigits[Prime[i]];lid=Length[id];sod=Sum[If[EvenQ[id[[k]]], id[[k]], 0], {k, lid}];sodev={sodev, sod}, {i, 200}];sodev//Flatten
    f[n_] := Plus @@ Select[ IntegerDigits[ Prime[n]], EvenQ[ # ] && # > 1 &]; Table[ f[n], {n, 102}] (* Robert G. Wilson v, Nov 03 2005 *)

Formula

A104261(n) = A007605(n) - A104260(n).
Showing 1-5 of 5 results.