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.

Previous Showing 41-50 of 52 results. Next

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

Original entry on oeis.org

6, 7, 8, 14, 20, 23, 24, 28, 32, 33, 34, 42, 47, 48, 52, 55, 60, 62, 69, 72, 75, 78, 79, 80, 95, 98, 110, 119, 120, 126, 133, 135, 136, 138, 140, 141, 142, 156, 167, 168, 174, 180, 189, 194, 205, 210, 213, 215, 219, 220, 222, 223, 224, 248, 252, 254, 272, 287, 288
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A028871 - {2}.

Examples

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

Crossrefs

Programs

  • Maple
    isA146329 := proc(n) RETURN(A146326(n) = 4) ; end:
    for n from 2 to 400 do if isA146329(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    cf4Q[n_]:=Module[{s=(1+Sqrt[n])/2},If[IntegerQ[s],1,Length[ ContinuedFraction[ s][[2]]]]==4]; Select[Range[300],cf4Q] (* Harvey P. Dale, Dec 14 2017 *)

Extensions

39, 68, 150, 155, etc. removed by R. J. Mathar, Sep 06 2009

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

Original entry on oeis.org

43, 67, 116, 129, 134, 161, 162, 184, 218, 242, 243, 246, 270, 274, 297, 301, 314, 338, 339, 345, 354, 356, 407, 411, 451, 452, 459, 465, 475, 498, 515, 517, 532, 534, 561, 563, 590, 591, 595, 597, 603, 611, 638, 648, 657, 665, 669, 671, 690, 705, 715
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

For primes in this sequence see A146355.

Examples

			a(1) = 43 because continued fraction of (1+Sqrt[43])/2 = 3, 1, 3, 1, 1, 12, 1, 1, 3, 1, 5, 1, 3, 1, 1, 12, 1, 1, 3, 1, 5, 1, 3, 1, 1, 12, 1, 1, 3, 1, ... has period (1, 3, 1, 1, 12, 1, 1, 3, 1, 5) length 10.
		

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: isA146334 := proc(n) RETURN(A146326(n) = 10) ; end: for n from 2 to 715 do if isA146334(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    cf10Q[n_]:=Module[{s=(1+Sqrt[n])/2,x},x=If[IntegerQ[s],1,Length[ ContinuedFraction[ s][[2]]]];x==10]; Select[Range[750],cf10Q] (* Harvey P. Dale, Sep 22 2015 *)

Extensions

284 removed by R. J. Mathar, Sep 06 2009

A146344 Records in A146326.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 18, 20, 26, 34, 42, 48, 50, 52, 54, 60, 66, 72, 76, 80, 84, 94, 96, 102, 104, 114, 122, 126, 130, 140, 148, 152, 156, 158, 178, 190, 192, 196, 202, 204, 206, 210, 228, 234, 248, 258, 268, 276, 294, 322, 332, 348, 352, 374, 376, 380, 398
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Crossrefs

Programs

  • Maple
    146326 := 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..1000)] ; RECORDS(a26)[1] ; # R. J. Mathar, Sep 06 2009
  • Mathematica
    f[n_] := Length @ ContinuedFraction[(1 + Sqrt[n])/2][[-1]]; fmax = -1; seq = {}; Do[f1 = f[n]; If[f1 > fmax, fmax = f1; AppendTo[seq, f1]], {n, 1, 10^4}]; seq (* Amiram Eldar, Apr 02 2020 *)

Formula

a(n) = A146326(A146345(n)). - Amiram Eldar, Apr 02 2020

Extensions

42 inserted by R. J. Mathar, Sep 06 2009
a(1) inserted and more terms added by Amiram Eldar, Apr 02 2020

A088307 Triangle, read by rows, T(n,k) = n^2 + k^2 if gcd(n,k)=1, otherwise 0.

Original entry on oeis.org

