|
|
A357474
|
|
Squarely correct numbers.
|
|
0
|
|
|
1, 4, 9, 11, 14, 16, 19, 25, 36, 41, 44, 49, 64, 81, 91, 94, 99, 100, 111, 114, 116, 119, 121, 125, 136, 141, 144, 149, 161, 164, 169, 181, 191, 194, 196, 199, 225, 251, 254, 256, 259, 289, 324, 361, 364, 369, 400, 411, 414, 416, 419, 425, 436, 441, 444, 449, 464
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
A positive integer is a squarely correct number if its base-10 representation consists entirely of one or more adjacent blocks of digits that are positive perfect squares with no leading zeros. (See George Berzsenyi link below.)
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
14401 is not a term, but 14411 is.
|
|
PROG
|
(Python)
from sympy.ntheory.primetest import is_square
def ok(n):
if is_square(n): return True
s = str(n)
return any(s[i]!="0" and ok(int(s[:i])) and ok(int(s[i:])) for i in range(1, len(s)))
(PARI) is(n)=if(n<11, issquare(n), n%10, my(d=digits(n)); for(i=1, #d, if(issquare(n%10^i) && d[#d+1-i] && is(n\10^i), return(1))); 0, my(k=valuation(n, 10)); k%2==0 && is(n/10^k)) \\ Charles R Greathouse IV, Oct 04 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|