Navigation
Topics Register • News • History • How to • Sequences statistics • Template prototypes

Template:Kbn

From Prime-Wiki
Revision as of 07:27, 28 September 2020 by Karbon (talk | contribs) (± added)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Display numbers of the form kbn±1 in text-mode.

Usage

This template uses one to four unnamed parameters which are defined as follows:

  • Only if the first parameter is + or ±, the '+'/'±'-value is displayed, otherwise the '-'-value of the number.

Three more parameters containing numbers/variables can be given and used as follows:

  • one parameter: the n-value is given and displays as 2n±1
  • two parameters: the k- and n-value are given and display as k•2n±1
  • three parameters: the k-, b- and n-value are given and display as kbn±1

Examples

  • one parameter: {{Kbn|123}}: 2123-1
  • two parameters: {{Kbn|3|123}}: 3•2123-1
  • three parameters: {{Kbn|3|5|123}}: 3•5123-1

With '+'-sign:

  • {{Kbn|+|123}}: 2123+1
  • {{Kbn|+|13|123}}: 13•2123+1
  • {{Kbn|+|3|5|123}}: 3•5123+1

With '±'-sign:

  • {{Kbn|±|123}}: 2123±1
  • {{Kbn|±|13|123}}: 13•2123±1
  • {{Kbn|±|3|5|123}}: 3•5123±1

Others:

  • To display only 10123+1, set the k-value to '1': {{Kbn|+|1|10|123}} (or {{Kbn|1|10|123}} to get 10123-1).

Also possible:

  • {{Kbn|2<sup>{{Vn}}</sup>}}: 22n-1
  • {{Kbn|k|b|n}}: kbn-1
  • {{Kbn|+|k|b|n}}: kbn+1
  • {{Kbn|1|b|n}}: bn-1
  • {{Kbn|+|(b-1)|b|n}}: (b-1)bn+1