A065989 Numbers k such that the first k ternary digits of Pi expressed in decimal forms a prime.
2, 10, 14, 83, 669, 720, 921, 2944, 4567
Offset: 1
Examples
The first 10 ternary digits of Pi (A004602) are 1001021101 = 20611 in decimal, which is a prime.
Crossrefs
Cf. A004602.
Programs
-
Mathematica
Do[ If[ PrimeQ[ FromDigits[ First[ RealDigits[Pi, 2, n]], 2]], Print[n]], {n, 1, 5000} ] Module[{nn=4600,pd},pd=RealDigits[Pi,3,nn][[1]];Position[Table[ FromDigits[ Take[ pd,n],3],{n,nn}],?(PrimeQ[#]&)]]//Flatten (* _Harvey P. Dale, Oct 14 2018 *)
Comments