OFFSET
1,2
COMMENTS
0 is never a factor so k^2 must be zeroless and this sequence is a subset of A052040.
The first term > 1 that is not divisible by 6 is 47768.
From Andrew Howroyd, Sep 28 2024: (Start)
Except for the first term, all terms are even since all squares with at least 2 digits contain an even digit. This implies k^2 cannot contain the digit 5.
All numbers of the form (100*1000^k-1)/3+3 are terms. These are the numbers 36, 33336, 33333336, 33333333336, etc. This shows that the sequence is infinite. (End)
EXAMPLE
k = 12 is a term since k^2 = 144 has digits 1 and 4 and both are factors of k.
k = 2 is not a term since k^2 = 4 has a digit 4 which is not a factor of k.
MAPLE
q:= n-> andmap(x-> x>0 and irem(n, x)=0, convert(n^2, base, 10)):
select(q, [$1..10000])[]; # Alois P. Heinz, Sep 28 2024
PROG
(Python)
def is_valid_k(k):
k_squared = k ** 2
for digit in str(k_squared):
d = int(digit)
if d == 0 or k % d != 0:
return False
return True
def find_valid_k(max_k):
valid_k = []
for k in range(1, max_k + 1):
if is_valid_k(k):
valid_k.append(k)
return valid_k
max_k = 10000
result = find_valid_k(max_k)
print(result)
(PARI) isok(k) = my(d=Set(digits(k^2))); if(!vecmin(d), return(0)); for (i=1, #d, if (k % d[i], return(0))); return(1); \\ Michel Marcus, Sep 28 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Sam N. Harrison, Sep 28 2024
STATUS
approved