A064770 Replace each digit of n with the floor of its square root.
0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 20, 21, 21, 21, 22, 22, 22, 22, 22, 23, 20, 21, 21, 21, 22, 22, 22, 22, 22, 23, 20, 21, 21, 21, 22, 22, 22, 22, 22, 23
Offset: 0
Examples
26 -> [1.414...][2.449...] -> 12, so a(26) = 12.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..9999
- Olivier Gerard, Fractal behavior of this sequence (1). [broken link]
Programs
-
Haskell
import Data.Char (digitToInt) a064770 :: Integer -> Integer a064770 = read . map (("0111222223" !!) . digitToInt) . show -- Reinhard Zumkeller, Aug 24 2011
-
Maple
a:= n-> (l-> add(([0, 1$3, 2$5, 3][l[i]+1])*10^i, i=1..nops(l))/10)(convert(n, base, 10)): seq(a(n), n=0..69); # Alois P. Heinz, Oct 19 2024
-
Mathematica
Table[ FromDigits[ Floor[ Sqrt[ IntegerDigits[ n]]]], {n, 0, 100} ] With[{dg=Table[n->Floor[Sqrt[n]],{n,0,9}]},Table[FromDigits[ IntegerDigits[ k]/.dg],{k,0,100}]] (* Harvey P. Dale, Oct 23 2020 *)
-
PARI
a(n) = fromdigits(apply(sqrtint, digits(n))); \\ Michel Marcus, Nov 12 2023
-
Python
def A064770(n): return int(''.join(map(lambda x:'0111222223'[int(x)], str(n)))) # Chai Wah Wu, Oct 19 2024
Comments