cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A376003 Positive integers k such that each digit of k^2 is a factor of k.

This page as a plain text file.
%I A376003 #61 Oct 05 2024 22:52:58
%S A376003 1,6,12,36,54,108,156,168,192,204,288,306,408,432,486,696,804,1104,
%T A376003 1146,1188,1488,1512,1632,1764,1806,1932,2232,2904,3114,3408,3456,
%U A376003 3528,4014,4104,4392,4596,4608,4704,4788,4872,4932,4944,5208,5304,5868,6012,6696,6792
%N A376003 Positive integers k such that each digit of k^2 is a factor of k.
%C A376003 0 is never a factor so k^2 must be zeroless and this sequence is a subset of A052040.
%C A376003 The first term > 1 that is not divisible by 6 is 47768.
%C A376003 From _Andrew Howroyd_, Sep 28 2024: (Start)
%C A376003 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.
%C A376003 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)
%e A376003 k = 12 is a term since k^2 = 144 has digits 1 and 4 and both are factors of k.
%e A376003 k = 2 is not a term since k^2 = 4 has a digit 4 which is not a factor of k.
%p A376003 q:= n-> andmap(x-> x>0 and irem(n, x)=0, convert(n^2, base, 10)):
%p A376003 select(q, [$1..10000])[];  # _Alois P. Heinz_, Sep 28 2024
%o A376003 (Python)
%o A376003 def is_valid_k(k):
%o A376003     k_squared = k ** 2
%o A376003     for digit in str(k_squared):
%o A376003         d = int(digit)
%o A376003         if d == 0 or k % d != 0:
%o A376003             return False
%o A376003     return True
%o A376003 def find_valid_k(max_k):
%o A376003     valid_k = []
%o A376003     for k in range(1, max_k + 1):
%o A376003         if is_valid_k(k):
%o A376003             valid_k.append(k)
%o A376003     return valid_k
%o A376003 max_k = 10000
%o A376003 result = find_valid_k(max_k)
%o A376003 print(result)
%o A376003 (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
%Y A376003 Cf. A052040, A034838.
%K A376003 nonn,base
%O A376003 1,2
%A A376003 _Sam N. Harrison_, Sep 28 2024