OFFSET
1,3
COMMENTS
EXAMPLE
0 is in the sequence since 2, 3, 5, and 7 are all primes;
1 is in the sequence since 31 and 37 are both primes;
2 is in the sequence since 311, 313, and 317 are all primes;
3 is not in the sequence since 3141, 3143, 3147, and 3149 are all composites;
4 is not in the sequence since 31411, 31413, 31417, and 31419 are all composites;
5 is in the sequence since 314159 is a prime; etc.
MATHEMATICA
fQ[n_] := Union[PrimeQ[ 10 IntegerPart[10^n*Pi] + {1, 3, 7, 9}]][[-1]]; k = -1; lst = {}; While[k < 17001, If[ fQ@ k, AppendTo[lst, k + 1]; Print[k + 1]]; k++]; lst
Module[{nn=16300, pd}, pd=RealDigits[Pi, 10, nn][[1]]; Select[Range[0, nn], AnyTrue[ 10*FromDigits[Take[pd, #]]+{1, 3, 7, 9}, PrimeQ]&]] (* Harvey P. Dale, Aug 14 2022 *)
PROG
(PARI) is(n)=my(d=Pi*10^n\10*10); isprime(d+1) || isprime(d+3) || isprime(d+7) || isprime(d+9) \\ Charles R Greathouse IV, Nov 07 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Marvin Ray Burns and Robert G. Wilson v, Nov 07 2013
EXTENSIONS
Keyword "base" added by Zak Seidov, Nov 11 2013
STATUS
approved