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.

User: Manan Shah

Manan Shah's wiki page.

Manan Shah has authored 2 sequences.

A330125 Positive integers whose digit-power sum is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 12, 14, 16, 21, 23, 25, 27, 32, 38, 41, 45, 49, 52, 54, 56, 58, 61, 65, 72, 78, 83, 85, 87, 94, 101, 110, 111, 113, 115, 122, 124, 128, 131, 139, 142, 146, 148, 151, 155, 164, 166, 182, 184, 193, 199, 212, 214, 218, 221, 223, 227, 232, 236, 238, 241
Offset: 1

Author

Manan Shah, Dec 01 2019

Keywords

Comments

Let M be an N-digit positive integer with digits (base 10) d_1, d_2, d_3, ..., d_N. If Sum_{i = 1..N} (d_i)^N is prime, then M is part of this sequence.
Numbers k such that A101337(k) is prime.
Both A139749 and A178357 are similar and match the first several terms of this sequence, but the digit powers are different. Additionally, perhaps a more interesting sequence is the subsequence of primes: 2, 3, 5, 7, 11, 23, 41, 61, 83.

Examples

			The first four terms are the single-digit primes; a(5) = 11 since 1^2 + 1^2 = 2, which is prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,d,t;
       L:= convert(n,base,10);
       d:= nops(L);
       isprime(add(t^d, t=L))
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Oct 17 2023
  • Mathematica
    Select[Range[250], (d = IntegerDigits[#]; PrimeQ@ Total[d^Length[d]]) &] (* Giovanni Resta, Dec 02 2019 *)
  • PARI
    isok(n) = {my(d = digits(n)); isprime(sum(k=1, #d, d[k]^#d));} \\ Michel Marcus, Dec 05 2019

Extensions

More terms from Giovanni Resta, Dec 02 2019

A283247 a(n) is the smallest prime number whose representation contains as a substring the first n digits of Pi in base 10.

Original entry on oeis.org

3, 31, 13147, 73141, 314159, 314159, 131415923, 1314159269, 23141592653, 23141592653, 314159265359, 3141592653581, 213141592653589, 1131415926535897, 9314159265358979, 173141592653589793, 3141592653589793239, 3141592653589793239, 314159265358979323861
Offset: 1

Author

Manan Shah, Jul 20 2017

Keywords

Comments

Pi progresses as 3, 31, 314, 3141, hence minimal prime numbers that do this are 3, 31, 13147, 73141. While there are other primes that contain, say, 314, the prime number, 13147 is the first prime to do so.
It is probably provable that this is an infinite sequence. Notice that 314159 appears twice in the sequence since 314159 is the smallest prime that contains 31415 as well as 314159.
a(n) exists for all n since for sufficiently large k, the k-th prime gap < prime(k)^d for some d < 1, so for a fixed number a, the next prime after a*10^m will be less than (a+1)*10^m for sufficiently large m and thus contain a as a substring. - Chai Wah Wu, Feb 22 2018

Examples

			a(4) = 73141 since 73141 is the smallest prime number that contains 3141 (the first 4 digits of Pi).
a(5) = 314159 since 314159 is the smallest prime number that contains 31415.
a(6) = 314159 since 314159 is the smallest prime number that contains 314159.
		

Crossrefs

Programs

  • Mathematica
    pp[n_] := If[PrimeQ@n, n, Block[{d = IntegerDigits@n, p, s, t}, p = 10^Length[d]; s = Select[Join[Range[9] p + n, {1,3,7,9} + 10 n], PrimeQ]; If[s != {}, Min@s, s = NextPrime[100 n]; t = Join[If[Floor[s/100] == n, {s}, {}], Range[10, 99] p + n, FromDigits /@ Flatten /@ Tuples[{Range@9, {d}, {1, 3, 7, 9}}]]; s = Select[t, PrimeQ]; If[s == {}, 0, Min@s]]]]; Table[pp[Floor[10^e Pi]], {e, 0, 18}] (* Giovanni Resta, Jul 21 2017 *)
  • Python
    pi_digits = pi_digit_generator #user-defined generator for producing next digit of Pi
    next_digit = pi_digits.next() #first call, so next_digit = 3
    primes = prime_generator #user-defined generator for producing next prime
    current_prime = primes.next() #first call, so current_prime = 2
    pi_progress = 0
    while True:
        pi_progress = pi_progress*10 + next_digit
        while str(pi_progress) not in str(current_prime):
            current_prime = primes.next()
        print(pi_progress,current_prime)

Extensions

a(7)-a(19) from Giovanni Resta, Jul 21 2017