A031413
Numbers k such that the continued fraction for sqrt(k) has even period 2*m and the m-th term of the periodic part is 10.
Original entry on oeis.org
102, 114, 118, 134, 142, 228, 237, 249, 273, 309, 321, 404, 412, 428, 436, 452, 460, 476, 492, 500, 508, 524, 540, 548, 556, 572, 630, 645, 655, 670, 695, 705, 745, 755, 805, 820, 830, 895, 906, 1002, 1038, 1050, 1146, 1182, 1194, 1232, 1253, 1290, 1337
Offset: 1
-
epQ[n_]:=Module[{p=ContinuedFraction[Sqrt[n]][[2]],len},len=Length[p];EvenQ[len]&&p[[len/2]]==10];nn=1300;With[{trms=Complement[Range[ nn],Range[ Floor[Sqrt[nn]]]^2]},Select[trms,epQ]] (* Harvey P. Dale, Jul 10 2012 *)
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[EvenQ[len] && c[[2, len/2]] == 10, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 04 2014 *)
A031414
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 1.
Original entry on oeis.org
13, 29, 53, 58, 74, 85, 97, 106, 125, 137, 157, 173, 185, 229, 233, 241, 293, 298, 314, 338, 346, 353, 365, 389, 397, 425, 433, 445, 457, 461, 533, 538, 541, 554, 557, 593, 629, 634, 641, 661, 673, 698, 733, 746, 754, 769, 794, 818, 821, 829, 845, 857, 877
Offset: 1
The continued fraction of sqrt[29] is {5; 2, 1, 1, 2, 10}. The center number in the periodic part is 1.
-
n = 1; t = {}; While[Length[t] < 60, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 1, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 03 2014 *)
A031415
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 2.
Original entry on oeis.org
41, 61, 113, 130, 181, 202, 265, 269, 313, 317, 394, 421, 458, 586, 613, 617, 685, 697, 761, 773, 853, 925, 929, 937, 986, 1013, 1066, 1109, 1117, 1201, 1213, 1301, 1325, 1354, 1409, 1417, 1429, 1466, 1586, 1625, 1637, 1649, 1714, 1741, 1745, 1753, 1861
Offset: 1
The simple continued fraction expansion of sqrt(41) = [6; 2, 2, 12, 2, 2, 12, 2, 2, 12, ...] with odd period 3 and two terms equal to 2. Another example is sqrt(202) = [14; 4, 1, 2, 2, 1, 4, 28, 4, 1, 2, 2, 1, 4, 28, 4, 1, 2, 2, 1, 4, 28, ...] with odd period 7 and two terms equal to 2. - _Michael Somos_, Apr 03 2014
-
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 2, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 03 2014 *)
-
from sympy.ntheory.continued_fraction import continued_fraction_periodic
A031415_list = []
for n in range(1,10**3):
cf = continued_fraction_periodic(0,1,n)
if len(cf) > 1 and len(cf[1]) > 1 and len(cf[1]) % 2 and cf[1][len(cf[1])//2] == 2:
A031415_list.append(n) # Chai Wah Wu, Sep 16 2021
A031416
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 3.
Original entry on oeis.org
89, 149, 193, 218, 250, 277, 337, 493, 521, 569, 653, 709, 914, 1009, 1018, 1037, 1385, 1465, 1553, 1597, 1618, 1754, 1781, 1898, 1921, 1973, 1994, 2069, 2129, 2146, 2293, 2378, 2389, 2441, 2474, 2561, 2725, 2741, 2777, 2897, 2957, 2986, 3170, 3229, 3265
Offset: 1
-
n = 1; t = {}; While[Length[t] < 60, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 3, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 03 2014 *)
cfo3Q[n_]:=Module[{s=Sqrt[n],cf,len},cf=If[IntegerQ[s],{0,0}, ContinuedFraction[ s ][[2]]];len=Length[cf];OddQ[len]&&cf[[ (len+1)/2]] == cf[[(len-1)/2]]==3]; Select[Range[3300],cfo3Q] (* Harvey P. Dale, Sep 25 2019 *)
A031417
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 4.
Original entry on oeis.org
274, 370, 481, 797, 953, 1069, 1249, 1313, 1378, 1381, 1514, 1657, 1658, 1733, 1889, 2125, 2297, 2377, 2554, 2557, 2833, 2834, 2929, 2941, 3226, 3329, 3338, 3433, 3541, 3761, 3874, 3989, 4093, 4106, 4441, 4442, 4561, 4682, 4685, 4933, 4937, 5197, 5450
Offset: 1
The simple continued fraction for sqrt(274) = [16; 1, 1, 4, 4, 1, 1, 32, ...] with odd period 7 and central term 4. Another example is sqrt(481) = [21; 1, 13, 1, 1, 1, 4, 4, 1, 1, 1, 13, 1, 42, ...] with odd period 13 and central term 4. - _Michael Somos_, Apr 03 2014
-
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 4, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 03 2014 *)
cf4Q[n_]:=Module[{s=Sqrt[n],cf,len},cf=If[IntegerQ[s],{1,1},ContinuedFraction[ s][[2]]];len=Length[cf];OddQ[len]&&cf[[(len+1)/2]] == cf[[(len-1)/2]]==4]; Select[Range[5500],cf4Q] (* Harvey P. Dale, Jul 28 2021 *)
A031418
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 5.
Original entry on oeis.org
73, 373, 449, 565, 610, 757, 1021, 1145, 1193, 1594, 1669, 1906, 2053, 2074, 2138, 2314, 2477, 2593, 2861, 3065, 3145, 4129, 4346, 4373, 4469, 4498, 4721, 5018, 5114, 5386, 5741, 6025, 6317, 6617, 6737, 6925, 7241, 7489, 7522, 7897, 7978, 8017, 8186, 8314
Offset: 1
The simple continued fraction expansion of sqrt(73) = [8, 1, 1, 5, 5, 1, 1, 16, ...] of odd period 7 with a pair of central terms both equal to 5. Another example is sqrt(373) = [19, 3, 5, 5, 3, 38, ...] of odd period 5 with a pair of central terms both equal to 5. - _Michael Somos_, Apr 03 2014
-
opct5Q[n_]:=Module[{s=Sqrt[n],cf,len},If[IntegerQ[s],cf={1,1}, cf= ContinuedFraction[s][[2]]];len=Length[cf];OddQ[len] && cf[[Floor[len/2]]] == cf[[Ceiling[len/2]]]==5]; Select[Range[10000],opct5Q] (* Harvey P. Dale, Feb 22 2013 *)
A031419
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 6.
Original entry on oeis.org
109, 281, 865, 922, 1277, 1613, 1769, 1933, 2161, 2341, 2789, 3098, 3653, 3961, 4285, 4457, 5065, 5153, 5713, 5858, 5954, 6101, 6458, 6554, 6709, 7129, 7349, 7681, 8237, 8941, 9242, 9305, 9677, 10177, 10498, 10565, 10693, 10762, 11162, 11365, 11698
Offset: 1
-
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 6 && c[[2, (len + 1)/2 - 1]] == 6, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 04 2014; corrected by Georg Fischer, Jun 23 2019 *)
A031420
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 7.
Original entry on oeis.org
349, 778, 1105, 1237, 1306, 1565, 1721, 2473, 3361, 3706, 3889, 4133, 4985, 5261, 5545, 6217, 6841, 6929, 7165, 7253, 7418, 7754, 8021, 8273, 8369, 8629, 9089, 9274, 9461, 10034, 10229, 10333, 10729, 11245, 11657, 12077, 12842, 12941, 13385, 13730, 14314
Offset: 1
-
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 7, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 04 2014 *)
cf7Q[n_]:=Module[{s=Sqrt[n],cf,len},cf=If[IntegerQ[s],{0}, ContinuedFraction[ s] [[2]]];len=Length[cf];OddQ[len]&&Count[Take[cf,{(len+1)/2-1,(len+1)/2+1}],7]>1]; Select[Range[15000],cf7Q]//Quiet (* Harvey P. Dale, Sep 14 2016 *)
Initial erroneous term 50 removed by
T. D. Noe, Apr 04 2014
A031421
Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 8.
Original entry on oeis.org
509, 1450, 2237, 2425, 3946, 4778, 5189, 5473, 5618, 5914, 6445, 6761, 7417, 8185, 9178, 9938, 10133, 10426, 10529, 10826, 10933, 11441, 11861, 12074, 12289, 12506, 12829, 13273, 14653, 14765, 15241, 16217, 16586, 16837, 17090, 17989, 18385, 18650, 18778
Offset: 1
-
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 8 && c[[2, (len + 1)/2 - 1]] == 8, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 04 2014; adapted by Georg Fischer, Jun 23 2019 *)
Comments