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.

A360822 Numbers whose squares have at most 2 digits less than 8.

This page as a plain text file.
%I A360822 #24 Mar 12 2023 04:16:13
%S A360822 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,
%T A360822 91,93,94,97,99,141,167,173,197,283,293,297,298,303,313,314,316,447,
%U A360822 583,707,767,833,836,917,943,947,1378,2917,2983,3033,5467,9417,9433,29983,31367,94863
%N A360822 Numbers whose squares have at most 2 digits less than 8.
%C A360822 From _Michael S. Branicky_, Feb 22 2023: (Start)
%C A360822 Conjecture: Sequence has 72 terms, with largest term 940206833.
%C A360822 No terms > 940206833 with less than 17 digits. (End)
%H A360822 Michael S. Branicky, <a href="/A360822/a360822.py.txt">Python program</a>
%e A360822 314641 is in the sequence, because 314641^2 = 98998958881 has only two digits that are less than 8.
%t A360822 Select[Range[10^5], Count[IntegerDigits[#^2], _?(#1 < 8 &)] < 3 &] (* _Amiram Eldar_, Feb 22 2023 *)
%o A360822 (PARI) isok(k) = #select(x->(x<8), digits(k^2)) <= 2; \\ _Michel Marcus_, Feb 22 2023
%o A360822 (Python)
%o A360822 def ok(n): return sum(1 for d in str(n**2) if d < "8") < 3
%o A360822 print([k for k in range(1, 10**5) if ok(k)]) # _Michael S. Branicky_, Feb 22 2023
%o A360822 (Python) # see link for a faster version to find all terms
%o A360822 (Python)
%o A360822 from itertools import count, islice
%o A360822 def A360822_gen(startvalue=1): # generator of terms >= startvalue
%o A360822     return filter(lambda n:len(s:=str(n**2))<=s.count('8')+s.count('9')+2,count(max(startvalue,1)))
%o A360822 A360822_list = list(islice(A360822_gen(),62)) # _Chai Wah Wu_, Mar 11 2023
%Y A360822 Cf. A360803.
%K A360822 nonn,base
%O A360822 1,2
%A A360822 _Dmitry Kamenetsky_, Feb 22 2023