|
|
A185366
|
|
First n-digit square in the digits of e.
|
|
0
|
|
|
1, 81, 676, 8281, 72900, 819025, 21609, 3644281, 59845696, 796707076, 2113884529, 736205184576, 1751509314916, 1751509314916, 5176216516900, 4737309139140769, 99398242392417424, 887828157705424896, 8576326547254681744, 2583667059970281481
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Squares are allowed to have prefix 0 (see example).
a(18)-a(20) require 1.6, 2, 4.9 billion digits, respectively. - Michael S. Branicky, Dec 28 2022
|
|
LINKS
|
|
|
EXAMPLE
|
a(7) = 21609 is the first square that occurs in the sequence of the 7 decimal digits ...0021609...with the index 830 in A001113.
|
|
MAPLE
|
Digits := 10000: p0 := evalf(exp(1)):for d from 1 to 20 do: id:=0:for i from
0 to 50000 while(id=0) do :q0:=trunc(p0*10^(i+d-1)): x:= irem(q0, 10^d): if sqrt(x)=floor(sqrt(x)) then printf(`%d, `, x):id:=1: else fi:od:od:
|
|
PROG
|
(Python)
from math import isqrt
from sympy import E, isprime
e = str(E.n(10**5))[2:] # or load from file using the pattern:
# with open('e.txt', 'r') as f: digits_of_e = f.readline()[2:]
def a(n): return next((t for k in range(len(e)-n) if isqrt(t:=int(e[k:k+n]))**2 == t), "more digits needed")
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|