Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3).
Navigation
Topics Help • Register • News • History • How to • Sequences statistics • Template prototypes

Difference between revisions of "Template:GFN factorization"

From Prime-Wiki
Jump to: navigation, search
m
m
Line 10: Line 10:
 
<nowiki>{{GFN factorization|Generalized Fermat number 2 1 7}}</nowiki> gives
 
<nowiki>{{GFN factorization|Generalized Fermat number 2 1 7}}</nowiki> gives
 
:{{GFN factorization|Generalized Fermat number 2 1 7}}
 
:{{GFN factorization|Generalized Fermat number 2 1 7}}
 
 
[[Category:Prime collections]]</noinclude><includeonly>{{#vardefine:facts|}}{{#arraydefine:GFNlist|{{GP|{{{1}}}|GFNFactors}}|/\n/}}{{#loop:i|0|{{#arraysize:GFNlist}}
 
[[Category:Prime collections]]</noinclude><includeonly>{{#vardefine:facts|}}{{#arraydefine:GFNlist|{{GP|{{{1}}}|GFNFactors}}|/\n/}}{{#loop:i|0|{{#arraysize:GFNlist}}
 
|<nowiki />
 
|<nowiki />
Line 17: Line 16:
 
-->{{#switch:{{#sub:{{#var:k}}|0|1}}
 
-->{{#switch:{{#sub:{{#var:k}}|0|1}}
 
|C|P={{#if:{{#var:n}}|{{#vardefine:facts|{{#var:facts}} * [http://factordb.com/index.php?id={{#var:n}} {{#var:k}}]}}|{{#vardefine:facts|{{#var:facts}} * {{#var:k}}}}}}
 
|C|P={{#if:{{#var:n}}|{{#vardefine:facts|{{#var:facts}} * [http://factordb.com/index.php?id={{#var:n}} {{#var:k}}]}}|{{#vardefine:facts|{{#var:facts}} * {{#var:k}}}}}}
|N={{#ifexist:GF Divisor {{Long number:{{#var:k}}-NS}} {{#var:n}}|{{#vardefine:factn|{{GP|GF Divisor {{Long number:{{#var:k}}-NS}} {{#var:n}}|GFNumber}}}}{{#vardefine:facts|{{#var:facts}} * {{Long number:{{#var:factn}}-NL}}<sub><{{Long number:{{#var:factn}}-DI}}></sub>}}}}
+
|N={{#ifexist:GF Divisor {{Long number:{{#var:k}}-NS}} {{#var:n}}|{{#vardefine:factn|{{GP|GF Divisor {{Long number:{{#var:k}}-NS}} {{#var:n}}|GFNumber}}}}{{#vardefine:facts|{{#var:facts}} * {{#ifeq:{{#sub:{{#var:factn}}|0|1}}|N|{{Long number:{{#var:factn}}-NL}}<sub><{{Long number:{{#var:factn}}-DI}}></sub>|{{#var:factn}}<sub><{{#len:{{#var:factn}}}}></sub>}}}}
 +
}}
 
|#default={{#if:{{#var:n}}|{{#ifexist:GF Divisor {{#var:k}} {{#var:n}}|{{#vardefine:factn|{{GP|GF Divisor {{#var:k}} {{#var:n}}|GFNumber}}}}{{#if:{{#var:factn}}|{{#ifeq:{{#sub:{{#var:factn}}|0|1}}|P|{{#vardefine:facts|{{#var:facts}} * P<sub><{{#sub:{{#var:factn}}|1}}></sub>}}|{{#vardefine:facts|{{#var:facts}} * {{#ifeq:{{#sub:{{#var:factn}}|0|1}}|N|{{Long number:{{#var:factn}}-NL}}|{{#var:factn}}}}{{#ifexpr:{{#len:{{#var:factn}}}}>9|<sub><{{#ifeq:{{#sub:{{#var:factn}}|0|1}}|N|{{Long number:{{#var:factn}}-DI}}|{{#len:{{#var:factn}}}}}}></sub>}}}}}}}}|{{#vardefine:facts|{{#var:facts}} * {{#var:k}}}}}}|{{#vardefine:facts|{{#var:facts}} * {{#var:k}}}}}}}}}}{{#vardefine:facts|{{#sub:{{#var:facts}}|2}}}}{{#var:facts}}</includeonly>
 
|#default={{#if:{{#var:n}}|{{#ifexist:GF Divisor {{#var:k}} {{#var:n}}|{{#vardefine:factn|{{GP|GF Divisor {{#var:k}} {{#var:n}}|GFNumber}}}}{{#if:{{#var:factn}}|{{#ifeq:{{#sub:{{#var:factn}}|0|1}}|P|{{#vardefine:facts|{{#var:facts}} * P<sub><{{#sub:{{#var:factn}}|1}}></sub>}}|{{#vardefine:facts|{{#var:facts}} * {{#ifeq:{{#sub:{{#var:factn}}|0|1}}|N|{{Long number:{{#var:factn}}-NL}}|{{#var:factn}}}}{{#ifexpr:{{#len:{{#var:factn}}}}>9|<sub><{{#ifeq:{{#sub:{{#var:factn}}|0|1}}|N|{{Long number:{{#var:factn}}-DI}}|{{#len:{{#var:factn}}}}}}></sub>}}}}}}}}|{{#vardefine:facts|{{#var:facts}} * {{#var:k}}}}}}|{{#vardefine:facts|{{#var:facts}} * {{#var:k}}}}}}}}}}{{#vardefine:facts|{{#sub:{{#var:facts}}|2}}}}{{#var:facts}}</includeonly>

Revision as of 13:20, 8 July 2021

Purpose

Explanations

Example

{{GFN factorization|Generalized Fermat number 2 1 38}} gives

6597069766657<13> * 2917004348489729<16>

{{GFN factorization|Generalized Fermat number 2 1 7}} gives

59649589127497217<17> * 5704689200685129054721<22>