Stirling numbers of the first kind: Difference between revisions
Stirling numbers of the first kind (view source)
Revision as of 20:13, 3 September 2023
, 9 months ago→{{header|Fōrmulæ}}
Line 570:
{{FormulaeEntry|page=https://formulae.org/?script=examples/Stirling_numbers_of_the_first_kind}}
'''Solution'''
A single solution for signed and unsigned versions is presented. Unsigned version uses 1 as factor, signed version used -1.
'''Version 1. Recursive'''
[[File:Fōrmulæ - Stirling numbers of the first kind 01.png]]
'''Test case 1. Show the unsigned Stirling numbers of the first kind, S₁(n, k), up to S₁(12, 12)'''
[[File:Fōrmulæ - Stirling numbers of the first kind 02.png]]
[[File:Fōrmulæ - Stirling numbers of the first kind 03.png]]
'''Test case 2. Show the signed Stirling numbers of the first kind, S₁(n, k), up to S₁(12, 12)'''
[[File:Fōrmulæ - Stirling numbers of the first kind 04.png]]
[[File:Fōrmulæ - Stirling numbers of the first kind 05.png]]
'''Version 2. Non recursive'''
A faster, non recursive version is presented. This construct a matrix.
[[File:Fōrmulæ - Stirling numbers of the first kind 06.png]]
'''Test case 1. Show the unsigned Stirling numbers of the first kind, S₁(n, k), up to S₁(12, 12)'''
[[File:Fōrmulæ - Stirling numbers of the first kind 07.png]]
(the result is the same as recursive version)
'''Test case 2. Show the signed Stirling numbers of the first kind, S₁(n, k), up to S₁(12, 12)'''
[[File:Fōrmulæ - Stirling numbers of the first kind 08.png]]
(the result is the same as recursive version)
'''Test case 3. Find the maximum value of unsigned S₁(n, k) where n ≤ 100'''
[[File:Fōrmulæ - Stirling numbers of the first kind 09.png]]
[[File:Fōrmulæ - Stirling numbers of the first kind 10.png]]
(the result is the same as recursive version)
'''Test case 4. Find the maximum value of signed S₁(n, k) where n ≤ 100'''
[[File:Fōrmulæ - Stirling numbers of the first kind 11.png]]
[[File:Fōrmulæ - Stirling numbers of the first kind 12.png]]
=={{header|Go}}==
|