A045953 Numbers m such that m^2 can be obtained from m by inserting an internal block of (contiguous) digits.
0, 1, 10, 11, 95, 96, 100, 101, 125, 976, 995, 996, 1000, 1001, 1025, 1376, 9625, 9976, 9995, 9996, 10000, 10001, 10025, 10376, 10625, 99376, 99625, 99976, 99995, 99996, 100000, 100001, 100025, 100376, 100625, 109376, 990625, 999376, 999625, 999976
Offset: 1
Examples
95^2 = 9025 (insert '02' inside '95').
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..100
- J. Knoderer, What number comes next? (an interesting sequence)
Programs
-
Haskell
import Data.List (isPrefixOf, inits, isSuffixOf, tails) a045953 n = a045953_list !! (n-1) a045953_list = filter chi a008851_list where chi n = (x == y && xs `isSub'` ys) where x:xs = show $ div n 10 y:ys = show $ div (n^2) 10 isSub' us vs = any id $ zipWith (&&) (map (`isPrefixOf` vs) $ inits us) (map (`isSuffixOf` vs) $ tails us) -- Reinhard Zumkeller, Jul 27 2011
Comments