login
A360822
Numbers whose squares have at most 2 digits less than 8.
2
1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 17, 22, 23, 27, 28, 29, 30, 31, 33, 43, 53, 63, 67, 77, 83, 91, 93, 94, 97, 99, 141, 167, 173, 197, 283, 293, 297, 298, 303, 313, 314, 316, 447, 583, 707, 767, 833, 836, 917, 943, 947, 1378, 2917, 2983, 3033, 5467, 9417, 9433, 29983, 31367, 94863
OFFSET
1,2
COMMENTS
From Michael S. Branicky, Feb 22 2023: (Start)
Conjecture: Sequence has 72 terms, with largest term 940206833.
No terms > 940206833 with less than 17 digits. (End)
LINKS
EXAMPLE
314641 is in the sequence, because 314641^2 = 98998958881 has only two digits that are less than 8.
MATHEMATICA
Select[Range[10^5], Count[IntegerDigits[#^2], _?(#1 < 8 &)] < 3 &] (* Amiram Eldar, Feb 22 2023 *)
PROG
(PARI) isok(k) = #select(x->(x<8), digits(k^2)) <= 2; \\ Michel Marcus, Feb 22 2023
(Python)
def ok(n): return sum(1 for d in str(n**2) if d < "8") < 3
print([k for k in range(1, 10**5) if ok(k)]) # Michael S. Branicky, Feb 22 2023
(Python) # see link for a faster version to find all terms
(Python)
from itertools import count, islice
def A360822_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:len(s:=str(n**2))<=s.count('8')+s.count('9')+2, count(max(startvalue, 1)))
A360822_list = list(islice(A360822_gen(), 62)) # Chai Wah Wu, Mar 11 2023
CROSSREFS
Cf. A360803.
Sequence in context: A119509 A219248 A055568 * A283161 A165165 A075776
KEYWORD
nonn,base
AUTHOR
Dmitry Kamenetsky, Feb 22 2023
STATUS
approved