login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A052055 Positions in both Pi and e indicate a common digit. 6

%I #30 Apr 30 2023 02:07:50

%S 13,17,18,21,34,40,45,56,59,70,81,95,100,143,170,206,244,263,275,279,

%T 294,324,326,331,334,361,365,388,389,396,412,420,428,429,453,460,461,

%U 462,484,494,500,501,504,507,512,523,526,548,582,591,595,596,599,603

%N Positions in both Pi and e indicate a common digit.

%H Jens Kruse Andersen, <a href="/A052055/b052055.txt">Table of n, a(n) for n = 1..10000</a>

%e Pi = 3.1415926535897932384626...

%e ..................|...||..|.....

%e _e = 2.7182818284590452353602...

%p N:= 1000: # to get all terms <= N+1

%p Fpi:= convert(floor(10^N*Pi),base,10):

%p Fe:= convert(floor(10^N*exp(1)),base,10):

%p select(t -> Fpi[N+2-t] = Fe[N+2-t],[$2..N+1]); # _Robert Israel_, Jul 23 2014

%t ed=RealDigits[N[E,2000]][[1]]; pd=RealDigits[N[\[Pi],2000]][[1]]; okQ[n_] := Take[ed,{n}] == Take[pd,{n}]; Select[Range[2000], okQ] (* _Harvey P. Dale_, Jan 05 2011 *)

%t Module[{nn=3000,pid,ed},pid=RealDigits[Pi,10,nn][[1]];ed=RealDigits[ E,10,nn] [[1]]; Flatten[ Position[Transpose[{pid,ed}],{x_,x_}]]] (* _Harvey P. Dale_, Dec 19 2015 *)

%o (PARI) \p 1000

%o e=Vec(Str(exp(1))); p=Vec(Str(Pi)); for(n=3, #e-9, if(e[n]==p[n], print1(n-1", "))) \\ _Jens Kruse Andersen_, Jul 23 2014

%o (Python)

%o from sympy import E, S

%o digits = 1000

%o pi, e = str(S.Pi.n(digits+3)), str(E.n(digits+3))

%o print([k for k in range(2, digits+1) if pi[k] == e[k]]) # _Michael S. Branicky_, Apr 29 2023

%Y Cf. A000796, A001113, A257492, A257494.

%K nonn,base

%O 1,1

%A _Patrick De Geest_, Dec 15 1999

%E More terms from _James A. Sellers_, Dec 28 1999

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)