2, 5, 0, 10, 13, 0, 17, 0, 25, 0, 26, 29, 34, 41, 0, 37, 0, 0, 0, 61, 0, 50, 53, 58, 65, 74, 85, 0, 65, 0, 73, 0, 89, 0, 113, 0, 82, 85, 0, 97, 106, 0, 130, 145, 0, 101, 0, 109, 0, 0, 0, 149, 0, 181, 0, 122, 125, 130, 137, 146, 157, 170, 185, 202, 221, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 05 2003

Keywords

Comments

(n^2-k^2, 2*k*n, T(n,k)) is a primitive Pythagorean triple iff T(n,k) > 0.

Examples

			Triangle begins:
   2;
   5,  0;
  10, 13,  0;
  17,  0, 25,  0;
  26, 29, 34, 41,  0;
  37,  0,  0,  0, 61, 0;
  ...
		

Crossrefs

Programs

  • Magma
    function A088307(n,k)
      if GCD(k,n) eq 1 then return n^2+k^2;
      else return 0;
      end if; return A088307;
    end function;
    [A088307(n,k): k in [1..n], n in [1..13]]; // G. C. Greubel, Dec 16 2022
    
  • Mathematica
    Table[If[CoprimeQ[n,k],n^2+k^2,0],{n,20},{k,n}]//Flatten (* Harvey P. Dale, Jul 13 2018 *)
  • SageMath
    def A088307(n,k):
        if (gcd(n,k)==1): return n^2 + k^2
        else: return 0
    flatten([[A088307(n,k) for k in range(1,n+1)] for n in range(1,14)]) # G. C. Greubel, Dec 16 2022

Formula

T(n, n) = 2*A000007(n-1).
T(n, 1) = A002522(n).
T(2*n+1, 2) = A078370(n).
Sum_{k=1..n} A057427(T(n,m)) = A000010(n).
From G. C. Greubel, Dec 15 2022: (Start)
T(n, n-1) = A001844(n).
T(n, n-2) = ((1-(-1)^n)/2) * A008527((n+1)/2).
T(2*n, n) = 5*A000007(n-1).
T(2*n+1, n) = A079273(n+1).
T(2*n-1, n) = A190816(n).
Sum_{k=1..floor((n+1)/2)} T(n-k+1, k) = A053818(n+1) + [n=1]. (End)

A146364 a(n) = smallest primes whose continued fraction have different period.

Original entry on oeis.org

2, 5, 7, 17, 19, 31, 41, 43, 73, 89, 103, 139, 151, 179, 191, 193, 211, 241, 271, 331, 337, 379, 409, 421, 433, 463, 487, 491, 521, 541, 571, 601, 619, 631, 673, 739, 751, 769, 823, 919, 929, 937, 1033, 1039, 1051, 1201, 1249, 1291, 1321, 1399, 1439, 1471, 1531, 1579, 1609, 1699, 1747, 1753, 1759
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

This sequence is sorted A146363.

Crossrefs

Programs

  • Maple
    g:= proc(n) local c;
          c:= NumberTheory:-ContinuedFraction((1+sqrt(n))/2);
          nops(Term(c,periodic)[2]);
    end proc:
    R:= NULL: S:= {}: count:= 0:
    p:= 1:
    while count < 100 do
      p:= nextprime(p);
      v:= g(p);
      if not member(v,S) then
        R:= R,p; count:= count+1; S:= S union {v};
        if count mod 20 = 0 then printf("%d %d\n",count,p) fi
      fi
    od:
    R; # Robert Israel, Jun 14 2024
  • 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}]; Sort[bb] (*Artur Jasinski*)

Extensions

More terms from Robert Israel, Jun 14 2024

A146477 Numbers k for which A146326(k) is different from A146326(j) for j < k.

Original entry on oeis.org

2, 5, 6, 17, 18, 31, 41, 43, 73, 89, 94, 106, 118, 151, 172, 193, 211, 241, 265, 268, 331, 334, 337, 379, 394, 409, 421, 433, 463, 489, 521, 526, 601, 604, 619, 634, 673, 694, 718, 721, 751, 769, 886, 919, 929, 937, 1033, 1039, 1114, 1174, 1201, 1249, 1291, 1321, 1324, 1471, 1516, 1579, 1609
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

