cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 36 results. Next

A146326 Length of the period of the continued fraction of (1+sqrt(n))/2.

Original entry on oeis.org

0, 2, 2, 0, 1, 4, 4, 4, 0, 2, 2, 2, 1, 4, 2, 0, 3, 6, 6, 4, 2, 6, 4, 4, 0, 2, 2, 4, 1, 2, 8, 4, 4, 4, 2, 0, 3, 6, 6, 8, 5, 4, 10, 6, 2, 8, 4, 4, 0, 2, 2, 4, 1, 6, 4, 2, 6, 6, 6, 4, 3, 4, 2, 0, 3, 6, 10, 6, 4, 6, 8, 4, 9, 6, 4, 8, 2, 4, 4, 4, 0, 2, 2, 2, 1, 6, 2, 8, 7, 2, 8, 8, 2, 12, 4, 8, 9, 4, 2, 0
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

First occurrence of n in this sequence see A146343.
Records see A146344.
Indices where records occurred see A146345.
a(n) =0 for n = k^2 (A000290).
a(n) =1 for n = 4 k^2 + 4 k + 5 (A078370). For primes see A005473.
a(n) =2 for n in A146327. For primes see A056899.
a(n) =3 for n in A146328. For primes see A146348.
a(n) =4 for n in A146329. For primes see A028871 - {2}.
a(n) =5 for n in A146330. For primes see A146350.
a(n) =6 for n in A146331. For primes see A146351.
a(n) =7 for n in A146332. For primes see A146352.
a(n) =8 for n in A146333. For primes see A146353.
a(n) =9 for n in A143577. For primes see A146354.
a(n)=10 for n in A146334. For primes see A146355.
a(n)=11 for n in A146335. For primes see A146356.
a(n)=12 for n in A146336. For primes see A146357.
a(n)=13 for n in A333640. For primes see A146358.
a(n)=14 for n in A146337. For primes see A146359.
a(n)=15 for n in A146338. For primes see A146360.
a(n)=16 for n in A146339. For primes see A146361.
a(n)=17 for n in A146340. For primes see A146362.

Examples

			a(2) = 2 because continued fraction of (1+sqrt(2))/2 = 1, 4, 1, 4, 1, 4, 1, ... has period (1,4) length 2.
		

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: seq(A146326(n),n=1..100) ; # R. J. Mathar, Sep 06 2009
  • Mathematica
    Table[cf = ContinuedFraction[(1 + Sqrt[n])/2]; If[Head[cf[[-1]]] === List, Length[cf[[-1]]], 0], {n, 100}]
    f[n_] := Length@ ContinuedFraction[(1 + Sqrt[n])/2][[-1]]; Array[f, 100] (* Robert G. Wilson v, Apr 11 2017 *)

Formula

a(n) = 0 iff n is a square (A000290). - Robert G. Wilson v, Apr 11 2017

Extensions

a(39) and a(68) corrected by R. J. Mathar, Sep 06 2009

A146348 Primes p such that continued fraction of (1 + sqrt(p))/2 has period 3.

Original entry on oeis.org

17, 37, 61, 101, 197, 257, 317, 401, 461, 557, 577, 677, 773, 1129, 1297, 1429, 1601, 1877, 1901, 2917, 3137, 4357, 4597, 5417, 5477, 6053, 7057, 8101, 8761, 8837, 10733, 11621, 12101, 13457, 13877, 14401, 15277, 15377, 15877, 16333, 16901, 17737, 17957, 18329, 21317, 22501, 23593, 24337, 25601, 28901, 30137, 30977, 32401, 33857, 41453, 41617, 42437, 44101
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

