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 39 results. Next

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

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

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

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

A146360 Primes p such that continued fraction of (1 + sqrt(p))/2 has period 15: primes in A146338.

Original entry on oeis.org

193, 281, 1861, 1933, 2089, 2141, 2437, 2741, 2837, 3037, 3121, 3413, 4001, 4637, 4877, 5821, 6653, 7673, 8117, 10069, 10273, 10457, 11197, 11549, 11821, 12409, 13037, 14653, 15061, 15077, 18661, 20549, 22921, 23117, 24169, 25621, 28837, 35597, 35869, 36389, 38569
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: isA146360 := proc(n) RETURN(isprime(n) and A146326(n) = 15) ; end: for n from 2 to 30000 do if isA146360(n) then printf("%d,\n",n) ; fi; od: # R. J. Mathar, Sep 06 2009
  • Mathematica
    Select[Prime[Range[1500]],Length[ContinuedFraction[(Sqrt[#]+1)/2][[2]]] == 15&] (* Harvey P. Dale, Aug 16 2014 *)

Extensions

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

A005473 Primes of form k^2 + 4.

Original entry on oeis.org

5, 13, 29, 53, 173, 229, 293, 733, 1093, 1229, 1373, 2029, 2213, 3253, 4229, 4493, 5333, 7229, 7573, 9029, 9413, 10613, 13229, 13693, 15629, 18229, 18773, 21613, 24029, 26573, 27893, 31333, 33493, 37253, 41213, 42853, 46229, 47093, 54293
Offset: 1

Views

Author

Keywords

Comments

a(n) mod 24 = 5 or 13 and if a(n) mod 24 =13 then a(n) mod 72 = 13.
From Artur Jasinski, Oct 30 2008: (Start)
Primes p such that the continued fraction of (1+sqrt(p))/2 has period 1.
Primes in A078370 = primes of the form 4*k^2 + 4*k + 5 = (2*k+1)^2 + 4.
(End)
Starting at a(3) all the primes in this sequence can be expressed as the following sum: ((2*k+1)*(2*k+3)+(2*k+3)*(2*k+5)+(2*k+5)+(2*k+7)+(2*k+7)*(2*k+9))/4 for some values (not all!) of k>=0. Thus for a(5)=173 the sum is (9*11 + 11*13 + 13*15 + 15*17)/4=173. - J. M. Bergot, Nov 03 2014

Examples

			a(2)=29 since 29=5^2+4 is prime.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A185086.
a(n)-4 is contained in A016754. (a(n)-5)/8 is contained in A000217. Either (a(n)-5)/24 is contained in A001318 (if a(n) mod 24=5) or (a(n)-13)/72 is contained in A000217 (if a(n) mod 24=13). Floor[a(n)/24] is contained in A001840.

Programs

  • Haskell
    a005473 n = a005473_list !! (n-1)
    a005473_list = filter ((== 1) . a010051') $ map (+ 4) a000290_list
    -- Reinhard Zumkeller, Mar 12 2012
  • Magma
    [a: n in [0..300] | IsPrime(a) where a is n^2+4]; // Vincenzo Librandi, Nov 30 2011
    
  • Maple
    select(isprime,[seq(4*k^2 + 4*k + 5, k=0..1000)]); # Robert Israel, Nov 02 2014
  • Mathematica
    Intersection[Table[n^2+4,{n,0,10^2}],Prime[Range[9*10^3]]] ...or... For[i=4,i<=4,a={};Do[If[PrimeQ[n^2+i],AppendTo[a,n^2+i]],{n,0,100}];Print["n^2+",i,",",a];i++ ] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
    aa = {}; Do[If[PrimeQ[4 k^2 + 4 k + 5], AppendTo[aa, 4 k^2 + 4 k + 5]], {k, 0, 200}]; aa (* Artur Jasinski, Oct 30 2008 *)
    Select[Table[n^2+4,{n,0,7000}],PrimeQ] (* Vincenzo Librandi, Nov 30 2011 *)
  • PARI
    for(n=1,1e3,if(isprime(t=n^2+4),print1(t","))) \\ Charles R Greathouse IV, Jul 05 2011
    

Formula

a(n) = 24*A056904(n)+m, where m=13 if A056904(n) is three times a triangular number (and n>0) and m=5 if A056904(n) is not three times a triangular number (or n=0).
For n>=2, a(n) = A098062(n-1). - Zak Seidov, Apr 12 2007

Extensions

More terms and additional comments from Henry Bottomley, Jul 06 2000

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
Showing 1-10 of 39 results. Next