This sequence is sorted A146343.
Original name was: a(n) = smallest numbers which continued fractions have different period.

Crossrefs

Programs

  • Maple
    f:= proc(n) if issqr(n) then 0 else nops(numtheory:-cfrac((1+sqrt(n))/2,periodic,quotients)[2]) fi end proc:
    S:= {0}: R:= NULL: count:= 0:
    for n from 2 while count < 30 do
      v:= f(n);
      if not member(v,S) then
         count:= count+1; R:= R, n; S:= S union {v};
      fi
    od:
    R; # Robert Israel, May 02 2021
  • 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; Do[If[aa[[k]] == n && yes == 0, AppendTo[bb, k]; yes = 1], {k, 1, Length[aa]}], {n, 1, 22}]; Sort[bb]

Extensions

19 replaced by 18, 331 and 334 inserted by R. J. Mathar, Nov 08 2008
Name clarified by Robert Israel, May 02 2021

A146478 a(n) = length of period of continued fraction (1 + sqrt(prime(n)))/2.

Original entry on oeis.org

2, 2, 1, 4, 2, 1, 3, 6, 4, 1, 8, 3, 5, 10, 4, 1, 6, 3, 10, 8, 9, 4, 2, 7, 9, 3, 12, 6, 7, 7, 12, 6, 7, 18, 5, 20, 5, 18, 4, 1, 14, 5, 16, 15, 3, 20, 26, 4, 2, 1, 9, 12, 19, 14, 3, 12, 5, 24, 9, 15, 18, 1, 14, 16, 19, 3, 34, 21, 14, 9, 9, 4, 20, 7, 30, 8, 7, 5, 3, 27, 18, 13, 16, 23, 4, 2, 19, 23, 3
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

Subsequence of A146326 (length of period continued fraction of (1 + sqrt(n))/2).

Crossrefs

Programs

  • Maple
    A146478 := proc(p) local c; c := numtheory[cfrac](1/2+sqrt(p)/2,'periodic','quotients') ; nops(c[2]) ; end: for n from 1 to 100 do printf("%d,",A146478(ithprime(n))) ; od: # R. J. Mathar, Nov 05 2008
  • Mathematica
    Table[Length[ContinuedFraction[(1+Sqrt[Prime[n]])/2][[2]]],{n,100}] (* Zak Seidov, Mar 22 2011 *)

Extensions

a(59) changed from 7 to 9 by R. J. Mathar, Nov 05 2008

A308464 Squarefree numbers of the form m^2 + 4.

Original entry on oeis.org

5, 13, 29, 53, 85, 173, 229, 293, 365, 445, 533, 629, 733, 965, 1093, 1229, 1373, 1685, 1853, 2029, 2213, 2405, 2605, 2813, 3029, 3253, 3485, 3973, 4229, 4493, 4765, 5045, 5333, 5629, 5933, 6245, 6565, 6893, 7229, 7573, 8285, 8653, 9029, 9413, 9805
Offset: 1

Views

Author

Alonso del Arte, May 29 2019

Keywords

Comments

Yokoi's conjecture posits that, except for most of the values less than 365, the ring of algebraic integers of Q(sqrt(a(n))) has class number greater than 1. Only one counterexample to this conjecture may exist, and it would also be a counterexample to the generalized Riemann hypothesis, according to Mollin (1996).
All terms == 5 (mod 8). - Robert Israel, Jun 05 2019

References

  • Richard A. Mollin, Quadratics. Boca Raton, Florida: CRC Press (1996): 176 - 177.

Crossrefs

Cf. A078370, A087475 (supersequences).

