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!)
A343739 a(n) is the last digit to appear in sqrt(n) (or -1 if n is a square). 4
-1, 8, 4, -1, 5, 6, 8, 5, -1, 4, 8, 2, 8, 0, 5, -1, 8, 3, 1, 0, 3, 3, 6, 0, -1, 6, 8, 4, 9, 8, 9, 7, 1, 6, 2, -1, 4, 3, 1, 1, 9, 1, 9, 1, 1, 4, 7, 4, -1, 9, 0, 4, 6, 0, 3, 0, 1, 4, 3, 0, 3, 2, 6, -1, 1, 7, 0, 7, 5, 1, 0, 6, 9, 9, 9, 5, 5, 9, 2, 3, -1, 2, 6, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
For the digit position in sqrt(n) at which the digit a(n) first appears, see A343740.
LINKS
FORMULA
a(100^q*n) = a(n), q > 0. - Bernard Schott, Jul 24 2021
EXAMPLE
a(2)=8 because 8 is the last digit to appear in sqrt(2) = 1.414213562373095048...;
a(24)=0 because 0 is the last digit to appear in sqrt(24) = 4.898979485566356196394568149411782783931894961313340...
MATHEMATICA
Table[If[IntegerQ@ Sqrt@ n, -1, Function[s, FirstPosition[#, Max@ #][[1]] - 1 &@ Array[FirstPosition[s, #][[1]] &, 10, 0]]@ RealDigits[Sqrt[n], 10, 120][[1]]], {n, 84}] (* Michael De Vlieger, Jul 06 2021 *)
PROG
(Python 3.8+)
from math import isqrt
def A343739(n):
i = isqrt(n)
if i**2 == n:
return -1
m, dset = n, set()
for d in (int(s) for s in str(i)):
dset.add(d)
if len(dset) == 10:
return d
while len(dset) < 10:
m *= 100
d = isqrt(m) % 10
dset.add(d)
return d # Chai Wah Wu, Jul 07 2021
CROSSREFS
Sequence in context: A011267 A049469 A349625 * A021547 A154527 A145435
KEYWORD
sign,base
AUTHOR
Jon E. Schoenfield, Jul 05 2021
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 25 06:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)