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!)
A280631 Starting position (after the decimal point) of the first n-digit palindrome in the decimal expansion of Pi. 1
0, 24, 1, 43, 19, 762, 640, 3732, 6577, 16061, 247146, 273840, 879326, 5380812, 10593200, 171880711, 105176740, 517694394, 559015193, 824827924 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The first 10-digit palindrome in the decimal expansion of Pi (0136776310) first appears at a palindromic position (16061).
LINKS
EXAMPLE
a(2) = 24 because the first 2-digit palindrome in the decimal expansion of Pi (33) starts 24 digits after the decimal point.
3.14159265358979323846264(33)...
MATHEMATICA
With[{d = First@ RealDigits@ N[Pi, 10^6]}, Prepend[DeleteCases[Rest@ #, 0], First@ #] &@ Flatten@ Map[If[Length@ # == 0, 0, #[[1, 1]] - 1] &@ SequencePosition[d, #] &, Table[If[Length@ # == 0, {}, First@ #] &@ Select[Partition[d, n, 1], # == Reverse@ # &], {n, 20}]]] (* Michael De Vlieger, Jan 07 2017, Version 10.1 *)
PROG
(Python)
from sympy import S
# download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then
# with open('pi-billion.txt', 'r') as f: pi_digits = f.readline()
pi_digits = str(S.Pi.n(3*10**5+2))[:-2] # alternative to above
pi_digits = pi_digits.replace(".", "")
def ispal(s): return s == s[::-1]
def a(n):
for idx in range(len(pi_digits)-n):
if ispal(pi_digits[idx:idx+n]):
return int(pi_digits[idx:idx+n]), idx
return None, None # Not found: Increase number of digits
print([a(n)[1] for n in range(1, 13)]) # Michael S. Branicky, Jan 10 2022
CROSSREFS
Sequence in context: A040598 A097190 A103903 * A040599 A076721 A232988
KEYWORD
nonn,base,more,less
AUTHOR
Bobby Jacobs, Jan 06 2017
EXTENSIONS
a(14)-a(15) from Michael De Vlieger, Jan 07 2017
a(16)-a(20) from Michael S. Branicky, Jan 10 2022
STATUS
approved

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 16 04:38 EDT 2024. Contains 371696 sequences. (Running on oeis4.)