Primes in A146328. Finite A050952 is subset of this sequence.
From Michel Lagneau, Sep 03 2014: (Start)
The primes of the form p = n^2+1 for n>2 are in the sequence, and the continued fraction of (1+sqrt(p))/2 is [n/2; 1, 1, n-1, 1, 1, n-1, 1, 1, ...] with the period (1, 1, n-1).
We observe that the other primes {61, 317, 461, 557, 773, 1129, 1429, ...} are prime divisors of composite numbers of the form k^2+1 where k = 11, 114, 48, 118, 317, 168, 620, ... .
(End)
Another possibly infinite subset of the sequence is primes of the form 100*k^2-44*k+5, where the continued fraction is [5*k-1; 2, 2, 10*k-3, ...] with period [2, 2, 10*k-3]. This includes {61, 317, 773, 1429, 4597, 6053, ...}. - Robert Israel, Sep 03 2014

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: isA146348 := proc(n) RETURN(isprime(n) and A146326(n) = 3) ; end: for n from 2 to 4000 do if isA146348(n) then printf("%d,\n",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    okQ[n_] := Length[ContinuedFraction[(1 + Sqrt[n])/2][[2]]] == 3; Select[Prime[Range[100]], okQ]

Extensions

1019 removed; more terms added by R. J. Mathar, Sep 06 2009
More terms from Zak Seidov, Mar 09 2011

A146345 Indices in A146326 where records occur.

Original entry on oeis.org

1, 2, 6, 18, 31, 43, 94, 106, 151, 211, 331, 394, 526, 694, 751, 886, 919, 1114, 1324, 1726, 1759, 1831, 2011, 2311, 2326, 2671, 3019, 3691, 3754, 3931, 4174, 4951, 4999, 5119, 6211, 6406, 7606, 8254, 8719, 8779, 9244, 9619, 9739, 10399, 10651, 12919, 13126
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: read("transforms") ; a26 := [seq(A146326(n),n=1..1400)] ; RECORDS(a26)[2] ; # R. J. Mathar, Sep 06 2009
  • Mathematica
    f[n_] := Length@ContinuedFraction[(1 + Sqrt[n])/2][[-1]]; mx = -1; k = 1; lst = {}; While[k < 14000, a = f@k; If[a > mx, mx = a; AppendTo[lst, k]]; k++]; lst (* Robert G. Wilson v, Apr 11 2017 *)

Extensions

19 replaced by 18, 394 inserted, 4 more terms added by R. J. Mathar, Sep 06 2009
More terms from Robert G. Wilson v, Apr 11 2017

A146363 a(n) = smallest prime p such that continued fraction of (1 + sqrt(p))/2 has period length n.

Original entry on oeis.org

5, 2, 17, 7, 41, 19, 89, 31, 73, 43, 541, 103, 421, 179, 193, 191, 521, 139, 241, 151, 337, 491, 433, 271, 929, 211, 409, 487, 673, 379, 937, 463, 601, 331, 769, 1439, 2297, 619, 1033, 1399, 1777, 571, 1753, 823, 1993, 739, 1249, 631, 4337, 1051, 1321, 751, 1201
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Crossrefs

Programs

  • Maple
    A := proc(n) option remember ; local c; try c := numtheory[cfrac](1/2+sqrt(n)/2,'periodic,quotients') ; RETURN(nops(c[2]) ); catch: RETURN(-1) end try ; end: A146363 := proc(n) local p,i ; for i from 1 do p := ithprime(i) ; if A(p) = n then RETURN(p) ; fi; od; end: for n from 1 do printf("%d, ",A146363(n)) ; od: # R. J. Mathar, Nov 08 2008
  • Mathematica
    $MaxExtraPrecision = 300; s = 10; aa = {}; Do[k = ContinuedFraction[(1 + Sqrt[n])/2, 1000]; If[Length[k] < 190, AppendTo[aa, 0], m = 1; While[k[[s ]] != k[[s + m]] || k[[s + m]] != k[[s + 2 m]] || k[[s + 2 m]] != k[[s + 3 m]] || k[[s + 3 m]] != k[[s + 4 m]], m++ ]; s = s + 1; While[k[[s ]] != k[[s + m]] || k[[s + m]] != k[[s + 2 m]] || k[[s + 2 m]] != k[[s + 3 m]] || k[[s + 3 m]] != k[[s + 4 m]], m++ ]; AppendTo[aa, m]], {n, 1, 1200}]; Print[aa]; bb = {}; Do[k = 1; yes = 0&&PeimeQ[k]; Do[If[aa[[k]] == n && yes == 0, AppendTo[bb, k]; yes = 1], {k, 1, Length[aa]}], {n, 1, 22}]; bb (* Artur Jasinski *)
    aa = {}; Do[n = 1; While[m != Length[ContinuedFraction[(1 + Sqrt[Prime[n]])/2][[2]]], n++ ]; AppendTo[aa, Prime[n]], {m, 1, 100}]; aa (* Artur Jasinski, Feb 03 2010 *)

Extensions

a(25) replaced by 929 and extended by R. J. Mathar, Nov 08 2008

A146335 Numbers k such that continued fraction of (1 + sqrt(k))/2 has period 11.

Original entry on oeis.org

265, 541, 593, 661, 701, 857, 1061, 1109, 1217, 1237, 1709, 1733, 1949, 2333, 2509, 2557, 2957, 3125, 3229, 3677, 3701, 4181, 4373, 4685, 5081, 5237, 5309, 6133, 6425, 6445, 7013, 7025, 8185, 8545, 8693, 9305, 9533, 9553, 10333, 10525, 10853, 10961, 11125, 11141
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A146356.

Examples

			a(4) = 661 because continued fraction of (1+sqrt(661))/2 = 13, 2, 1, 4, 2, 8, 8, 2, 4, 1, 2, 25, 2, 1, 4, 2, 8, 8, 2, 4, 1, 2, 25, 2, 1, 4, 2, 8, 8, 2, 4, 1, 2, 25, 2, 1, 4, 2, 8, 8 ... has period (2, 1, 4, 2, 8, 8, 2, 4, 1, 2, 25) length 11.
		

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: isA146335 := proc(n) RETURN(A146326(n) = 11) ; end: for n from 2 to 2000 do if isA146335(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    Select[Range[10^4], !IntegerQ @ Sqrt[#] && Length[ContinuedFraction[(1 + Sqrt[#])/2][[2]]] == 11 &]  (* Amiram Eldar, Mar 31 2020 *)

Extensions

916 removed by R. J. Mathar, Sep 06 2009
More terms from Amiram Eldar, Mar 31 2020

A146362 Primes p such that continued fraction of (1 + sqrt(p))/2 has period 17 : primes in A146340.

Original entry on oeis.org

521, 617, 709, 1433, 1597, 2549, 2909, 3581, 3821, 4013, 4649, 5501, 5693, 5813, 6197, 7853, 8093, 8573, 9281, 9677, 10597, 10973, 11273, 13109, 13613, 15413, 15641, 15737, 16001, 16477, 17093, 20261, 22637, 24697, 26717, 32413, 35537, 38177, 43717, 46649, 47681
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[2*10^4], PrimeQ[#] && Length[ContinuedFraction[(1+Sqrt[#])/2][[2]]] == 17 &] (* Amiram Eldar, Mar 30 2020 *)

Extensions

Period length in definition corrected, 2579, 5003 removed, 5813 inserted by R. J. Mathar, Sep 06 2009
More terms from Amiram Eldar, Mar 30 2020

A143577 Numbers k such that the continued fraction of (1 + sqrt(k))/2 has period 9.

Original entry on oeis.org

73, 97, 233, 277, 349, 353, 613, 821, 877, 1073, 1181, 1189, 1277, 1285, 1313, 1385, 1613, 1637, 1693, 1745, 1865, 2357, 2581, 2777, 3233, 3557, 3989, 4157, 4469, 4517, 4553, 4709, 4889, 4925, 4933, 5245, 5261, 5305, 5597, 6113, 6205, 6253, 7213, 7585, 7837, 8885
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A146354.
Superset of A146354. - R. J. Mathar, Nov 05 2008

Examples

			a(1) = 73 because continued fraction of (1+sqrt(73))/2 = 4, 1, 3, 2, 1, 1, 2, 3, 1, 7, 1, 3, 2, 1, 1, 2, 3, 1, 7, 1, 3, 2, 1, 1, 2, 3, 1, 7, 1, 3, ... has period (1, 3, 2, 1, 1, 2, 3, 1, 7) length 9 .
		

Crossrefs

Programs

  • Maple
    isA143577 := proc(k) local c; try c := numtheory[cfrac](1/2+sqrt(k)/2,'periodic','quotients') ; if nops(c[2]) = 9 then RETURN(true) ; else RETURN(false) ; fi; catch: RETURN(false) ; end try; end: for k from 2 to 80000 do if isA143577(k) then printf("%d, ",k) ; fi; od: # R. J. Mathar, Nov 05 2008
  • Mathematica
    Select[Range[1000], !IntegerQ @ Sqrt[#] && Length[ContinuedFraction[(1 + Sqrt[#])/2][[2]]] == 9 &]  (* Amiram Eldar, Mar 19 2020 *)

Extensions

Extended by R. J. Mathar, Nov 05 2008
More terms from Amiram Eldar, Mar 19 2020

A146327 Numbers k such that the continued fraction of (1 + sqrt(k))/2 has period 2.

Original entry on oeis.org

2, 3, 10, 11, 12, 15, 21, 26, 27, 30, 35, 45, 50, 51, 56, 63, 77, 82, 83, 84, 87, 90, 93, 99, 117, 122, 123, 132, 143, 165, 170, 171, 182, 195, 221, 226, 227, 228, 230, 231, 235, 237, 240, 245, 255, 285, 290, 291, 306, 323, 357, 362, 363, 380, 399, 437, 442, 443
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A056899, primes of the form k^2 + 2.

Examples

			a(1) = 2 because continued fraction of (1 + sqrt(2))/2 = 1, 4, 1, 4, 1, 4, 1, ... has repeating part (1,4), period 2.
		

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: isA146327 := proc(n) RETURN(A146326(n) = 2) ; end: for n from 2 to 450 do if isA146327(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    Select[Range[1000], 2 == Length[ContinuedFraction[(1 + Sqrt[#])/2][[2]]] &]

Extensions

226, 227, 290, 291 added by R. J. Mathar, Sep 06 2009

A146328 Numbers k such that the continued fraction of (1 + sqrt(k))/2 has period 3.

Original entry on oeis.org

17, 37, 61, 65, 101, 145, 185, 197, 257, 317, 325, 401, 461, 485, 557, 577, 677, 773, 785, 901, 985, 1025, 1129, 1157, 1297, 1429, 1445, 1601, 1765, 1877, 1901, 1937, 2117, 2285, 2305, 2501, 2705, 2873, 2917, 3077, 3137, 3281, 3293, 3341, 3365, 3601, 3845, 4045, 4097, 4357, 4597, 4625, 4901
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A146348.

Examples

			a(1) = 3 because continued fraction of (1+sqrt(17))/2 = 2, 1, 1, 3, 1, 1, 3, ... has period (1,1,3) length 3.
		

Crossrefs

Programs

  • Maple
    A146326 := proc(n) if not issqr(n) then numtheory[cfrac]( (1+sqrt(n))/2, 'periodic','quotients') ; nops(%[2]) ; else 0 ; fi; end: isA146328 := proc(n) RETURN(A146326(n) = 3) ; end: for n from 2 to 1801 do if isA146328(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    okQ[n_] := Module[{cf = ContinuedFraction[(1 + Sqrt[n])/2]}, Length[cf] > 1 && Length[cf[[2]]] == 3]; Select[Range[5000], okQ]

Extensions

803 removed by R. J. Mathar, Sep 06 2009
Extended by T. D. Noe, Mar 09 2011

A146330 Numbers k such that continued fraction of (1 + sqrt(k))/2 has period 5.

Original entry on oeis.org

41, 149, 157, 181, 269, 397, 425, 493, 565, 697, 761, 941, 1013, 1037, 1325, 1565, 1781, 1825, 2081, 2153, 2165, 2173, 2465, 2477, 2693, 2725, 3181, 3221, 3533, 3869, 4253, 4409, 5165, 5213, 5273, 5297, 5741, 5837, 6485, 6757, 6949, 7045, 7325, 7465, 8021, 8069
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A146350.

Examples

			a(1) = 41 because continued fraction of (1+sqrt(41))/2 = 3, 1, 2, 2, 1, 5, 1, 2, 2, 1, 5, 1, 2, 2, 1, 5, 1, 2, ... has period (1,2,2,1,5) length 5.
		

Crossrefs

Programs

  • Maple
    isA146330 := proc(n) RETURN(A146326(n) = 5) ; end:
    for n from 2 to 2000 do if isA146330(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    Select[Range[10^4], !IntegerQ @ Sqrt[#] && Length[ContinuedFraction[(1 + Sqrt[#])/2][[2]]] == 5 &]  (* Amiram Eldar, Mar 31 2020 *)

Extensions

259 and 1026 removed by R. J. Mathar, Sep 06 2009
More terms from Amiram Eldar, Mar 31 2020
Showing 1-10 of 36 results. Next