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.

A104247 Primes that are the sum of digits of the first k primes for some k.

Original entry on oeis.org

2, 5, 17, 19, 23, 31, 41, 61, 71, 83, 181, 269, 389, 419, 449, 631, 683, 727, 743, 809, 929, 1039, 1061, 1069, 1091, 1277, 1381, 1481, 1567, 1613, 1747, 1873, 1951, 1993, 2039, 2129, 2281, 2297, 2339, 2381, 2549, 2579
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Examples

			a(4)=19 because A058049(4)= 5 and sum of digits of the first 5 primes, 2+3+5+7+(1+1)=19 is prime.
		

Crossrefs

Corresponding n's: A058049. Primes: A000040, sum of digits of primes: A007605.

Programs

  • Python
    from sympy import isprime, nextprime
    def sd(n): return sum(map(int, str(n)))
    def aupto(limit):
        alst, k, p, s = [], 1, 2, 2
        while s <= limit:
            if isprime(s): alst.append(s)
            k += 1; p = nextprime(p); s += sd(p)
        return alst
    print(aupto(2579)) # Michael S. Branicky, Jul 18 2021

Formula

a(n) = A007605(1) + ... + A007605(A058049(n)).

A057573 Number of primes in A051351 which have index <= 10^n.

Original entry on oeis.org

1, 7, 25, 122, 934, 7268, 61756, 537324, 4756645
Offset: 0

Views

Author

Robert G. Wilson v, Nov 27 2000

Keywords

Crossrefs

Cf. A051351 and A058049.

Programs

  • Mathematica
    NextPrime[ n_Integer ] := Module[ {k}, k = n + 1; While[ ! PrimeQ[ k ], k++ ]; k ]; c = d = p = q = 0; Do[ While[ d++; d <= 10^n, q = NextPrime[ q ]; p = p + Apply[ Plus, RealDigits[ q ] [[ 1 ] ]]; If[ PrimeQ[ p ], c++ ]]; d--; Print[ c ], {n, 0, 10} ]

Extensions

Offset corrected by Sean A. Irvine, Jun 17 2022
Showing 1-2 of 2 results.