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
Michael S. Branicky, Python program
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)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Dmitry Kamenetsky, Feb 22 2023
STATUS
approved