Programs

  • Maple
    select(numtheory:-issqrfree,[seq(m^2+4,m=1..1000,2)]); # Robert Israel, Jun 05 2019
  • Mathematica
    Select[(2Range[50] - 1)^2 + 4, MoebiusMu[#] != 0 &]
    Select[Table[i^2 + 4, {i, 1, 100}], SquareFreeQ] (* Navvye Anand, Jun 20 2024 *)
  • PARI
    is(n) = issquarefree(n) && issquare(n-4) \\ Felix Fröhlich, May 29 2019

A319749 a(n) is the numerator of the Heron sequence with h(0)=3.

Original entry on oeis.org

3, 11, 119, 14159, 200477279, 40191139395243839, 1615327685887921300502934267457919, 2609283532796026943395592527806764363779539144932833602430435810559
Offset: 0

Views

Author

Paul Weisenhorn, Sep 27 2018

Keywords

Comments

The denominator of the Heron sequence is in A319750.
The following relationship holds between the numerator of the Heron sequence and the numerator of the continued fraction A041018(n)/A041019(n) convergent to sqrt(13).
n even: a(n)=A041018((5*2^n-5)/3).
n odd: a(n)=A041018((5*2^n-1)/3).
More generally, all numbers c(n)=A078370(n)=(2n+1)^2+4 have the same relationship between the numerator of the Heron sequence and the numerator of the continued fraction convergent to 2n+1.
sqrt(c(n)) has the continued fraction 2n+1; n,1,1,n,4n+2.
hn(n)^2-c(n)*hd(n)^2=4 for n>1.
From Peter Bala, Mar 29 2022: (Start)
Applying Heron's method (sometimes called the Babylonian method) to approximate the square root of the function x^2 + 4, starting with a guess equal to x, produces the sequence of rational functions [x, 2*T(1,(x^2+2)/2)/x, 2*T(2,(x^2+2)/2)/( 2*x*T(1,(x^2+2)/2) ), 2*T(4,(x^2+2)/2)/( 4*x*T(1,(x^2+2)/2)*T(2,(x^2+2)/2) ), 2*T(8,(x^2+2)/2)/( 8*x*T(1,(x^2+2)/2)*T(2,(x^2+2)/2)*T(4,(x^2+2)/2) ), ...], where T(n,x) denotes the n-th Chebyshev polynomial of the first kind. The present sequence is the case x = 3. Cf. A001566 and A058635 (case x = 1), A081459 and A081460 (essentially the case x = 4). (End)

Examples

			A078370(2)=29.
hn(0)=A041046(0)=5; hn(1)=A041046(3)=27; hn(2)=A041046(5)=727;
hn(3)=A041046(13)=528527.
		

Crossrefs

2*T(2^n,x/2) modulo differences of offset: A001566 (x = 3 and x = 7), A003010 (x = 4), A003487 (x = 5), A003423 (x = 6), A346625 (x = 8), A135927 (x = 10), A228933 (x = 18).

Programs

  • Maple
    hn[0]:=3:  hd[0]:=1:
    for n from 1 to 6 do
    hn[n]:=(hn[n-1]^2+13*hd[n-1]^2)/2:
    hd[n]:=hn[n-1]*hd[n-1]:
       printf("%5d%40d%40d\n", n, hn[n], hd[n]):
    end do:
    #alternative program
    a := n -> if n = 0 then 3 else simplify( 2*ChebyshevT(2^(n-1), 11/2) ) end if:
    seq(a(n), n = 0..7); # Peter Bala, Mar 16 2022
  • Python
    def aupton(nn):
        hn, hd, alst = 3, 1, [3]
        for n in range(nn):
            hn, hd = (hn**2 + 13*hd**2)//2, hn*hd
            alst.append(hn)
        return alst
    print(aupton(7)) # Michael S. Branicky, Mar 16 2022

Formula

h(n) = hn(n)/hd(n); hn(0)=3; hd(0)=1.
hn(n+1) = (hn(n)^2+13*hd(n)^2)/2.
hd(n+1) = hn(n)*hd(n).
A041018(n) = A010122(n)*A041018(n-1) + A041018(n-2).
A041019(n) = A010122(n)*A041019(n-1) + A041019(n-2).
From Peter Bala, Mar 16 2022: (Start)
a(n) = 2*T(2^(n-1),11/2) for n >= 1, where T(n,x) denotes the n-th Chebyshev polynomial of the first kind.
a(n) = 2*T(2^n, 3*sqrt(-1)/2) for n >= 2.
a(n) = ((11 + 3*sqrt(13))/2)^(2^(n-1)) + ((11 - 3*sqrt(13))/2)^(2^(n-1)) for n >= 1.
a(n+1) = a(n)^2 - 2 for n >= 1.
a(n) = A057076(2^(n-1)) for n >= 1.
Engel expansion of (1/6)*(13 - 3*sqrt(13)); that is, (1/6)*(13 - 3*sqrt(13)) = 1/3 + 1/(3*11) + 1/(3*11*119) + .... (Define L(n) = (1/2)*(n - sqrt(n^2 - 4)) for n >= 2 and show L(n) = 1/n + L(n^2-2)/n. Iterate this relation with n = 11. See also Liardet and Stambul, Section 4.)
sqrt(13) = 6*Product_{n >= 0} (1 - 1/a(n)).
sqrt(13) = (9/5)*Product_{n >= 0} (1 + 2/a(n)). See A001566. (End)

Extensions

a(6) and a(7) added by Peter Bala, Mar 16 2022

A319750 a(n) is the denominator of the Heron sequence with h(0) = 3.

Original entry on oeis.org

1, 3, 33, 3927, 55602393, 11147016454528647, 448011292165037607943004375755833, 723685043824607606355691108666081531638582859833105061571146291527
Offset: 0

Views

Author

Paul Weisenhorn, Sep 27 2018

Keywords

Comments

The numerators of the Heron sequence are in A319749.
There is the following relationship between the denominator of the Heron sequence and the denominator of the continued fraction A041018(n)/ A041019(n) convergent to sqrt(13).
n even: a(n) = A041019((5*2^n-5)/3).
n odd: a(n) = A041019((5*2^n-1)/3).
General: all numbers c(n) = A078370(n) = (2*n+1)^2 + 4 have the same relationship between the denominator of the Heron sequence and the denominator of the continued fraction convergent to 2*n+1.
sqrt(c(n)) has the continued fraction [2*n+1; n, 1, 1, n, 4*n+2].
hn(n)^2 - c(n)*hd(n)^2 = 4 for n > 1.

Examples

			A078370(2) = 29.
hd(0) = A041047(0) = 1, hd(1) = A041047(3) = 5,
hd(2) = A041047(5) = 135, hd(3) = A041047(13) = 38145.
		

Crossrefs

Programs

  • Maple
    hn[0]:=3: hd[0]:=1:
    for n from 1 to 6 do
      hn[n]:=(hn[n-1]^2+13*hd[n-1]^2)/2:
      hd[n]:=hn[n-1]*hd[n-1]:
      printf("%5d%40d%40d\n", n, hn[n], hd[n]):
    end do:
  • Python
    def aupton(nn):
        hn, hd, alst = 3, 1, [1]
        for n in range(nn):
            hn, hd = (hn**2 + 13*hd**2)//2, hn*hd
            alst.append(hd)
        return alst
    print(aupton(7)) # Michael S. Branicky, Mar 15 2022

Formula

h(n) = hn(n)/hd(n), hn(0) = 3, hd(0) = 1.
hn(n+1) = (hn(n)^2 + 13*hd(n)^2)/2.
hd(n+1) = hn(n)*hd(n).
A041018(n) = A010122(n)*A041018(n-1) + A041018(n-2).
A041019(n) = A010122(n)*A041019(n-1) + A041019(n-2).
a(0) = 1, a(1) = 3 and a(n) = 2*T(2^(n-2), 11/2)*a(n-1) for n >= 2, where T(n,x) denotes the n-th Chebyshev polynomial of the first kind. - Peter Bala, Mar 16 2022

Extensions

a(5) corrected and terms a(6) and a(7) added by Peter Bala, Mar 15 2022
Previous Showing 41-50 of 52 results. Next