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.

A279885 First n-digit palindrome in the decimal expansion of Pi.

This page as a plain text file.
%I A279885 #60 Jan 10 2022 15:44:35
%S A279885 3,33,141,3993,46264,999999,1736371,23911932,398989893,136776310,
%T A279885 21348884312,450197791054,9475082805749,95715977951759,
%U A279885 697763767367796,4855796336975584,42611063036011624,700015327723510007,5851405951595041585,74054579700797545047
%N A279885 First n-digit palindrome in the decimal expansion of Pi.
%C A279885 Numbers can start with 0. For example, a(10) = 0136776310.
%C A279885 The first 6-digit palindrome in the decimal expansion of Pi has all of its digits the same (999999).
%C A279885 No further terms wholly within the first 10^9 digits of Pi. - _Michael S. Branicky_, Jan 10 2022
%e A279885 a(2) = 33 because 33 is the first 2-digit palindrome in the decimal expansion of Pi = 3.14159265358979323846264(33)...
%t A279885 With[{d = First@ RealDigits@ N[Pi, 10^7]}, Table[If[Length@ # == 0, 0, FromDigits@ First@ #] &@ Select[Partition[d, n, 1], # == Reverse@ # &], {n, 13}]] (* _Michael De Vlieger_, Jan 06 2017 *)
%o A279885 (Python)
%o A279885 from sympy import S
%o A279885 # download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then
%o A279885 # with open('pi-billion.txt', 'r') as f: pi_digits = f.readline()
%o A279885 pi_digits = str(S.Pi.n(3*10**5+2))[:-2] # alternative to above
%o A279885 pi_digits = pi_digits.replace(".", "")
%o A279885 def ispal(s): return s == s[::-1]
%o A279885 def a(n):
%o A279885     for idx in range(len(pi_digits)-n):
%o A279885         if ispal(pi_digits[idx:idx+n]):
%o A279885             return int(pi_digits[idx:idx+n]), idx
%o A279885     return None, None # Not found: Increase number of digits
%o A279885 print([a(n)[0] for n in range(1, 13)]) # _Michael S. Branicky_, Jan 10 2022
%Y A279885 Cf. A000796, A002113, A226486, A280631.
%K A279885 nonn,base
%O A279885 1,1
%A A279885 _Bobby Jacobs_, Jan 06 2017
%E A279885 a(8)-a(15) from _Michael De Vlieger_, Jan 06 2017
%E A279885 a(16)-a(20) from _Michael S. Branicky_, Jan 10 2022