Polydivisible number: Difference between revisions

Content deleted Content added
FortUser (talk | contribs)
Made the program compatible for older versions of Python 3.
Add category
 
(2 intermediate revisions by 2 users not shown)
Line 50:
|}
 
===Estimate for ''F<mathsub>F_bb</sub>''(''n'')</math> and <math>\&Sigma;(''b'')</math>===
[[File:Graph of polydivisible number vectorial.svg|right|thumb|400px|Graph of number of <math>n</math>-digit polydivisible numbers in base 10 <math>F_{10}(n)</math> vs estimate of <math>F_{10}(n)</math>]]
 
Line 311:
 
==Programming example==
The example below searches for polydivisible numbers in [[Python (programming language)|Python 3.x]].
<syntaxhighlight lang="python">
def find_polydivisible(base: int) -> list[int]:
Line 331:
return numbers
</syntaxhighlight>
 
Older versions of Python do not support annotations using built-in classes. Instead of using list[int], the beginning would become:
 
<syntaxhighlight lang="python">
from typing import List
def find_polydivisible(base: int) -> List[int]:
</syntaxhighlight>
 
The remaining portion of the program would remain the same.
 
 
 
==Related problems==
Line 373 ⟶ 362:
{{Divisor classes}}
 
[[Category:Articles with example Python (programming language) code]]
[[Category:Base-dependent integer sequences]]
[[Category:Modular arithmetic]]