8fe2f56fae4f4f8ae287b41d6da14319
2020.45
stackexchange.com
8fe2f56fae4f4f8ae287b41d6da14319

It appears a lot of people had this nightly build at some point, but I am unable to find the download anywhere, as it was nightly it seems undocumented. In need of the Vertex Alpha support they added to it, without updating to 2.8 just for this would be ideal.



[Where can I obtain Blender 2.79c](/questions/151099/where-can-i-obtain-blender-2-79c)
======================================================================================


stackexchange.com
2020.45

From Blender's web [page](https://www.blender.org/download/previous-versions/):



> 
> Download latest builds from the 2.7 series
> 
> 
> * Blender 2.79b is the last bugfix release in the 2.7 series.
> * The [last Blender 2.79 nightly build](https://download.blender.org/release/Blender2.79/latest/) includes additional bug fixes and new
>  features on top of 2.79b, which are part of 2.80 too.
> 
> 
> 


So, I suppose this is the last nightly build: <https://download.blender.org/release/Blender2.79/latest/> 




There have never been a release with that version.


This is a list with all the tags in git (git tag --list):



```
2.72b
Studio_1.25
Studio_1.26
Studio_1.27
Studio_1.28
v2.25
v2.26
v2.27
v2.28
v2.28a
v2.28c
v2.30
v2.31
v2.31a
v2.32
v2.33
v2.33a
v2.34
v2.35
v2.35a
v2.36
v2.37
v2.37a
v2.40
v2.41
v2.42
v2.42a
v2.43
v2.44
v2.45
v2.46
v2.47
v2.48
v2.48a
v2.49
v2.49a
v2.49b
v2.50
v2.51
v2.52
v2.53
v2.54
v2.55
v2.56
v2.56a
v2.57
v2.57a
v2.57b
v2.58
v2.58a
v2.59
v2.60
v2.60a
v2.61
v2.63
v2.63a
v2.64
v2.64a
v2.65
v2.65a
v2.66
v2.66a
v2.67
v2.67a
v2.67b
v2.68
v2.68a
v2.69
v2.70
v2.70-rc
v2.70-rc2
v2.70a
v2.71
v2.71-rc1
v2.71-rc2
v2.72
v2.72-rc1
v2.72a
v2.72b
v2.73
v2.73-rc1
v2.73a
v2.74
v2.74-rc1
v2.74-rc2
v2.74-rc3
v2.74-rc4
v2.75
v2.75-rc1
v2.75-rc2
v2.75a
v2.76
v2.76-rc1
v2.76-rc2
v2.76-rc3
v2.76a
v2.76b
v2.77
v2.77-rc1
v2.77-rc2
v2.77a
v2.78
v2.78-rc1
v2.78-rc2
v2.78a
v2.78b
v2.78c
v2.79
v2.79-rc1
v2.79-rc2
v2.79a
v2.79b
v2.80
v2.80-rc1
v2.80-rc2
v2.80-rc3

```


1f50ecdbcbc9978ec2d71e40274e87dc
2021.04
stackexchange.com
1f50ecdbcbc9978ec2d71e40274e87dc

There is a application with a very slow query (listed below), and I have to optimize to run faster. The truth is that I don't know where to start. Any help? Thanks!



```
SELECT DISTINCT v.order_ANC,
                v.order_ANC2,
                f.codi_arxiu,
                f.nom_arxiu,
                f.codi_grup,
                f.codi_fons_refe,
                f.codi_fons,
                f.nom_fons,
                f.any_ini,
                f.any_fi,
                f.cronologia,
                SUM (num_uni_imatges) AS num_uni_imatges,
                SUM (unitats_text) AS unitats_text,
                SUM (unitats_notext) AS unitats_notext
  FROM (  SELECT f.codi_arxiu,
                 f.nom_arxiu,
                 f.codi_grup,
                 f.codi_fons_refe,
                 f.codi_fons,
                 f.nom_fons,
                 f.any_ini,
                 f.any_fi,
                 f.cronologia,
                 SUM (CASE WHEN u.num_imatges > 0 THEN 1 ELSE 0 END) AS num_uni_imatges,
                 COUNT (u.codi_unitat) AS unitats_text,
                 0 AS unitats_notext
            FROM ianc_fons f
            JOIN ianc_unicat u ON ( f.codi_arxiu = u.codi_arxiu AND f.codi_fons = u.codi_fons )
           WHERE     1 = 1
                 AND u.anc_unicat_id IN
                        (SELECT DISTINCT u.anc_unicat_id
                           FROM ianc_unicat u
                          WHERE     1 = 1
                                AND u.codi_arxiu = '1'
                                AND u.codi_grup = 'ANC'
                                AND u.codi_fons = 1)
        GROUP BY f.codi_arxiu,
                 f.nom_arxiu,
                 f.codi_grup,
                 f.codi_fons_refe,
                 f.codi_fons,
                 f.nom_fons,
                 f.any_ini,
                 f.any_fi,
                 f.cronologia
        UNION
          SELECT f.codi_arxiu,
                 f.nom_arxiu,
                 f.codi_grup,
                 f.codi_fons_refe,
                 f.codi_fons,
                 f.nom_fons,
                 f.any_ini,
                 f.any_fi,
                 f.cronologia,
                 SUM (CASE WHEN u.num_imatges > 0 THEN 1 ELSE 0 END) AS num_uni_imatges,
                 0 AS unitats_text,
                 COUNT (u.nt1_unitat) AS unitats_notext
            FROM ianc_fons f
            JOIN ianci_unicats u ON (     f.codi_arxiu = u.nt1_codi_arxiu
                                      AND f.codi_fons = u.nt1_codi_fons )
           WHERE     1 = 1
                 AND u.nt1_id IN
                        (SELECT DISTINCT u.nt1_id
                           FROM ianci_unicats u
                          WHERE     1 = 1
                                AND u.nt1_codi_arxiu = '1'
                                AND u.codi_grup = 'ANC'
                                AND u.nt1_codi_fons = 1)
        GROUP BY f.codi_arxiu,
                 f.nom_arxiu,
                 f.codi_grup,
                 f.codi_fons_refe,
                 f.codi_fons,
                 f.nom_fons,
                 f.any_ini,
                 f.any_fi,
                 f.cronologia
       ) AS f
LEFT JOIN v_ianc_arxius_order v ON ( f.codi_arxiu=v.codi_arxiu )
GROUP BY v.order_ANC,v.order_ANC2,f.codi_arxiu, f.nom_arxiu, f.codi_grup, f.codi_fons_refe,
         f.codi_fons, f.nom_fons, f.any_ini,  f.any_fi, f.cronologia
ORDER BY v.order_ANC,v.order_ANC2,f.nom_arxiu, f.nom_fons

```


[Optimize slow SQL query](/questions/2843/optimize-slow-sql-query)
==================================================================


stackexchange.com
2021.04

I suspect one bottleneck is the grouping in the subqueries. For each row in the `ianc_fons` table the rows are being duplicated - one for each join the chile table `ianc_unicat`. And then they are being grouped again.


I would try a different approach and move the summing into a joined subquery :



```
SELECT f.codi_arxiu,
       f.nom_arxiu,
       f.codi_grup,
       f.codi_fons_refe,
       f.codi_fons,
       f.nom_fons,
       f.any_ini,
       f.any_fi,
       f.cronologia,
       child.num_uni_imatges,
       child.unitats_text
 FROM ianc_fons f
 LEFT JOIN
      ( SELECT codi_arxiu, codi_fons,
               SUM (CASE WHEN u.num_imatges > 0 THEN 1 ELSE 0 END) AS num_uni_imatges,
               COUNT (u.codi_unitat) AS unitats_text
      FROM ianc_unicat u 
      WHERE u.anc_unicat_id IN
                    (SELECT u.anc_unicat_id
                       FROM ianc_unicat u
                      WHERE     1 = 1
                            AND u.codi_arxiu = '1'
                            AND u.codi_grup = 'ANC'
                            AND u.codi_fons = 1)
      GROUP BY codi_arxiu, codi_fons
      ) AS child ON f.codi_arxiu = child.codi_arxiu AND f.codi_fons = child.codi_fons

```

Note I have removed the DISTINCT from the Select from `ianc_unicat`. As this is just used in the filtering, the DISTINCT is not necessary. Using DISTINCT is always an overhead as the query engine needs to sort the records and then compare them all one by one to remove duplicates. Avoid as much as possible.


Each side of the `UNION` is selecting from the same table, and then summing different child records.


As the summing is now in a separate joined subquery, you can get rid of the union, and just join in the other table in a similar fashion. The Select will now need to sum up the totals from both joined subqueries.



```
SELECT f.codi_arxiu,
       f.nom_arxiu,
       f.codi_grup,
       f.codi_fons_refe,
       f.codi_fons,
       f.nom_fons,
       f.any_ini,
       f.any_fi,
       f.cronologia,
       COALESCE(child.num_uni_imatges, 0) + COALESCE(child2.num_uni_imatges, 0) AS num_uni_imatges,
       child.unitats_text,
       child2.unitats_notext

```

Note the use of COALESCE. As you are left joining these totals now, there is a chance that the values may be Null. Null is not the same as 0. Null + 4 would not equal 4, the result would be Null. So the COALESCE is necessary to make Null values 0.


Now you no longer need the outer select as this was being used to just sum the rows within the union. You can get rid of this all together. The row joined in to the outer query can just be joined into our main query. We no longer the the extra grouping here either. This gives us a query similar to the following :



```
SELECT f.codi_arxiu,
       f.nom_arxiu,
       f.codi_grup,
       f.codi_fons_refe,
       f.codi_fons,
       f.nom_fons,
       f.any_ini,
       f.any_fi,
       f.cronologia,
       COALESCE(child.num_uni_imatges, 0) + COALESCE(child2.num_uni_imatges, 0) AS num_uni_imatges,
       child.unitats_text,
       child2.unitats_notext
 FROM ianc_fons f
 LEFT JOIN
      ( SELECT codi_arxiu, codi_fons,
               SUM (CASE WHEN u.num_imatges > 0 THEN 1 ELSE 0 END) AS num_uni_imatges,
               COUNT (u.codi_unitat) AS unitats_text
      FROM ianc_unicat u 
      WHERE u.anc_unicat_id IN
                    (SELECT u.anc_unicat_id
                       FROM ianc_unicat u
                      WHERE     1 = 1
                            AND u.codi_arxiu = '1'
                            AND u.codi_grup = 'ANC'
                            AND u.codi_fons = 1)
      GROUP BY codi_arxiu, codi_fons
      ) AS child ON f.codi_arxiu = child.codi_arxiu AND f.codi_fons = child.codi_fons

 LEFT JOIN 
      ( SELECT u.nt1_codi_arxiu, u.codi_fons,
               SUM (CASE WHEN u.num_imatges > 0 THEN 1 ELSE 0 END) AS num_uni_imatges,
               COUNT (u.nt1_unitat) AS unitats_notext
        FROM ianci_unicats u 
       WHERE     1 = 1
             AND u.nt1_id IN
                    (SELECT u.nt1_id
                       FROM ianci_unicats u
                        WHERE     1 = 1
                            AND u.nt1_codi_arxiu = '1'
                            AND u.codi_grup = 'ANC'
                            AND u.nt1_codi_fons = 1)
      ) AS child2 ON f.codi_arxiu = child2.nt1_codi_arxiu AND f.codi_fons = child2.nt1_codi_fons

  LEFT JOIN v_ianc_arxius_order v ON ( f.codi_arxiu=v.codi_arxiu )
  ORDER BY v.order_ANC,v.order_ANC2,f.nom_arxiu, f.nom_fons

```



Optimising an SQL statement generally involves two phases: Understanding how the DBMS has chosen to execute the query in terms of index lookup and join order (called the query plan), and figuring out a way to write a query that gets the same effect, but that the DBMS finds a better query plan for.


Forcing the DBMS to choose a better query plan can be as simple as forcing a different index choice (overriding an automatic but non-optimal choice of index), adding a missing index or overriding the optimiser's choice of table join ordering. Or you might find a completely different way of expressing the same logical query, for example by using a join rather than `WHERE column IN (SELECT ...)`. Overriding the optimiser usually requires special syntax that is specific to your SQL product (SQL Server, in this case) that should be explained in the manuals somewhere.


In your case, your first step should probably be to get a better insight into exactly why this query is slow. You can do this to a limited extent by removing some clauses from the query and seeing whether it gets immediately quicker; perhaps removing the `ORDER BY` clause or removing `JOIN` clauses.


If it's available, then a more powerful option is to use whatever analysis tools are provided with your DBMS, or available as third party tools. I don't know SQL server specifically, but I'm sure there's a tool that will show you the query plan for any given query, and ideally give some insight into why the optimiser chose that query plan over other possibilities.



ad23dac27f5b0e9b90da949725910b1f
2021.17
stackexchange.com
ad23dac27f5b0e9b90da949725910b1f

I have non-stationary time series. It has evident trend in means and seasonality. These raw data are measured every second. On the plot of original series I see trend and seasonality about 80,81 (after each 80 second we can see new growth). It is possible that I will never obtain model with white noise? I have tried first difference and first seasonal difference on 80 and second seasonal difference with 81 pediod, and twice of 81. And stiil I have regular data in residuals! It is possible??


I have used R. I have tried different ways: step-by-step, ARIMA with different settings for differences, auto.arima. I do not know why I cannot receive white noise in the residuals. I look on ACF of residuals.


Has the task got solution?


Below I present my data.



```
3785
4542
4542
4542
4542
4542
4542
4542
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
4731
5772
8043
8516
8516
8516
8516
8516
8516
8516
8516
8516
8516
8516
8516
8516
8516
8516
8705
8705
8705
8705
8705
8705
8705
8705
8705
8705
8800
8800
8800
8800
8800
8800
8800
8800
8800
8800
8800
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
8989
10314
12585
13058
13058
13058
13058
13058
13058
13058
13058
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
13247
14288
16843
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17032
17316
17316
17316
17316
17316
17316
17316
17316
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
17505
18073
21101
21290
21290
21290
21290
21290
21290
21290
21290
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21574
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
21763
25359
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25548
25832
25832
25832
25832
25832
25832
25832
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
26021
29333
30090
30090
30090
30090
30090
30090
30090
30090
30090
30090
30090
30090
30090
30090
30090
30090
30279
30279
30279

```


[ARIMA with difficult seasonality in R](/questions/80710/arima-with-difficult-seasonality-in-r)
===============================================================================================


stackexchange.com
2021.17

I'm not sure if ARIMA would be able to decompose the data into interprettable/decomposed time series. 


I used [Proc UCM](http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#etsug_ucm_sect006.htm) in SAS which is a state space model. Following is the code of a basic structural model. The data is decomposed into Trend (level+slope) + Seasonal and White noise (Irregular). There is not much white noise left after you model. I'm assuming this is what you were looking for. The model fits the data like a glove. If you have access to SAS, you can try running the following code, you can get the decomposed series.


Level + Slope+ Seasonal + Irregular (not Shown).


![enter image description here](https://i.stack.imgur.com/1dyFK.png)


![Forecast Output which is comination of level+slope+season:](https://i.stack.imgur.com/j23yi.png)


![enter image description here](https://i.stack.imgur.com/UglD2.png)


You could also try `STL decomposition` in R.


ods graphics on;
 proc ucm data = data;



```
      id date interval = second; 
      model value;
      irregular plot = smooth;
      level ;
      slope variance = 0 noest;
      season length = 80 ;
       dep lags = 2;
      forecast plot=(forecasts decomp) lead = 80 outfor=forecast; 
   run ; 
ods graphics off ;

```

Hope this is helpful.



60f4d1f4f17dfa2d5a97e5db15ba89d3
2020.10
stackexchange.com
60f4d1f4f17dfa2d5a97e5db15ba89d3

I have a question about the A440 standard (A = 440 Hz) - does it really affect every single modern soundtrack? 


How can I tell if an audio track has been made using the A440 Standard / 440Hz (as opposed to e.g. A = 432Hz)?



[How to tell if an audio track follows A440 standard?](/questions/44166/how-to-tell-if-an-audio-track-follows-a440-standard)
============================================================================================================================


stackexchange.com
2020.10

There is no 100% certain way to determine which equal-tempered scale standard was used as tuning basis for a song. However the vast majority is A440. Many electronic instruments don't really give you any choice.


However you ask how to determine it. You'll need to do a spectrum analysis and sum up the energy around the fundamental frequencies of the scales. The largest sum indicates that the given scale was used.


Below is a chart of frequencies in Hertz (Hz) for equal-tempered scale standards A432, A434, A436, A438, A440, A442, A444, A446:



```
┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
│   Note    │  A432   │  A434   │  A436   │  A438   │  A440   │  A442   │  A444   │  A446   │
├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ C0        │   16.05 │   16.13 │   16.20 │   16.28 │   16.35 │   16.43 │   16.50 │   16.57 │
│  C#0/Db0  │   17.01 │   17.09 │   17.17 │   17.25 │   17.32 │   17.40 │   17.48 │   17.56 │
│ D0        │   18.02 │   18.10 │   18.19 │   18.27 │   18.35 │   18.44 │   18.52 │   18.60 │
│  D#0/Eb0  │   19.09 │   19.18 │   19.27 │   19.36 │   19.45 │   19.53 │   19.62 │   19.71 │
│ E0        │   20.23 │   20.32 │   20.41 │   20.51 │   20.60 │   20.70 │   20.79 │   20.88 │
│ F0        │   21.43 │   21.53 │   21.63 │   21.73 │   21.83 │   21.93 │   22.03 │   22.12 │
│  F#0/Gb0  │   22.70 │   22.81 │   22.91 │   23.02 │   23.12 │   23.23 │   23.33 │   23.44 │
│ G0        │   24.05 │   24.17 │   24.28 │   24.39 │   24.50 │   24.61 │   24.72 │   24.83 │
│  G#0/Ab0  │   25.48 │   25.60 │   25.72 │   25.84 │   25.96 │   26.07 │   26.19 │   26.31 │
│ A0        │   27.00 │   27.12 │   27.25 │   27.38 │   27.50 │   27.62 │   27.75 │   27.88 │
│  A#0/Bb0  │   28.61 │   28.74 │   28.87 │   29.00 │   29.14 │   29.27 │   29.40 │   29.53 │
│ B0        │   30.31 │   30.45 │   30.59 │   30.73 │   30.87 │   31.01 │   31.15 │   31.29 │
│ C1        │   32.11 │   32.26 │   32.41 │   32.55 │   32.70 │   32.85 │   33.00 │   33.15 │
│  C#1/Db1  │   34.02 │   34.18 │   34.33 │   34.49 │   34.65 │   34.81 │   34.96 │   35.12 │
│ D1        │   36.04 │   36.21 │   36.37 │   36.54 │   36.71 │   36.87 │   37.04 │   37.21 │
│  D#1/Eb1  │   38.18 │   38.36 │   38.54 │   38.71 │   38.89 │   39.07 │   39.24 │   39.42 │
│ E1        │   40.45 │   40.64 │   40.83 │   41.02 │   41.20 │   41.39 │   41.58 │   41.77 │
│ F1        │   42.86 │   43.06 │   43.26 │   43.46 │   43.65 │   43.85 │   44.05 │   44.25 │
│  F#1/Gb1  │   45.41 │   45.62 │   45.83 │   46.04 │   46.25 │   46.46 │   46.67 │   46.88 │
│ G1        │   48.11 │   48.33 │   48.55 │   48.78 │   49.00 │   49.22 │   49.44 │   49.67 │
│  G#1/Ab1  │   50.97 │   51.21 │   51.44 │   51.68 │   51.91 │   52.15 │   52.39 │   52.62 │
│ A1        │   54.00 │   54.25 │   54.50 │   54.75 │   55.00 │   55.25 │   55.50 │   55.75 │
│  A#1/Bb1  │   57.21 │   57.48 │   57.74 │   58.01 │   58.27 │   58.54 │   58.80 │   59.07 │
│ B1        │   60.61 │   60.89 │   61.17 │   61.45 │   61.74 │   62.02 │   62.30 │   62.58 │
│ C2        │   64.22 │   64.51 │   64.81 │   65.11 │   65.41 │   65.70 │   66.00 │   66.30 │
│  C#2/Db2  │   68.04 │   68.35 │   68.67 │   68.98 │   69.30 │   69.61 │   69.93 │   70.24 │
│ D2        │   72.08 │   72.42 │   72.75 │   73.08 │   73.42 │   73.75 │   74.08 │   74.42 │
│  D#2/Eb2  │   76.37 │   76.72 │   77.07 │   77.43 │   77.78 │   78.14 │   78.49 │   78.84 │
│ E2        │   80.91 │   81.28 │   81.66 │   82.03 │   82.41 │   82.78 │   83.16 │   83.53 │
│ F2        │   85.72 │   86.12 │   86.51 │   86.91 │   87.31 │   87.70 │   88.10 │   88.50 │
│  F#2/Gb2  │   90.82 │   91.24 │   91.66 │   92.08 │   92.50 │   92.92 │   93.34 │   93.76 │
│ G2        │   96.22 │   96.66 │   97.11 │   97.55 │   98.00 │   98.44 │   98.89 │   99.34 │
│  G#2/Ab2  │  101.94 │  102.41 │  102.88 │  103.35 │  103.83 │  104.30 │  104.77 │  105.24 │
│ A2        │  108.00 │  108.50 │  109.00 │  109.50 │  110.00 │  110.50 │  111.00 │  111.50 │
│  A#2/Bb2  │  114.42 │  114.95 │  115.48 │  116.01 │  116.54 │  117.07 │  117.60 │  118.13 │
│ B2        │  121.23 │  121.79 │  122.35 │  122.91 │  123.47 │  124.03 │  124.59 │  125.15 │
│ C3        │  128.43 │  129.03 │  129.62 │  130.22 │  130.81 │  131.41 │  132.00 │  132.60 │
│  C#3/Db3  │  136.07 │  136.70 │  137.33 │  137.96 │  138.59 │  139.22 │  139.85 │  140.48 │
│ D3        │  144.16 │  144.83 │  145.50 │  146.16 │  146.83 │  147.50 │  148.17 │  148.83 │
│  D#3/Eb3  │  152.74 │  153.44 │  154.15 │  154.86 │  155.56 │  156.27 │  156.98 │  157.68 │
│ E3        │  161.82 │  162.57 │  163.32 │  164.06 │  164.81 │  165.56 │  166.31 │  167.06 │
│ F3        │  171.44 │  172.23 │  173.03 │  173.82 │  174.61 │  175.41 │  176.20 │  177.00 │
│  F#3/Gb3  │  181.63 │  182.47 │  183.32 │  184.16 │  185.00 │  185.84 │  186.68 │  187.52 │
│ G3        │  192.43 │  193.32 │  194.22 │  195.11 │  196.00 │  196.89 │  197.78 │  198.67 │
│  G#3/Ab3  │  203.88 │  204.82 │  205.76 │  206.71 │  207.65 │  208.60 │  209.54 │  210.48 │
│ A3        │  216.00 │  217.00 │  218.00 │  219.00 │  220.00 │  221.00 │  222.00 │  223.00 │
│  A#3/Bb3  │  228.84 │  229.90 │  230.96 │  232.02 │  233.08 │  234.14 │  235.20 │  236.26 │
│ B3        │  242.45 │  243.57 │  244.70 │  245.82 │  246.94 │  248.06 │  249.19 │  250.31 │
│ C4        │  256.87 │  258.06 │  259.25 │  260.44 │  261.63 │  262.81 │  264.00 │  265.19 │
│  C#4/Db4  │  272.14 │  273.40 │  274.66 │  275.92 │  277.18 │  278.44 │  279.70 │  280.96 │
│ D4        │  288.33 │  289.66 │  290.99 │  292.33 │  293.66 │  295.00 │  296.33 │  297.67 │
│  D#4/Eb4  │  305.47 │  306.88 │  308.30 │  309.71 │  311.13 │  312.54 │  313.96 │  315.37 │
│ E4        │  323.63 │  325.13 │  326.63 │  328.13 │  329.63 │  331.13 │  332.62 │  334.12 │
│ F4        │  342.88 │  344.47 │  346.05 │  347.64 │  349.23 │  350.82 │  352.40 │  353.99 │
│  F#4/Gb4  │  363.27 │  364.95 │  366.63 │  368.31 │  369.99 │  371.68 │  373.36 │  375.04 │
│ G4        │  384.87 │  386.65 │  388.43 │  390.21 │  392.00 │  393.78 │  395.56 │  397.34 │
│  G#4/Ab4  │  407.75 │  409.64 │  411.53 │  413.42 │  415.30 │  417.19 │  419.08 │  420.97 │
│ A4        │  432.00 │  434.00 │  436.00 │  438.00 │  440.00 │  442.00 │  444.00 │  446.00 │
│  A#4/Bb4  │  457.69 │  459.81 │  461.93 │  464.04 │  466.16 │  468.28 │  470.40 │  472.52 │
│ B4        │  484.90 │  487.15 │  489.39 │  491.64 │  493.88 │  496.13 │  498.37 │  500.62 │
│ C5        │  513.74 │  516.12 │  518.49 │  520.87 │  523.25 │  525.63 │  528.01 │  530.39 │
│  C#5/Db5  │  544.29 │  546.81 │  549.33 │  551.85 │  554.37 │  556.88 │  559.40 │  561.92 │
│ D5        │  576.65 │  579.32 │  581.99 │  584.66 │  587.33 │  590.00 │  592.67 │  595.34 │
│  D#5/Eb5  │  610.94 │  613.77 │  616.60 │  619.43 │  622.25 │  625.08 │  627.91 │  630.74 │
│ E5        │  647.27 │  650.27 │  653.26 │  656.26 │  659.25 │  662.25 │  665.25 │  668.24 │
│ F5        │  685.76 │  688.93 │  692.11 │  695.28 │  698.46 │  701.63 │  704.81 │  707.98 │
│  F#5/Gb5  │  726.53 │  729.90 │  733.26 │  736.63 │  739.99 │  743.35 │  746.72 │  750.08 │
│ G5        │  769.74 │  773.30 │  776.86 │  780.43 │  783.99 │  787.55 │  791.12 │  794.68 │
│  G#5/Ab5  │  815.51 │  819.28 │  823.06 │  826.83 │  830.61 │  834.38 │  838.16 │  841.94 │
│ A5        │  864.00 │  868.00 │  872.00 │  876.00 │  880.00 │  884.00 │  888.00 │  892.00 │
│  A#5/Bb5  │  915.38 │  919.61 │  923.85 │  928.09 │  932.33 │  936.57 │  940.80 │  945.04 │
│ B5        │  969.81 │  974.30 │  978.79 │  983.28 │  987.77 │  992.26 │  996.75 │ 1001.24 │
│ C6        │ 1027.47 │ 1032.23 │ 1036.99 │ 1041.74 │ 1046.50 │ 1051.26 │ 1056.02 │ 1060.77 │
│  C#6/Db6  │ 1088.57 │ 1093.61 │ 1098.65 │ 1103.69 │ 1108.73 │ 1113.77 │ 1118.81 │ 1123.85 │
│ D6        │ 1153.30 │ 1158.64 │ 1163.98 │ 1169.32 │ 1174.66 │ 1180.00 │ 1185.34 │ 1190.68 │
│  D#6/Eb6  │ 1221.88 │ 1227.54 │ 1233.19 │ 1238.85 │ 1244.51 │ 1250.16 │ 1255.82 │ 1261.48 │
│ E6        │ 1294.54 │ 1300.53 │ 1306.52 │ 1312.52 │ 1318.51 │ 1324.50 │ 1330.50 │ 1336.49 │
│ F6        │ 1371.51 │ 1377.86 │ 1384.21 │ 1390.56 │ 1396.91 │ 1403.26 │ 1409.61 │ 1415.96 │
│  F#6/Gb6  │ 1453.07 │ 1459.80 │ 1466.52 │ 1473.25 │ 1479.98 │ 1486.70 │ 1493.43 │ 1500.16 │
│ G6        │ 1539.47 │ 1546.60 │ 1553.73 │ 1560.85 │ 1567.98 │ 1575.11 │ 1582.24 │ 1589.36 │
│  G#6/Ab6  │ 1631.01 │ 1638.57 │ 1646.12 │ 1653.67 │ 1661.22 │ 1668.77 │ 1676.32 │ 1683.87 │
│ A6        │ 1728.00 │ 1736.00 │ 1744.00 │ 1752.00 │ 1760.00 │ 1768.00 │ 1776.00 │ 1784.00 │
│  A#6/Bb6  │ 1830.75 │ 1839.23 │ 1847.70 │ 1856.18 │ 1864.66 │ 1873.13 │ 1881.61 │ 1890.08 │
│ B6        │ 1939.61 │ 1948.59 │ 1957.57 │ 1966.55 │ 1975.53 │ 1984.51 │ 1993.49 │ 2002.47 │
│ C7        │ 2054.95 │ 2064.46 │ 2073.98 │ 2083.49 │ 2093.00 │ 2102.52 │ 2112.03 │ 2121.54 │
│  C#7/Db7  │ 2177.14 │ 2187.22 │ 2197.30 │ 2207.38 │ 2217.46 │ 2227.54 │ 2237.62 │ 2247.70 │
│ D7        │ 2306.60 │ 2317.28 │ 2327.96 │ 2338.64 │ 2349.32 │ 2360.00 │ 2370.67 │ 2381.35 │
│  D#7/Eb7  │ 2443.76 │ 2455.07 │ 2466.39 │ 2477.70 │ 2489.02 │ 2500.33 │ 2511.64 │ 2522.96 │
│ E7        │ 2589.07 │ 2601.06 │ 2613.05 │ 2625.03 │ 2637.02 │ 2649.01 │ 2660.99 │ 2672.98 │
│ F7        │ 2743.03 │ 2755.73 │ 2768.43 │ 2781.13 │ 2793.83 │ 2806.52 │ 2819.22 │ 2831.92 │
│  F#7/Gb7  │ 2906.14 │ 2919.59 │ 2933.05 │ 2946.50 │ 2959.96 │ 2973.41 │ 2986.86 │ 3000.32 │
│ G7        │ 3078.95 │ 3093.20 │ 3107.45 │ 3121.71 │ 3135.96 │ 3150.22 │ 3164.47 │ 3178.73 │
│  G#7/Ab7  │ 3262.03 │ 3277.13 │ 3292.23 │ 3307.34 │ 3322.44 │ 3337.54 │ 3352.64 │ 3367.74 │
│ A7        │ 3456.00 │ 3472.00 │ 3488.00 │ 3504.00 │ 3520.00 │ 3536.00 │ 3552.00 │ 3568.00 │
│  A#7/Bb7  │ 3661.50 │ 3678.46 │ 3695.41 │ 3712.36 │ 3729.31 │ 3746.26 │ 3763.21 │ 3780.16 │
│ B7        │ 3879.23 │ 3897.19 │ 3915.15 │ 3933.11 │ 3951.07 │ 3969.03 │ 3986.99 │ 4004.95 │
│ C8        │ 4109.90 │ 4128.93 │ 4147.95 │ 4166.98 │ 4186.01 │ 4205.03 │ 4224.06 │ 4243.09 │
│  C#8/Db8  │ 4354.29 │ 4374.44 │ 4394.60 │ 4414.76 │ 4434.92 │ 4455.08 │ 4475.24 │ 4495.40 │
│ D8        │ 4613.21 │ 4634.56 │ 4655.92 │ 4677.28 │ 4698.63 │ 4719.99 │ 4741.35 │ 4762.71 │
│  D#8/Eb8  │ 4887.52 │ 4910.15 │ 4932.78 │ 4955.40 │ 4978.03 │ 5000.66 │ 5023.29 │ 5045.91 │
│ E8        │ 5178.15 │ 5202.12 │ 5226.09 │ 5250.07 │ 5274.04 │ 5298.01 │ 5321.99 │ 5345.96 │
│ F8        │ 5486.06 │ 5511.46 │ 5536.85 │ 5562.25 │ 5587.65 │ 5613.05 │ 5638.45 │ 5663.85 │
│  F#8/Gb8  │ 5812.28 │ 5839.18 │ 5866.09 │ 5893.00 │ 5919.91 │ 5946.82 │ 5973.73 │ 6000.64 │
│ G8        │ 6157.89 │ 6186.40 │ 6214.91 │ 6243.42 │ 6271.93 │ 6300.44 │ 6328.94 │ 6357.45 │
│  G#8/Ab8  │ 6524.06 │ 6554.26 │ 6584.47 │ 6614.67 │ 6644.88 │ 6675.08 │ 6705.28 │ 6735.49 │
│ A8        │ 6912.00 │ 6944.00 │ 6976.00 │ 7008.00 │ 7040.00 │ 7072.00 │ 7104.00 │ 7136.00 │
│  A#8/Bb8  │ 7323.01 │ 7356.91 │ 7390.81 │ 7424.72 │ 7458.62 │ 7492.52 │ 7526.43 │ 7560.33 │
│ B8        │ 7758.46 │ 7794.38 │ 7830.30 │ 7866.21 │ 7902.13 │ 7938.05 │ 7973.97 │ 8009.89 │
└───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

```

Source: <http://pages.mtu.edu/~suits/notefreq446.html>


(table above was made with excel and <https://ozh.github.io/ascii-tables/>)



f202095f69fe9ba99453ff5067969dba
2019.43
stackexchange.com
f202095f69fe9ba99453ff5067969dba

In the context of a microcontroller, I have much less memory and far less processing power. This means, I can only buffer a reasonable window of samples (e.g. 16 or 32), and may not be able to use more advanced curve-fitting options, such as [this one](http://terpconnect.umd.edu/~toh/spectrum/PeakFindingandMeasurement.htm).


This plot shows the raw data along with filtered output. The filter in this trial is a leaky-integrator, with alpha = 8.


![enter image description here](https://i.stack.imgur.com/YG263.png)


**How can I reliably detect that first peak (and trough) to enable the accumulation of the area shown?**


A cleaner trial of raw data (sampled every 50ms):



```
22279
22279
22267
22277
22277
22276
22279
22275
22276
22280
22279
22278
22277
22277
22280
22279
22280
22278
22279
22280
22274
22280
22274
22278
22275
22276
22277
22279
22276
22279
22280
22286
22278
22276
22280
22278
22284
22279
22280
22277
22279
22281
22274
22281
22274
22280
22283
22279
22277
22278
22282
22286
22276
22277
22276
22278
22277
22274
22281
22276
22279
22277
22277
22285
22273
22276
22281
22277
22285
22275
22283
22281
22281
22280
22275
22276
22272
22277
22284
22273
22280
22273
22278
22278
22274
22277
22272
22276
22282
22272
22273
22282
22280
22278
22280
22282
22283
22272
22273
22275
22281
22280
22278
22282
22282
22281
22278
22284
22280
22276
22280
22280
22280
22273
22274
22281
22279
22273
22280
22282
22279
22281
22282
22276
22277
22282
22280
22278
22278
22280
22277
22271
22279
22282
22282
22276
22275
22280
22272
22271
22281
22279
22283
22280
22280
22274
22277
22278
22282
22283
22274
22272
22275
22278
22280
22278
22278
22271
22279
22283
22281
22277
22282
22277
22275
22277
22277
22280
22281
22282
22282
22280
22280
22282
22279
22278
22279
22277
22283
22280
22279
22273
22278
22282
22279
22276
22279
22280
22275
22281
22279
22282
22283
22281
22278
22277
22282
22279
22281
22280
22281
22273
22280
22273
22277
22282
22292
22297
22314
22323
22334
22339
22332
22328
22321
22309
22305
22299
22299
22292
22290
22288
22278
22283
22277
22276
22272
22268
22264
22262
22259
22256
22249
22247
22246
22242
22236
22240
22239
22232
22230
22230
22226
22217
22218
22211
22216
22212
22210
22211
22209
22208
22201
22202
22195
22199
22191
22195
22195
22195
22191
22184
22183
22179
22172
22183
22183
22172
22180
22174
22176
22178
22177
22176
22177
22167
22172
22174
22167
22164
22169
22163
22164
22171
22164
22161
22171
22161
22161
22168
22164
22163
22167
22164
22155
22165
22159
22156
22161
22157
22156
22163
22160
22157
22163
22162
22163
22159
22162
22156
22160
22161
22156
22161
22154
22158
22159
22162
22162
22161
22158
22152
22163
22154
22160
22164
22156
22160
22162
22160
22155
22165
22157
22156
22162
22162
22167
22163
22162
22159
22161
22158
22162
22166
22158
22155
22157
22162
22162
22156
22160
22166
22158
22166
22167
22164
22165
22157
22160
22166
22166
22167
22165
22169
22169
22167
22169
22164
22167
22172
22171
22170
22169
22167
22171
22165
22169
22173
22169
22173
22175
22175
22175
22171
22168
22169
22175
22169
22173
22176
22176
22179
22176
22177
22177
22181
22177
22171
22181
22176
22177
22174
22180
22184
22179
22177
22174
22181
22183
22177
22181
22178
22184
22187
22182
22184
22184
22182
22184
22185
22185
22184
22187
22185
22185
22185
22190
22183
22192
22187
22188
22189
22188
22189
22189
22190
22194
22190
22194
22190
22192
22195
22193
22192
22195
22190
22192
22194
22193
22197
22198
22198
22194
22193
22196
22196
22199
22198
22199
22196
22199
22200
22202
22196
22196
22202
22198
22200
22203
22202
22204
22204
22201
22201
22200
22195
22206
22203
22199
22209
22207
22208
22207
22207
22205
22211
22208
22205
22207
22203
22205
22208
22209
22199
22209
22211
22206
22208
22210
22211
22210
22212
22211
22210
22213
22207
22213
22213
22213
22209
22211
22211
22215
22216
22218
22215
22218
22213
22217
22213
22217
22215
22219
22219
22215
22221
22211
22217
22220
22218
22221
22215
22217
22217
22217
22219
22218
22218
22220
22219
22221
22220
22220
22221
22224
22220
22224
22225
22224
22222
22222
22222
22221
22226
22220
22226
22222
22220
22225
22227
22224
22226
22225
22224
22223
22227
22227
22224
22227
22226
22226
22227
22227
22230
22230
22230
22228
22229
22228
22230
22229
22226
22231
22231
22228
22227
22230
22230
22231
22230
22230
22231
22227
22227
22233
22230
22231
22231
22231
22231
22238
22233
22234
22235
22233
22232
22233
22236
22233
22234
22236
22237
22234
22236
22237
22230
22235
22240
22234
22233
22239
22236
22239
22240
22233
22238
22234
22234
22234
22235
22238
22240
22236
22240
22237
22236
22236
22235
22241
22239
22234
22244
22237
22241
22242
22242
22240
22242
22242
22240
22239
22240
22243
22242
22240
22234
22238
22242
22240
22244
22241
22242
22242
22242
22241
22242
22241
22245
22242
22247
22244
22243
22242
22245
22246
22245
22238
22245
22244
22247
22246
22242
22248
22245
22244
22246
22246
22247
22246
22247
22247
22251
22247
22239
22250
22241
22246
22247
22249
22245
22252
22245
22247
22247
22248
22250
22246
22251
22248
22248
22245
22247
22249
22249
22249
22249
22245
22250
22248
22253
22241
22250
22251
22251
22252
22245
22250
22255
22252
22252
22253
22249
22253
22253
22251
22252
22251
22251
22252
22252
22251
22253
22254
22252
22258
22258
22249
22254
22256
22252
22249
22246
22255
22254
22254
22251
22255
22255
22252
22253
22254
22255
22257
22257
22254
22255
22255
22253
22257
22257
22253
22257
22257
22257
22250
22258
22254
22255
22255
22257
22256
22257
22252
22254
22254
22253
22257
22248
22260
22259
22259
22257
22259
22259
22259
22261
22261
22260
22260
22260
22260
22259
22259
22260
22261
22261
22261
22260
22259
22258
22262
22262
22263
22256
22256
22261
22259
22262
22259
22256
22256
22255
22263
22263
22264
22254
22254
22257
22261
22255
22262
22263
22263
22263
22258
22258
22259
22264
22264
22265
22262
22262
22261
22263
22263
22260
22258
22262
22256
22264
22264
22264
22260
22260
22264
22262
22262
22265
22260
22260
22259
22267
22267
22263
22264
22264
22264
22260
22260
22261
22258
22258
22267
22260
22260
22263
22267
22267
22259
22260
22260
22266
22264
22264
22259
22271
22271
22262
22261
22261
22268
22269
22269
22258
22263
22263
22262
22268
22268
22269
22263
22269
22269
22272
22272
22265
22264
22264
22268
22270
22270
22266
22261
22261
22265
22266
22272
22272
22270
22270
22263
22274
22274
22262
22266
22266
22271
22265
22265
22265
22267
22267
22269
22272
22272
22272
22272
22269
22268
22261
22261
22266
22266
22270
22271
22271
22270
22271
22265
22265
22271
22271
22264
22270
22270
22264
22272
22267
22267
22272
22272
22268
22271
22267
22271
22272
22264
22264
22269
22269
22268
22271
22267
22268
22270
22270
22267
22275
22274
22268
22275
22275
22271
22275
22265
22268
22274
22274
22268
22277
22267
22266
22275
22275
22269
22276
22276
22269
22276
22267
22267
22276
22269
22274
22273
22273
22271
22277
22277
22267
22274
22271
22271
22277
22271
22270
22280
22270
22270
22274
22274
22274
22276
22267
22271
22280
22272
22270
22275
22272
22272
22275
22271
22273
22278
22273
22273
22271
22279
22279
22270
22271
22279
22279
22271
22278
22278
22274
22274
22281
22275
22275
22273
22276
22275
22278
22275
22273
22274
22274
22274
22271
22274
22274
22271
22271
22276
22268
22274
22271
22271
22269
22274
22273
22275
22275
22271
22273
22273
22281
22273
22273
22273
22277
22277
22277
22272
22271
22271
22271
22275
22275
22277
22275
22277
22273
22273
22279
22273
22273
22272
22275
22275
22274
22276
22276
22277
22275
22275
22273
22275
22276
22276
22276
22273
22273
22276
22281
22281
22275
22276
22276
22278
22275
22275
22277
22271
22271
22280
22275
22275
22276
22277
22277
22271
22276
22276
22279
22275
22275
22278
22278
22278
22277
22277
22277
22277
22276
22276
22279
22274
22274
22278
22279
22279
22278
22279
22279
22277
22275
22275
22282
22279
22279
22276
22278
22278
22277
22276
22276
22276
22272
22276
22280
22276
22276
22279
22278
22280
22277
22280
22277
22282
22278
22268
22277
22283
22281
22278
22279
22279
22279
22281
22275
22275
22280
22277
22277
22276
22281
22280
22280
22277
22281
22281
22279
22280
22278
22282
22282
22281
22282
22282
22283
22280
22278
22278
22282
22275
22282
22280
22281
22274
22280
22280
22283
22279
22281
22281
22280
22282
22282
22274
22284
22284
22279
22279
22280
22284
22274
22274
22274
22281
22283
22274
22274
22280
22282
22284
22284
22277
22279
22279
22280
22276
22277
22285
22278
22281
22281
22276
22280
22280
22277
22282
22282
22283
22279
22277
22277
22276
22278
22276
22282
22282
22277
22277
22284
22283
22283
22283
22283
22283
22284
22278
22280
22279
22279
22279
22275
22279
22279
22284
22284
22283
22284
22279
22279
22285
22283
22280
22278
22278
22279
22280
22278
22276
22282
22281
22281
22276
22278
22278
22278
22278
22286
22286
22282
22280
22278
22278
22278
22278
22280
22280
22286
22286
22279
22279
22281
22281
22279
22278
22283
22281
22282
22282
22280
22280
22283
22280
22282
22282
22283
22283
22284
22284
22280
22280
22277
22277
22283
22283
22280
22284
22284
22284
22285
22285
22282
22283
22283
22278
22280
22280
22283
22281
22284
22283
22282
22282
22284
22285
22286
22282
22283
22284
22284
22285
22285
22281
22280
22281
22281
22283
22285
22285
22285
22282
22286
22284
22280
22282
22282
22281
22285
22283
22283
22286
22284
22284
22281
22281
22287
22284
22285
22284
22283
22282
22282
22282
22283
22284
22284
22287
22285
22285
22286
22286
22283
22285
22285
22285
22288
22284
22282
22283
22282
22286
22287
22285
22285
22284
22283
22286
22285
22285
22281
22276
22286
22286
22284
22285
22283
22290
22290
22288
22286
22285
22284
22284
22285
22285
22287
22285
22285
22286
22288
22287
22287
22285
22285
22285
22289
22289
22286
22286
22286
22286
22288
22288
22287
22286
22289
22287
22285
22285
22286
22286
22287
22287
22287
22288
22288
22281
22281
22290
22288
22288
22284
22283
22282
22283
22283
22282
22282
22288
22281
22284
22284
22284
22280
22281
22280
22280
22283
22290
22281
22281
22289
22285
22280
22286
22286
22284
22284
22286
22283
22280
22288
22287
22288
22280
22280
22282
22284
22284
22292
22289
22284
22284
22285
22286
22286
22283
22290
22284
22284
22283
22284
22285
22284
22284
22285
22283
22284
22285
22286
22286
22286
22286
22284
22284
22287
22285
22290
22283
22291
22283
22287
22284
22284
22285
22285
22286
22286
22285
22285
22285
22289
22286
22284
22284
22285
22283
22283
22286
22286
22288
22283
22283
22293
22283
22284
22286
22286
22285
22282
22286
22286
22283
22283
22285
22288
22292
22285
22285
22288
22288
22288
22285
22288
22287
22287
22288
22288
22285
22284
22284
22287
22288
22288
22290
22287
22285
22288
22286
22286
22286
22288
22288
22286
22286
22286
22286
22289
22289
22288
22286
22287
22287
22291
22291
22287
22289
22288
22288
22288
22291
22289
22285
22288
22284
22284
22290
22290
22288
22290
22286
22288
22291
22290
22286
22291
22289
22292
22290
22290
22286
22292
22286
22291
22289
22287
22292
22288
22291
22289
22288
22292
22294
22284
22286
22290
22289
22286
22290
22291
22287
22294
22297
22289
22289
22295
22283
22283
22291
22290
22290
22294
22288
22291
22300
22291
22288
22290
22288
22285
22289
22289
22284
22289
22290
22290
22290
22287
22284
22289
22285
22285
22293
22290
22287
22291
22291
22292
22293
22293
22287
22295
22295
22284
22293
22293
22289
22289
22294
22288
22288
22293
22285
22284
22293
22287
22294
22285
22285
22289
22293
22284
22292
22286
22288
22288
22294
22287
22295
22294
22284
22285
22293
22294
22285
22288
22291
22288
22283
22288
22288
22287
22295
22286
22287
22285
22286
22288
22292
22287
22285
22289
22286
22289
22287
22288
22291
22285
22286
22292
22287
22288
22290
22285
22288
22288
22290
22291
22287
22285
22286
22290
22287
22289
22285
22291
22287
22287
22289
22286
22286
22285
22286
22287
22290
22289
22290
22288
22292
22290
22288
22286
22288
22290
22288
22288
22289
22289
22286
22283
22288
22292
22292
22287
22288
22288
22288
22293
22291
22291
22286
22290
22290
22288
22288
22291
22291
22291
22292
22292
22294
22291
22291
22293
22289
22290
22294
22289
22293
22294
22290
22290
22291
22290
22293
22293
22281
22293
22289
22289
22293
22291
22285
22291
22292
22289
22293
22292
22292
22292
22293
22290
22286
22291
22291
22288
22293
22295
22285
22291
22289
22293
22286
22293
22291
22287
22290
22283
22291
22293
22290
22290
22293
22293
22294
22290
22291
22290
22294
22289
22294
22294
22294
22292
22295
22286
22289
22283
22289
22291
22284
22288
22288
22292
22286
22288
22288
22289
22294
22289
22287
22286
22296
22296
22286
22295
22290
22290
22288
22288
22288
22289
22289
22289
22288
22290
22287
22290
22290
22288
22293
22288
22296
22287
22289
22288
22289
22285
22292
22292
22292
22289
22290
22296
22288
22288
22290
22292
22292
22285
22289
22288
22288
22289
22290
22290
22291
22287
22287
22290
22290
22287
22289
22291
22289
22295
22290
22289
22290
22292
22292
22289
22290
22292
22289
22291
22290
22294
22294
22292
22292
22292
22288
22289
22291
22292
22292
22292
22290
22291
22291
22290

```


[How to detect peaks in a microcontroller?](/questions/20105/how-to-detect-peaks-in-a-microcontroller)
======================================================================================================


stackexchange.com
2019.43

It seems to me, more like a spike detection than a peak. For the simplest spike detector, just get the first difference of the input samples and test for a threshold. Use multiple samples and adjust your test to have some memory (as much as you can) so that noisy results be eliminated and you would get a more robust detection.



f779a249c74a9e7a13cfe6fb2e306021
2020.10
stackexchange.com
f779a249c74a9e7a13cfe6fb2e306021

I know this question is already asked, here is a few links [How to count the node a user has created in a View?](https://drupal.stackexchange.com/questions/52996/how-to-count-the-node-a-user-has-created-in-a-view) or [How can I count the number of nodes submitted by the current user?](https://drupal.stackexchange.com/questions/14433/how-can-i-count-the-number-of-nodes-submitted-by-the-current-user)


This is a very simple task but I am facing a problem. 
I'm trying to get the number of nodes of a certain content type created by a user. This is the configuration of the view:


1. setting **Author uid** as contextual filter
2. setting the content type in filter criteria and selecting Node ID as field
3. setting aggregation to `yes` and set the `nid` to use the `Count Distinct` aggregation
4. Setting the `Pager` to *Display all items*


If I don't use the aggregation this is the result:


2158
2151
2152
2153
2154
2155
2156
2157
2142
2143
2144
2145
2146
2147
2148
2149
2150
2141
2140
2139
2138
2137
2136
2127
2126
2125
2124
2123
2128
2129
2130
2131
2132
2133
2134
2135
2122


But if I use it, the result is :



```
8
15
14

```

which 8+15+14 = 37 and number of the nodes is also `37` but I wonder why it displays the 37 this way?



[Problem with getting number of nodes created by a user in a View](/questions/180476/problem-with-getting-number-of-nodes-created-by-a-user-in-a-view)
======================================================================================================================================================


stackexchange.com
2020.10

You should make sure that you have no sort criteria set in your view that splits your aggregation. 



36d566c8a7e09afc56c2a31315fd554c
2020.16
stackexchange.com
36d566c8a7e09afc56c2a31315fd554c

We had left the TV on after the news finished and on came the [Monopoly Millionaire's Club](https://www.playmmc.com/gameshow). I had no knowledge of its existence and watched some out of curiosity. The particular game in question was [No Vacancy](https://en.wikipedia.org/wiki/Monopoly_Millionaires%27_Club_(TV_series)#Games). The gameplay is fairly straightforward:


1. The player has a hotel with 21 rooms divided evenly among 3 floors so that each floor has 7 rooms.
2. Each turn, 5 cars appear in front of the hotel. Each car holds between 1 and 5 people, inclusive. (It is not specified whether or not each number is represented or if every car is assigned randomly and independently of each other.) (The cars are refreshed every turn so the cars you didn't pick disappear and new ones come in. I.E., the cars you've already picked have no bearing on what cars you can pick next.)
3. The player picks one of the cars and is then told how many people are in the car.
4. The player must give each person in the car a room in the hotel and they must all be on the same floor.
5. Filling rooms on the first floor yields \$1,000 each, the second yields \$2,000 each, and the third yields \$3,000 each. (Yes, these are very expensive rooms.)
6. Once every floor has at least 3 people, the player can quit after any turn and take what money is earned thus far.
7. If ever the player is unable to place everyone from the car on the same floor, the game ends and the player receives nothing.
8. If every room is filled, the player receives \$100,000.




---


Now, given that the entire game is electronic, it would be easy for the house to force every player to lose by simply spamming every vehicle as having 5 passengers. Let us presume, though, that the producers are *not* out to steal hope from their contestants. Even with that, though, it struck me as being much more about chance than strategy despite all the dramatic music and lighting - combined with the dramatic host - indicating that strategy was key.


**If you play perfectly, how much can you expect to win on average?**


**Does it matter if each car is random vs. all five cars holding every number from 1 to 5?**



[Monopoly Game Show: Is there a winning strategy?](/questions/19848/monopoly-game-show-is-there-a-winning-strategy)
===================================================================================================================


stackexchange.com
2020.16

If passenger counts from 1 to 5 are equally distributed, it's possible to compute for each of the 343 (7x7x7) possible population distributions the expected value if one stands pat and if one takes another car (the stand-pat case is easy; for the take-another car case, figure out for each passenger count 1-5 which of the three possible resulting distributions would be the best, and then take the average of the best values from those five passenger counts).


If I figured the math right, that would yield an expected value of $37,480 starting with all rooms empty (all expected values rounded to the nearest dollar). In this table, the two numbers in the row heading show the number of occupied rooms on the first two floors; the column headings give the number of occupied rooms on the third floor. The cells marked with "**" indicate the expected value from betting; those without asterisks indicate the expected value from standing pat (when it's higher than that from betting). Cells marked with dashes indicate combinations that won't arise when using an optimal strategy. Looking at the table, there's no apparent pattern for what moves are optimal. For example, if the first car has 1, 2, 3, or 5 people in it, they should be placed on the top floor, but if it has exactly four they should go on the second floor--a result that's far from intuitively obvious. I'm not sure how well a naïve strategy would do, but the optimal strategy yields a result which is better than 37% of the maximum value. I'm not sure how the expected value using optimal strategy compares with what the expected value would be if the player knew car capacities in advance.



```
         0        1        2        3        4        5        6        7
0 0: 37480**  38370**  40128**  38014**  -----    35153**  36910**  39856** 
0 1: -----    -----    -----    38543**  -----    -----    36843**  40564** 
0 2: -----    39658**  40945**  40433**  -----    38576**  39321**  43320** 
0 3: -----    38259**  40520**  -----    -----    34348**  36099**  39678** 
0 4: 35734**  36893**  39069**  -----    -----    32844**  34855**  38105** 
0 5: -----    -----    -----    34327**  -----    31807**  34418**  37614** 
0 6: -----    36154**  39222**  35625**  -----    33700**  35582**  39238** 
0 7: 38728**  39545**  42685**  38769**  -----    36262**  38478**  43832** 

1 0: -----    -----    40179**  -----    -----    -----    -----    40404** 
1 1: -----    -----    -----    -----    -----    -----    -----    -----   
1 2: -----    -----    40505**  39800**  -----    37976**  38689**  42889** 
1 3: -----    -----    39924**  -----    -----    -----    -----    39471** 
1 4: -----    -----    39046**  -----    -----    -----    -----    38454** 
1 5: -----    -----    38343**  -----    -----    -----    -----    38478** 
1 6: -----    -----    38536**  -----    -----    -----    -----    38672** 
1 7: -----    -----    42182**  38489**  -----    37006**  37872**  43360** 

2 0: -----    -----    41017**  -----    -----    -----    -----    42729** 
2 1: -----    -----    40641**  39251**  -----    37331**  38047**  42392** 
2 2: -----    -----    40701**  40957**  39599**  38785**  39182**  44212** 
2 3: -----    38977**  41090**  -----    -----    -----    37759**  43846** 
2 4: -----    38152**  39922**  -----    -----    35321**  36694**  41238** 
2 5: -----    37217**  39100**  -----    34769**  34150**  36718**  41032** 
2 6: -----    37473**  39086**  37529**  35808**  36006**  36672**  41360** 
2 7: -----    41348**  43493**  43008**  40006**  39672**  40560**  52800** 

3 0: -----    -----    -----    -----    -----    -----    -----    -----   
3 1: -----    -----    -----    -----    -----    -----    35248**  39349** 
3 2: -----    38790**  40514**  -----    37569**  37630**  38216**  43817** 
3 3: -----    -----    -----    -----    -----    -----    -----    -----   
3 4: -----    -----    -----    -----    -----    -----    -----    -----   
3 5: -----    -----    -----    -----    -----    28000    31000    34000   
3 6: -----    34320**  37923**  -----    -----    30000    33000    36000   
3 7: -----    38059**  42956**  -----    29200**  32000    35000    44000** 

4 0: -----    -----    -----    -----    -----    -----    -----    -----   
4 1: -----    -----    -----    -----    -----    -----    34775**  38521** 
4 2: -----    -----    39668**  -----    -----    36349**  37411**  41848** 
4 3: -----    -----    -----    -----    -----    -----    -----    -----   
4 4: 31137**  32718**  35585**  -----    24000    27000    30000    33000   
4 5: -----    -----    36784**  -----    -----    29000    32000    35000   
4 6: -----    33851**  37180**  -----    -----    31000    34000    37000   
4 7: 36379**  37156**  40963**  -----    30000    33000    36000    39000   

5 0: -----    -----    -----    -----    -----    -----    -----    -----   
5 1: -----    -----    -----    -----    -----    -----    34539**  38168** 
5 2: -----    37244**  38753**  -----    35150**  34852**  37056**  41206** 
5 3: -----    -----    -----    -----    -----    26000    29000    32000   
5 4: -----    -----    36136**  -----    -----    28000    31000    34000   
5 5: -----    -----    35172**  25210**  -----    30000    33000    36000   
5 6: -----    33468**  36723**  27008**  29000    32000    35000    38000   
5 7: -----    36523**  40136**  30040**  31000    34000    37000    40000   

6 0: -----    -----    -----    -----    -----    -----    -----    -----   
6 1: -----    -----    -----    -----    -----    -----    33825**  37126** 
6 2: -----    -----    38227**  -----    35558**  35632**  36134**  40672** 
6 3: -----    -----    -----    -----    -----    -----    30000    33000   
6 4: -----    -----    36213**  -----    -----    29000    32000    35000   
6 5: -----    -----    36011**  -----    28000    31000    34000    37000   
6 6: -----    32459**  35456**  27840**  30000    33000    36000    39000   
6 7: -----    35336**  39280**  31200**  32000    35000    38000    41000   

7 0: -----    -----    -----    -----    -----    -----    -----    41958** 
7 1: -----    -----    -----    -----    -----    -----    35526**  41632** 
7 2: -----    40407**  42104**  41980**  38984**  38486**  39072**  51360** 
7 3: -----    -----    -----    -----    -----    -----    31000    42800** 
7 4: -----    -----    39331**  -----    -----    30000    33000    36000   
7 5: -----    -----    38776**  -----    29000    32000    35000    38000   
7 6: -----    34616**  38480**  30600**  31000    34000    37000    40000   
7 7: 40776**  40480**  50400**  42000**  35000**  36000    39000    100000   

```

Incidentally, although the game would allow a contestant to stop with only three occupants on each floor, the only situation where a contestant who is playing optimally would be in any "danger" without at least four occupants on every floor would have five occupants on each of two floors, and three on the other. A player who is using optimal strategy may have such a situation arise with the three occupants on any floor. If the three occupants are on one of the lower floors, the player should stand pat with an expected value of \$26,000 or \$28,000. If the three occupants are on the top floor, standing pat would have an expected value of \$24,000 but continuing on would--despite the risk--have an expected value of \$25,210.




If the number of people in a car you pick is evenly distributed between 1 and 5, on average a car will have 3 people, or that any two cars on average will have 6 people. 


So, most of the time, you'll have 6 people on each floor, for $36,000 total. 


For a strategy, I would fill floors from the top, until there are 3 or fewer rooms left (average car). Then I would move to the next floor unless there is a gap above it that it perfectly fits. Fill until 3 or fewer rooms. At that point, if you can get the top to 1 or 0, do that. Otherwise, go to the bottom row. 




It struck me that it's always possible to guarantee a nonzero amount of money won - follow the strategy that if any floor has two or fewer occupants, pick a car and give rooms to the people in that car. Stand pat as soon as all floors have at least three occupants.


This works because any floor with at most two people always has at least five vacancies, and so can always accommodate another carful of people.


This may not be an optimal expected value, but it does give at least $18,000 in the worst case, which is quite a lot of money.



80615a92763af49229a666dec978bb07
2020.40
stackexchange.com
80615a92763af49229a666dec978bb07

Find all integral solutions of $x^2+1= y^2+z^2$. Actually I have to find all integral solution of $a(a+1)=b(b+1)+c(c+1)$. I reduced this in the above form I.e., $ (2a+1)^2+1= (2b+1)^2+(2c+1)^2$ .



[Solution of Diophantine equation](/questions/1842447/solution-of-diophantine-equation)
=======================================================================================


stackexchange.com
2020.40

The case where $z^2-x^2=1-y^2=0$ is self-evident.We have $z=\pm x$ and $y=\pm 1$


Now consider the case where $(1-y^2)(z^2-x^2)\neq 0$
$$z^2-x^2=1-y^2$$
$$(z+x)(z-x)=(1+y)(1-y)$$
$$\dfrac{z+x}{1+y}=\dfrac{1-y}{z-x}
=\dfrac{p}{q}$$ with $pq\neq 0$ and $\gcd(p,q)=1$.


It follows:
$$z+x=\dfrac{p}{q}(1+y)$$
$$z-x=\dfrac{q}{p}{(1-y)}$$


Hence, in order to find all the integral solutions, the following restrictions must apply 
$$1-y\equiv 0\pmod p$$
$$1+y\equiv 0\pmod q$$ 


In other words,by alternatively subtracting 1 from 2/ adding 1 and 2 $$qs-pr=2y$$
$$qs+pr=2$$ where $r,s$ are 2 coprime integers.
Since
$$z+x=ps$$
$$z-x=qr$$


we have:
$$z=\dfrac{1}{2}(ps+qr)$$ $$x=\dfrac{1}{2}(ps-qr)$$ $$y=\dfrac{1}{2}(qs-pr)$$where $pr,qs$ have the same parity and $qs+pr=2$.




There is a parametrization, most of the restrictions are to cut down on repetition. I found this by working with an answer by Ted Shifrin, [Rulings of One Sheet Hyperboloid](https://math.stackexchange.com/questions/1648749/rulings-of-one-sheet-hyperboloid)


Take integers $a,b,c,d.$ Allow $b \geq 0,$ then $a,c,d >0.$


Main restriction:
$$ a d - b c = 1. $$
Secondary:
$$ a c > b d. $$
Define
$$ x = a d + b c, $$
$$ y = a c - b d, $$
$$ z = a c + b d.$$
To reduce repetition, when $y$ is odd, demand $x \leq y.$ Notice that $X$ is always odd because $ad+bc \equiv ad-bc \pmod 2.$


This is lightning fast.



```
1  x: 1  y: 1  z: 1      a: 1  b: 0  c: 1  d: 1     1 + z^2 : 2 =  2
2  x: 1  y: 2  z: 2      a: 1  b: 0  c: 2  d: 1     1 + z^2 : 5 =  5
3  x: 1  y: 3  z: 3      a: 1  b: 0  c: 3  d: 1     1 + z^2 : 10 =  2 5
4  x: 1  y: 4  z: 4      a: 1  b: 0  c: 4  d: 1     1 + z^2 : 17 =  17
5  x: 1  y: 5  z: 5      a: 1  b: 0  c: 5  d: 1     1 + z^2 : 26 =  2 13
6  x: 1  y: 6  z: 6      a: 1  b: 0  c: 6  d: 1     1 + z^2 : 37 =  37
7  x: 1  y: 7  z: 7      a: 1  b: 0  c: 7  d: 1     1 + z^2 : 50 =  2 5^2
7  x: 5  y: 5  z: 7      a: 3  b: 1  c: 2  d: 1     1 + z^2 : 50 =  2 5^2
8  x: 1  y: 8  z: 8      a: 1  b: 0  c: 8  d: 1     1 + z^2 : 65 =  5 13
8  x: 7  y: 4  z: 8      a: 2  b: 1  c: 3  d: 2     1 + z^2 : 65 =  5 13
9  x: 1  y: 9  z: 9      a: 1  b: 0  c: 9  d: 1     1 + z^2 : 82 =  2 41
10  x: 1  y: 10  z: 10      a: 1  b: 0  c: 10  d: 1     1 + z^2 : 101 =  101
11  x: 1  y: 11  z: 11      a: 1  b: 0  c: 11  d: 1     1 + z^2 : 122 =  2 61
12  x: 1  y: 12  z: 12      a: 1  b: 0  c: 12  d: 1     1 + z^2 : 145 =  5 29
12  x: 9  y: 8  z: 12      a: 5  b: 2  c: 2  d: 1     1 + z^2 : 145 =  5 29
13  x: 1  y: 13  z: 13      a: 1  b: 0  c: 13  d: 1     1 + z^2 : 170 =  2 5 17
13  x: 7  y: 11  z: 13      a: 4  b: 1  c: 3  d: 1     1 + z^2 : 170 =  2 5 17
14  x: 1  y: 14  z: 14      a: 1  b: 0  c: 14  d: 1     1 + z^2 : 197 =  197
15  x: 1  y: 15  z: 15      a: 1  b: 0  c: 15  d: 1     1 + z^2 : 226 =  2 113
16  x: 1  y: 16  z: 16      a: 1  b: 0  c: 16  d: 1     1 + z^2 : 257 =  257
17  x: 11  y: 13  z: 17      a: 3  b: 1  c: 5  d: 2     1 + z^2 : 290 =  2 5 29
17  x: 1  y: 17  z: 17      a: 1  b: 0  c: 17  d: 1     1 + z^2 : 290 =  2 5 29
18  x: 15  y: 10  z: 18      a: 2  b: 1  c: 7  d: 4     1 + z^2 : 325 =  5^2 13
18  x: 17  y: 6  z: 18      a: 3  b: 2  c: 4  d: 3     1 + z^2 : 325 =  5^2 13
18  x: 1  y: 18  z: 18      a: 1  b: 0  c: 18  d: 1     1 + z^2 : 325 =  5^2 13
19  x: 1  y: 19  z: 19      a: 1  b: 0  c: 19  d: 1     1 + z^2 : 362 =  2 181
20  x: 1  y: 20  z: 20      a: 1  b: 0  c: 20  d: 1     1 + z^2 : 401 =  401
21  x: 1  y: 21  z: 21      a: 1  b: 0  c: 21  d: 1     1 + z^2 : 442 =  2 13 17
21  x: 9  y: 19  z: 21      a: 5  b: 1  c: 4  d: 1     1 + z^2 : 442 =  2 13 17
22  x: 17  y: 14  z: 22      a: 9  b: 4  c: 2  d: 1     1 + z^2 : 485 =  5 97
22  x: 1  y: 22  z: 22      a: 1  b: 0  c: 22  d: 1     1 + z^2 : 485 =  5 97
23  x: 13  y: 19  z: 23      a: 7  b: 2  c: 3  d: 1     1 + z^2 : 530 =  2 5 53
23  x: 1  y: 23  z: 23      a: 1  b: 0  c: 23  d: 1     1 + z^2 : 530 =  2 5 53
24  x: 1  y: 24  z: 24      a: 1  b: 0  c: 24  d: 1     1 + z^2 : 577 =  577
25  x: 1  y: 25  z: 25      a: 1  b: 0  c: 25  d: 1     1 + z^2 : 626 =  2 313
26  x: 1  y: 26  z: 26      a: 1  b: 0  c: 26  d: 1     1 + z^2 : 677 =  677
27  x: 17  y: 21  z: 27      a: 3  b: 1  c: 8  d: 3     1 + z^2 : 730 =  2 5 73
27  x: 1  y: 27  z: 27      a: 1  b: 0  c: 27  d: 1     1 + z^2 : 730 =  2 5 73
28  x: 1  y: 28  z: 28      a: 1  b: 0  c: 28  d: 1     1 + z^2 : 785 =  5 157
28  x: 23  y: 16  z: 28      a: 2  b: 1  c: 11  d: 6     1 + z^2 : 785 =  5 157
29  x: 1  y: 29  z: 29      a: 1  b: 0  c: 29  d: 1     1 + z^2 : 842 =  2 421
30  x: 15  y: 26  z: 30      a: 4  b: 1  c: 7  d: 2     1 + z^2 : 901 =  17 53
30  x: 1  y: 30  z: 30      a: 1  b: 0  c: 30  d: 1     1 + z^2 : 901 =  17 53
31  x: 11  y: 29  z: 31      a: 6  b: 1  c: 5  d: 1     1 + z^2 : 962 =  2 13 37
31  x: 1  y: 31  z: 31      a: 1  b: 0  c: 31  d: 1     1 + z^2 : 962 =  2 13 37
32  x: 1  y: 32  z: 32      a: 1  b: 0  c: 32  d: 1     1 + z^2 : 1025 =  5^2 41
32  x: 25  y: 20  z: 32      a: 13  b: 6  c: 2  d: 1     1 + z^2 : 1025 =  5^2 41
32  x: 31  y: 8  z: 32      a: 4  b: 3  c: 5  d: 4     1 + z^2 : 1025 =  5^2 41
33  x: 19  y: 27  z: 33      a: 10  b: 3  c: 3  d: 1     1 + z^2 : 1090 =  2 5 109
33  x: 1  y: 33  z: 33      a: 1  b: 0  c: 33  d: 1     1 + z^2 : 1090 =  2 5 109
34  x: 1  y: 34  z: 34      a: 1  b: 0  c: 34  d: 1     1 + z^2 : 1157 =  13 89
34  x: 31  y: 14  z: 34      a: 8  b: 5  c: 3  d: 2     1 + z^2 : 1157 =  13 89
35  x: 1  y: 35  z: 35      a: 1  b: 0  c: 35  d: 1     1 + z^2 : 1226 =  2 613
36  x: 1  y: 36  z: 36      a: 1  b: 0  c: 36  d: 1     1 + z^2 : 1297 =  1297
37  x: 1  y: 37  z: 37      a: 1  b: 0  c: 37  d: 1     1 + z^2 : 1370 =  2 5 137
37  x: 23  y: 29  z: 37      a: 3  b: 1  c: 11  d: 4     1 + z^2 : 1370 =  2 5 137
38  x: 17  y: 34  z: 38      a: 9  b: 2  c: 4  d: 1     1 + z^2 : 1445 =  5 17^2
38  x: 1  y: 38  z: 38      a: 1  b: 0  c: 38  d: 1     1 + z^2 : 1445 =  5 17^2
38  x: 31  y: 22  z: 38      a: 2  b: 1  c: 15  d: 8     1 + z^2 : 1445 =  5 17^2
39  x: 1  y: 39  z: 39      a: 1  b: 0  c: 39  d: 1     1 + z^2 : 1522 =  2 761
40  x: 1  y: 40  z: 40      a: 1  b: 0  c: 40  d: 1     1 + z^2 : 1601 =  1601
41  x: 1  y: 41  z: 41      a: 1  b: 0  c: 41  d: 1     1 + z^2 : 1682 =  2 29^2
41  x: 29  y: 29  z: 41      a: 5  b: 2  c: 7  d: 3     1 + z^2 : 1682 =  2 29^2
42  x: 1  y: 42  z: 42      a: 1  b: 0  c: 42  d: 1     1 + z^2 : 1765 =  5 353
42  x: 33  y: 26  z: 42      a: 17  b: 8  c: 2  d: 1     1 + z^2 : 1765 =  5 353
43  x: 13  y: 41  z: 43      a: 7  b: 1  c: 6  d: 1     1 + z^2 : 1850 =  2 5^2 37
43  x: 1  y: 43  z: 43      a: 1  b: 0  c: 43  d: 1     1 + z^2 : 1850 =  2 5^2 37
43  x: 25  y: 35  z: 43      a: 13  b: 4  c: 3  d: 1     1 + z^2 : 1850 =  2 5^2 37
44  x: 1  y: 44  z: 44      a: 1  b: 0  c: 44  d: 1     1 + z^2 : 1937 =  13 149
44  x: 41  y: 16  z: 44      a: 3  b: 2  c: 10  d: 7     1 + z^2 : 1937 =  13 149
45  x: 1  y: 45  z: 45      a: 1  b: 0  c: 45  d: 1     1 + z^2 : 2026 =  2 1013
46  x: 1  y: 46  z: 46      a: 1  b: 0  c: 46  d: 1     1 + z^2 : 2117 =  29 73
46  x: 31  y: 34  z: 46      a: 8  b: 3  c: 5  d: 2     1 + z^2 : 2117 =  29 73
47  x: 19  y: 43  z: 47      a: 5  b: 1  c: 9  d: 2     1 + z^2 : 2210 =  2 5 13 17
47  x: 1  y: 47  z: 47      a: 1  b: 0  c: 47  d: 1     1 + z^2 : 2210 =  2 5 13 17
47  x: 23  y: 41  z: 47      a: 4  b: 1  c: 11  d: 3     1 + z^2 : 2210 =  2 5 13 17
47  x: 29  y: 37  z: 47      a: 3  b: 1  c: 14  d: 5     1 + z^2 : 2210 =  2 5 13 17
48  x: 1  y: 48  z: 48      a: 1  b: 0  c: 48  d: 1     1 + z^2 : 2305 =  5 461
48  x: 39  y: 28  z: 48      a: 2  b: 1  c: 19  d: 10     1 + z^2 : 2305 =  5 461
49  x: 1  y: 49  z: 49      a: 1  b: 0  c: 49  d: 1     1 + z^2 : 2402 =  2 1201
50  x: 1  y: 50  z: 50      a: 1  b: 0  c: 50  d: 1     1 + z^2 : 2501 =  41 61
50  x: 49  y: 10  z: 50      a: 5  b: 4  c: 6  d: 5     1 + z^2 : 2501 =  41 61

```

It is also easy enough to find all rational solutions by stereographic projection around a given rational solution.


