1 | <?php |
||
10 | class SequenceProvider |
||
11 | { |
||
12 | |||
13 | const EULER_ZIGZAG = [ |
||
14 | '1', // 0 |
||
15 | '1', // 1 |
||
16 | '1', // 2 |
||
17 | '2', // 3 |
||
18 | '5', // 4 |
||
19 | '16', // 5 |
||
20 | '61', // 6 |
||
21 | '272', // 7 |
||
22 | '1385', // 8 |
||
23 | '7936', // 9 |
||
24 | '50521', // 10 |
||
25 | '353792', // 11 |
||
26 | '2702765', // 12 |
||
27 | '22368256', // 13 |
||
28 | '199360981', // 14 |
||
29 | '1903757312', // 15 |
||
30 | '19391512145', // 16 |
||
31 | '209865342976', // 17 |
||
32 | '2404879675441', // 18 |
||
33 | '29088885112832', // 19 |
||
34 | '370371188237525', // 20 |
||
35 | '4951498053124096', // 21 |
||
36 | '69348874393137901', // 22 |
||
37 | '1015423886506852352', // 23 |
||
38 | '15514534163557086905', // 24 |
||
39 | '246921480190207983616', // 25 |
||
40 | '4087072509293123892361', // 26 |
||
41 | '70251601603943959887872', // 27 |
||
42 | '1252259641403629865468285', // 28 |
||
43 | '23119184187809597841473536', // 29 |
||
44 | '441543893249023104553682821', // 30 |
||
45 | '8713962757125169296170811392', // 31 |
||
46 | '177519391579539289436664789665', // 32 |
||
47 | '3729407703720529571097509625856', // 33 |
||
48 | '80723299235887898062168247453281', // 34 |
||
49 | '1798651693450888780071750349094912', // 35 |
||
50 | '41222060339517702122347079671259045', // 36 |
||
51 | '970982810785059112379399707952152576', // 37 |
||
52 | '23489580527043108252017828576198947741', // 38 |
||
53 | '583203324917310043943191641625494290432', // 39 |
||
54 | '14851150718114980017877156781405826684425', // 40 |
||
55 | '387635983772083031828014624002175135645696', // 41 |
||
56 | '10364622733519612119397957304745185976310201', // 42 |
||
57 | '283727921907431909304183316295787837183229952', // 43 |
||
58 | '7947579422597592703608040510088070619519273805', // 44 |
||
59 | '227681379129930886488600284336316164603920777216', // 45 |
||
60 | '6667537516685544977435028474773748197524107684661',// 46 |
||
61 | '199500252157859031027160499643195658166340757225472', |
||
62 | '6096278645568542158691685742876843153976539044435185', |
||
63 | '190169564657928428175235445073924928592047775873499136', |
||
64 | '6053285248188621896314383785111649088103498225146815121', |
||
65 | ]; |
||
66 | |||
67 | /** |
||
68 | * OEIS: A005408 |
||
69 | * |
||
70 | * @param $n |
||
71 | * |
||
72 | * @return DecimalInterface|NumberInterface |
||
73 | */ |
||
74 | public static function nthOddNumber($n) |
||
82 | |||
83 | /** |
||
84 | * OEIS: A005843 |
||
85 | * |
||
86 | * @param $n |
||
87 | * |
||
88 | * @return DecimalInterface|NumberInterface |
||
89 | */ |
||
90 | public static function nthEvenNumber($n) |
||
98 | |||
99 | /** |
||
100 | * @param $n |
||
101 | * |
||
102 | * @return DecimalInterface|NumberInterface |
||
103 | */ |
||
104 | public static function nthPowerNegativeOne($n) |
||
112 | |||
113 | /** |
||
114 | * @param $n |
||
115 | * |
||
116 | * @return DecimalInterface|NumberInterface |
||
117 | * @throws IntegrityConstraint |
||
118 | */ |
||
119 | public static function nthEulerZigzag($n) |
||
135 | |||
136 | public static function nthSecTanCoefSequence($n) |
||
145 | |||
146 | /** |
||
147 | * WARNING: This function is VERY unoptimized. Be careful of large m values. |
||
148 | * |
||
149 | * @param $n |
||
150 | * |
||
151 | * @return DecimalInterface|NumberInterface |
||
152 | */ |
||
153 | public static function nthBernoulliNumber($n) |
||
179 | |||
180 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: