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:NCu"
(new) |
(cat. Gen. -> Gen) |
||
Line 5: | Line 5: | ||
==Usage== | ==Usage== | ||
This templates uses one to three unnamed parameters which are defined as follows: | This templates uses one to three unnamed parameters which are defined as follows: | ||
− | *one parameter: the n-value is given and displays a [[Gen | + | *one parameter: the n-value is given and displays a [[Gen Cullen prime 2|Cullen prime]] {{Kbn|+|n|2|n}} |
*two parameters: | *two parameters: | ||
− | **if first parameter is a sign (+/-): displays a [[:category:Gen | + | **if first parameter is a sign (+/-): displays a [[:category:Gen Cullen prime P|Gen Cullen prime P]] {{Kbn|+|(n+1)|2|n}} or [[:category:Gen Cullen prime M|Gen Cullen prime M]] {{Kbn|+|(n-1)|2|n}} |
− | **if first parameter is a number: displays a [[Gen | + | **if first parameter is a number: displays a [[Gen Cullen prime]] {{Kbn|+|n|b|n}} |
− | *three parameters: displays a [[:category:Gen | + | *three parameters: displays a [[:category:Gen Cullen prime P|Gen Cullen prime P]] {{Kbn|+|(n+1)|b|n}} or [[:category:Gen Cullen prime M|Gen Cullen prime M]] {{Kbn|+|(n-1)|b|n}} |
==Examples== | ==Examples== | ||
Line 20: | Line 20: | ||
[[Category:Templates]]</noinclude><includeonly>{{#vardefine:args|0}}{{#if:{{{3|}}}|{{#vardefine:args|3}}|{{#if:{{{2|}}}|{{#vardefine:args|2}}|{{#vardefine:args|1}}}}}}{{#switch:{{#var:args}} | [[Category:Templates]]</noinclude><includeonly>{{#vardefine:args|0}}{{#if:{{{3|}}}|{{#vardefine:args|3}}|{{#if:{{{2|}}}|{{#vardefine:args|2}}|{{#vardefine:args|1}}}}}}{{#switch:{{#var:args}} | ||
− | |1=[[Gen | + | |1=[[Gen Cullen prime 2|Cullen {{Kbn|+|{{{1}}}|{{{1}}}}}]] |
− | |2={{#ifeq:{{{1}}}|+|[[Gen | + | |2={{#ifeq:{{{1}}}|+|[[Gen Cullen prime P 2|Near Cullen {{Kbn|+|{{#expr:{{{2}}}+1}}|{{{2}}}}}]]|{{#ifeq:{{{1}}}|-|[[Gen Cullen prime M 2|Near Cullen {{Kbn|+|{{#expr:{{{2}}}-1}}|{{{2}}}}}]]|[[Gen Cullen prime {{{1}}}|Gen Cullen {{Kbn|+|{{{2}}}|{{{1}}}|{{{2}}}}}]]}}}} |
− | |3={{#ifeq:{{{1}}}|+|[[Gen | + | |3={{#ifeq:{{{1}}}|+|[[Gen Cullen prime P {{{2}}}|Near Gen Cullen {{Kbn|+|{{#expr:{{{3}}}+1}}|{{{2}}}|{{{3}}}}}]]|[[Gen Cullen prime M {{{2}}}|Near Gen Cullen {{Kbn|+|{{#expr:{{{3}}}-1}}|{{{2}}}|{{{3}}}}}]]}}}}</includeonly> |
Revision as of 15:06, 2 November 2020
Purpose
Displays (Gen./Near) Cullen numbers with link to the page.
Usage
This templates uses one to three unnamed parameters which are defined as follows:
- one parameter: the n-value is given and displays a Cullen prime n•2n+1
- two parameters:
- if first parameter is a sign (+/-): displays a Gen Cullen prime P (n+1)•2n+1 or Gen Cullen prime M (n-1)•2n+1
- if first parameter is a number: displays a Gen Cullen prime n•bn+1
- three parameters: displays a Gen Cullen prime P (n+1)•bn+1 or Gen Cullen prime M (n-1)•bn+1
Examples
{{NCu|123}}
: Cullen 123•2123+1{{NCu|+|123}}
: Near Cullen 124•2123+1{{NCu|-|123}}
: Near Cullen 122•2123+1{{NCu|3|123}}
: Cullen 123•3123+1{{NCu|+|3|123}}
: Near Cullen 124•3123+1{{NCu|-|3|123}}
: Near Cullen 122•3123+1