|
|
A018834
|
|
Numbers k such that the decimal expansion of k^2 contains k as a substring.
|
|
27
|
|
|
0, 1, 5, 6, 10, 25, 50, 60, 76, 100, 250, 376, 500, 600, 625, 760, 1000, 2500, 3760, 3792, 5000, 6000, 6250, 7600, 9376, 10000, 14651, 25000, 37600, 50000, 60000, 62500, 76000, 90625, 93760, 100000, 109376, 250000, 376000, 495475, 500000, 505025
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
25^2 = 625 which contains 25.
3792^2 = 14_3792_64, 14651^2 = 2_14651_801.
|
|
MATHEMATICA
|
Select[Range[510000], MemberQ[FromDigits /@ Partition[IntegerDigits[#^2], IntegerLength[#], 1], #] &] (* Jayanta Basu, Jun 29 2013 *)
Select[Range[0, 510000], StringPosition[ToString[#^2], ToString[#]]!={}&] (* Ivan N. Ianakiev, Oct 02 2016 *)
|
|
PROG
|
(Haskell)
import Data.List (isInfixOf)
a018834 n = a018834_list !! (n-1)
a018834_list = filter (\x -> show x `isInfixOf` show (x^2)) [0..]
(Python)
from itertools import count, islice
def A018834_gen(startvalue=0): # generator of terms >= startvalue
return filter(lambda n:str(n) in str(n**2), count(max(startvalue, 0)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|