This site is supported by donations to The OEIS Foundation.
Template:Number of prime factors (with multiplicity)
The {{number of prime factors (with multiplicity)}} arithmetic function template returns Omega(n), number of prime factors of n (with multiplicity) (big Omega(n)) of a nonzero integer, otherwise returns an error message.
Contents
Usage
- {{number of prime factors (with multiplicity)|a nonzero integer}}
or
- {{big Omega|a nonzero integer}}
Valid input
A nonzero integer less than 1031 2 = 1062961 (validation is done by the {{mpf}} arithmetic function template).
Examples
Examples with valid input (check with https://oeis.org/A001222/b001222.txt Table of n, Omega(n) for n = 1..100000)
Unfortunately, with the transclusion of {{Number of prime factors (with multiplicity)/doc}} via the {{documentation}} template the precious limited nesting levels of templates and/or parser functions were exhausted! :-( Check {{Number of prime factors (with multiplicity)/doc}} directly to see that all the tests are successful. Fortunately, by transcluding {{Number of prime factors (with multiplicity)/doc}} directly, borrowing the minimum code needed here from the {{documentation}} template, we manage to not exhaust the limit! :-)
Code Result {{number of prime factors (with multiplicity)|210^2}} 8 {{big Omega|210^2}} 8 {{big Omega|-28}} 3 {{big Omega|-5}} 1 {{big Omega|1}} 0 {{big Omega|7}} 1 {{big Omega|15}} 2 {{big Omega|27}} 3 {{big Omega|30}} 3 {{big Omega|111}} 2 {{big Omega|5^3 * 11^2}} 5 {{big Omega|2^5 * 3^3 * 5}} 9 {{big Omega|2^9 * 3^3}} 12 {{big Omega|37^2 + 8 * 37^2}} 4 {{big Omega|2^9 * (26 + 1)}} 12 {{big Omega|89 * 113}} 2 {{big Omega|79 * 79}} 2 {{big Omega|210^2}} 8 {{big Omega|233^2}} 2 {{big Omega|10000}} 8 {{big Omega|65535}} 4 {{big Omega|65536}} 16 {{big Omega|65537}} 1 {{big Omega|65539}} 1 {{big Omega|65540}} 5 {{big Omega|65541}} 3 {{big Omega|65542}} 2 {{big Omega|65543}} 1 {{big Omega|65547}} 3 {{big Omega|65549}} 3 {{big Omega|65551}} 1 {{big Omega|65553}} 2 {{big Omega|65557}} 1 {{big Omega|65559}} 4 {{big Omega|65561}} 2 {{big Omega|65563}} 1 {{big Omega|65567}} 2 {{big Omega|65569}} 4 {{big Omega|65571}} 3 {{big Omega|65573}} 2 {{big Omega|65577}} 2 {{big Omega|65579}} 1 {{big Omega|265535}} 3 {{big Omega|265536}} 9 {{big Omega|265537}} 2 {{big Omega|265539}} 2 {{big Omega|265540}} 6 {{big Omega|265541}} 1 {{big Omega|265542}} 3 {{big Omega|265543}} 1 {{big Omega|265547}} 1 {{big Omega|265549}} 2 {{big Omega|265551}} 4 {{big Omega|265553}} 2 {{big Omega|265557}} 4 {{big Omega|265559}} 3 {{big Omega|265561}} 1 {{big Omega|265563}} 4 {{big Omega|265567}} 1 {{big Omega|265569}} 2 {{big Omega|265571}} 1 {{big Omega|265573}} 3 {{big Omega|265577}} 3 {{big Omega|265579}} 1 {{big Omega|257}} 1 {{big Omega|97 * 211}} 2 {{big Omega|216 * 211}} 7 {{big Omega|1024 * 45}} 13 {{big Omega|97 * 257}} 2 {{big Omega|3^6 * 5^2}} 8 {{big Omega|3 * 5^5}} 6 {{big Omega|17^2 * 191}} 3 {{big Omega|5 * 7 * 13 * 29}} 4 {{big Omega|509^2}} 2 {{big Omega|965535}} 4 {{big Omega|965536}} 8 {{big Omega|965537}} 2 {{big Omega|965539}} 2 {{big Omega|965540}} 5 {{big Omega|965541}} 2 {{big Omega|965542}} 3 {{big Omega|965543}} 2 {{big Omega|965547}} 5 {{big Omega|965549}} 4 {{big Omega|965551}} 1 {{big Omega|965553}} 2 {{big Omega|965557}} 2 {{big Omega|965559}} 3 {{big Omega|965561}} 3 {{big Omega|965563}} 2 {{big Omega|965567}} 1 {{big Omega|965569}} 3 {{big Omega|965571}} 3 {{big Omega|965573}} 3 {{big Omega|965577}} 3 {{big Omega|965579}} 2 {{big Omega|997 * 1019}} 2 {{big Omega|1015943}} 2
Examples with invalid input (argument validation by {{big Omega}} is omitted to spare some precious limited nesting levels of templates and/or parser functions).
Code Result {{big Omega|0}} Expression error: Unrecognized word "strong". {{big Omega|1031^2}} Expression error: Unrecognized word "strong".
Code
<noinclude><!-- {{documentation}} --><!-- We can't use it here, the precious limited nesting levels of templates and/or parser functions get exhausted! So we just borrow the necessary code from it instead. --><div style="text-align: center; font-size: smaller;">The following [[Help:Documenting templates|documentation]] is located at [[Template:{{PAGENAME}}/doc]].</div>{{Template:{{PAGENAME}}/doc}}<!-- --></noinclude><includeonly>{{#expr: 0{{mpf| {{{1|1}}} |sep = + |key/val_sep = ^0 * }} }}</includeonly>
See also
- {{Number of distinct prime factors}} ({{little omega}}) arithmetic function template.
- {{Number of prime factors (with multiplicity)}} ({{big Omega}}) arithmetic function template.