login
A046838
Numbers k such that k^2 can be obtained from k by inserting a block of digits.
2
0, 1, 5, 6, 10, 11, 25, 76, 95, 96, 100, 101, 125, 376, 625, 976, 995, 996, 1000, 1001, 1025, 1376, 9376, 9625, 9976, 9995, 9996, 10000, 10001, 10025, 10376, 10625, 90625, 99376, 99625, 99976, 99995, 99996, 100000, 100001, 100025, 100376, 100625, 109376, 890625
OFFSET
1,3
COMMENTS
From Robert Israel, Oct 24 2025: (Start)
Every term is of one of the following types:
(a) x with d digits such that x^2 == x (mod 10^d).
(b) 10^r + x, x as in (a).
(c) 10^r - 10^d + x, x as in (a).
(End)
LINKS
MAPLE
N:= 10: # for terms of <= N digits
R:= 0, seq(10^i, i=0..N-1), seq(10^i+1, i=1..N-1):
for d from 0 to N do
for b in [chrem([0, 1], [2^d, 5^d]), chrem([1, 0], [2^d, 5^d])] do
for r from 1 to N-d do
x:= b + (10^r-1)*10^d;
if floor(x^2/10^(ilog10(x^2)-r+1)) = 10^r-1 then R:= R, x fi;
od;
if b >= 10^(d-1) then
R:= R, b; # for a = 0
fi;
for r from 0 to N-d-1 do
x:= b + 10^(r+d);
if floor(x^2/10^(ilog10(x^2)-r)) = 10^r then R:= R, x fi;
od;
od od:
sort(convert({R}, list));
PROG
(Python)
def ok(n):
s, t = str(n), str(n**2)
return any(s == t[:i]+t[j:] for i in range(len(t)) for j in range(i, len(t)+1))
print([k for k in range(900000) if ok(k)]) # Michael S. Branicky, Sep 12 2025
CROSSREFS
Sequence in context: A074913 A046829 A052212 * A326418 A037359 A099538
KEYWORD
nonn,base
STATUS
approved