these are several programs,  some of them used in my paper,  
    some of them were just useful for me to get a sense of what was happening with the continued fractions of square numbers and prime numbers . 

1.  table of continued fractions of (Sqrt[n]),  n square free
<< NumberTheory`ContinuedFractions`

good = ContinuedFraction[(Sqrt[i])]
var = If[SquareFreeQ[i],  good,  0]

t = Flatten[Table[var,  {i,  n,  n}]]

Select[
      Table[(Length[Flatten[Table[var,  {i,  n,  n}]]] - 1),  {n,  
          1,  15000}],  Positive]

fric = Frequencies[%]

col2 = Column[fric,  2]

Length[col2]

<< NumberTheory`PrimeQ`

Length[%]

Select[Table[i,  {i,  2, k}],  PrimeQ]

same for primes ... 
Select[
      Table[(Length[
              Flatten[Table[
                  If[i ∈ Primes,  ContinuedFraction[(Sqrt[i])]],  {i,  
                    n,  n}]]] - 1),  {n,  2,  m}],  
      Positive]

2.  checks which primes have a certain length t of the continued fraction

<< NumberTheory`ContinuedFractions`

<< Statistics`DataManipulation`

<< NumberTheory`PrimeQ`

extra = If[SquareFreeQ[i],  i]

Select[(Column[
            Drop[Position[
                Table[{extra,  
                    Length[Flatten[ContinuedFraction[(Sqrt[i])]]]},  {i,  2,  
                    k}],  t],  1],  1] + 1),  SquareFreeQ]

Select[%,  PrimeQ]

3.  program for the second conjecture

<< NumberTheory`NumberTheoryFunctions`

<< NumberTheory`ContinuedFractions`

<< Statistics`DataManipulation`

<NumberTheory`PrimeQ`

good = ContinuedFraction[(Sqrt[i])]

var = If[SquareFreeQ[i],  good,  0]
goal = If[i ∈ Primes,  ContinuedFraction[(Sqrt[i])]]

super = 
      Select[Table[(Length[
                Flatten[Table[ContinuedFraction[(Sqrt[i])],  {i,  n,  n}]]] - 
              1),  {n,  2,  k}],  Positive]

supra = 
      Select[Table[(Length[Flatten[Table[goal,  {i,  n,  n}]]] - 
              1),  {n,  2,  k}],  Positive]

Select[
      Table[(Length[Select[Column[Frequencies[super],  2],  PrimeQ]] - 
            Length[Select[Column[Frequencies[supra],  2],  
                PrimeQ]]),  {k, 2,  m}],  Positive]

Select[
      Table[(Length[
              Select[Column[Frequencies[super],  2],  SquareFreeQ]] - 
            Length[Select[Column[Frequencies[supra],  2],  
                SquareFreeQ]]),  {k,  2,  m}],  Positive]

N[Select[Table[If[i ∈ Primes,  i,  0],  {i,  2,  m}],  
        Positive]]

4.  program for densities D for square free numbers
<DiscreteMath`RSolve`

<< NumberTheory`NumberTheoryFunctions`

Table[
      Length[Select[Table[If[PrimeQ[i^2 + 1], 1,  0],  {i,  1,  k}],  
          Positive]],  {k,  1,  250}]

<< NumberTheory`PrimeQ`
t = 0;  
    Do[t *= 1;  Print[N[t/(i - 1)]];  
      If[PrimeQ[i^2 + 1],  ,  Continue[]];  t++,  {i, 1,  
        p}]

same for primes ...

<< NumberTheory`PrimeQ`

t = 1;  
    Do[t += -2*t;  Print[{N[t/(i*(i + 1))],  i}];  
      If[PrimeQ[i^2 + 2*i + 2],  ,  Continue[]];  
      t += ((i - 1 - t)/2),  {i, 1,  p}]

Length[
      Select[Table[i,  {i,  1,  m}],  PrimeQ]]
Length[
      Select[Table[i^2 + 1,  {i,  1,  10050}],  
        PrimeQ]]

5.  some graphs for growth rates of n/ 
        nb .  numbers less than n with the continued fraction of their square root equal to k
<< NumberTheory`NumberTheoryFunctions`
<< NumberTheory`ContinuedFractions`
<< Statistics`DataManipulation`
<< NumberTheory`PrimeQ`

t = 
      Table[Length[
            Select[(Flatten[
                    Position[
                      Table[Length[Flatten[ContinuedFraction[(Sqrt[i])]]],  {i,  
                          2,  x}],  k]] + 1),  SquareFreeQ]]/x,  {x,  
          3, n}]

ListPlot[t,  PlotJoined -> True]

y = 
      Table[Length[
            Select[(Flatten[
                    Position[
                      Table[Length[Flatten[ContinuedFraction[(Sqrt[i])]]],  {i,  
                          2,  x}],  k]] + 1),  SquareFreeQ]]/x,  {x,  
          2,  n}]