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

A010465 Decimal expansion of square root of 7.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Continued fraction expansion is 2 followed by {1, 1, 1, 4} repeated. - Harry J. Smith, Jun 01 2009
The convergents to sqrt(7) are given in A041008/A041009. - Wolfdieter Lang, Nov 22 2017

Examples

			2.645751311064590590501615753639260425710259183082450180368334459201...
		

Crossrefs

Cf. A010121 (continued fraction), A041008/A041009.

Programs

  • Magma
    SetDefaultRealField(RealField(100)); Sqrt(7); // Vincenzo Librandi, Feb 15 2020
  • Mathematica
    RealDigits[N[Sqrt[7], 200]][[1]] (* Vladimir Joseph Stephan Orlovsky, Feb 21 2011 *)
  • PARI
    default(realprecision, 20080); x=sqrt(7); for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b010465.txt", n, " ", d));  \\ Harry J. Smith, Jun 01 2009
    

Formula

Equals 8*cos(Pi/14)*sin(2*Pi/14)*cos(3*Pi/14). - Gerry Martens, Mar 13 2025

A233587 Coefficients of the generalized continued fraction expansion sqrt(7) = a(1) +a(1)/(a(2) +a(2)/(a(3) +a(3)/(a(4) +a(4)/....))).

Original entry on oeis.org

2, 3, 30, 34, 111, 235, 3775, 5052, 7352, 9091, 34991, 35530, 53424, 57290, 66023, 1409179, 1519111, 1725990, 1812396, 4370835, 4507156, 4655396, 44257080, 234755198, 261519946, 264374278, 273487975
Offset: 1

Views

Author

Stanislav Sykora, Jan 06 2014

Keywords

Comments

For more details on Blazys' expansions, see A233582.
Sqrt(7) is the first square root of a natural number with an a-periodic Blazys' expansion (see A233592 and A233593).

Crossrefs

Cf. Blazys' expansions: A233582 (Pi), A233583 (e), A233584 (sqrt(e)), A233585 (1/gamma), A233585 (2*gamma) and Blazys' continued fractions: A233588, A233589, A233590, A233591.

Programs

  • Mathematica
    BlazysExpansion[n_, mx_] := Block[{k = 1, x = n, lmt = mx + 1, s, lst = {}}, While[k < lmt, s = Floor[x]; x = 1/(x/s - 1); AppendTo[lst, s]; k++]; lst]; BlazysExpansion[Sqrt@7, 32] (* Robert G. Wilson v, May 22 2014 *)
  • PARI
    bx(x, nmax)={local(c, v, k); \\ Blazys expansion function
    v = vector(nmax); c = x; for(k=1, nmax, v[k] = floor(c); c = v[k]/(c-v[k]); ); return (v); }
    bx(sqrt(7), 1000) \\ Execution; use very high real precision

Formula

sqrt(7) = 2+2/(3+3/(30+30/(34+34/(111+...)))).

A168077 a(2n) = A129194(2n)/2; a(2n+1) = A129194(2n+1).

Original entry on oeis.org

0, 1, 1, 9, 4, 25, 9, 49, 16, 81, 25, 121, 36, 169, 49, 225, 64, 289, 81, 361, 100, 441, 121, 529, 144, 625, 169, 729, 196, 841, 225, 961, 256, 1089, 289, 1225, 324, 1369, 361, 1521, 400, 1681, 441, 1849, 484, 2025, 529, 2209, 576, 2401, 625, 2601
Offset: 0

Views

Author

Paul Curtz, Nov 18 2009

Keywords

Comments

From Paul Curtz, Mar 26 2011: (Start)
Successive A026741(n) * A026741(n+p):
p=0: 0, 1, 1, 9, 4, 25, 9, a(n),
p=1: 0, 1, 3, 6, 10, 15, 21, A000217,
p=2: 0, 3, 2, 15, 6, 35, 12, A142705,
p=3: 0, 2, 5, 9, 14, 20, 27, A000096,
p=4: 0, 5, 3, 21, 8, 45, 15, A171621,
p=5: 0, 3, 7, 12, 18, 25, 33, A055998,
p=6: 0, 7, 4, 27, 10, 55, 18,
p=7: 0, 4, 9, 15, 22, 30, 39, A055999,
p=8: 0, 9, 5, 33, 12, 65, 21, (see A061041),
p=9: 0, 5, 11, 18, 26, 35, 45, A056000. (End)
The moment generating function of p(x, m=2, n=1, mu=2) = 4*x*E(x, 2, 1), see A163931 and A274181, is given by M(a) = (-4 * log(1-a) - 4 * polylog(2, a))/a^2. The series expansion of M(a) leads to the sequence given above. - Johannes W. Meijer, Jul 03 2016
Multiplicative because both A129194 and A040001 are. - Andrew Howroyd, Jul 26 2018

Crossrefs

Programs

  • Magma
    I:=[0,1,1,9,4,25]; [n le 6 select I[n] else 3*Self(n-2)-3*Self(n-4)+Self(n-6): n in [1..60]]; // Vincenzo Librandi, Jul 10 2016
    
  • Maple
    a := proc(n): n^2*(5-3*(-1)^n)/8 end: seq(a(n), n=0..46); # Johannes W. Meijer, Jul 03 2016
  • Mathematica
    LinearRecurrence[{0,3,0,-3,0,1},{0,1,1,9,4,25},60] (* Harvey P. Dale, May 14 2011 *)
    f[n_] := Numerator[(n/2)^2]; Array[f, 60, 0] (* Robert G. Wilson v, Dec 18 2012 *)
    CoefficientList[Series[x(1+x+6x^2+x^3+x^4)/((1-x)^3(1+x)^3), {x,0,60}], x] (* Vincenzo Librandi, Jul 10 2016 *)
  • PARI
    concat(0, Vec(x*(1+x+6*x^2+x^3+x^4)/((1-x)^3*(1+x)^3) + O(x^60))) \\ Altug Alkan, Jul 04 2016
    
  • PARI
    a(n) = lcm(4, n^2)/4; \\ Andrew Howroyd, Jul 26 2018
    
  • Sage
    (x*(1+x+6*x^2+x^3+x^4)/(1-x^2)^3).series(x, 60).coefficients(x, sparse=False) # G. C. Greubel, Feb 20 2019

Formula

From R. J. Mathar, Jan 22 2011: (Start)
G.f.: x*(1 + x + 6*x^2 + x^3 + x^4) / ((1-x)^3*(1+x)^3).
a(n) = 3*a(n-2) - 3*a(n-4) + a(n-6).
a(n) = n^2*(5 - 3*(-1)^n)/8. (End)
a(n) = A026741(n)^2.
a(2*n) = A000290(n); a(2*n+1) = A016754(n).
a(n) - a(n-4) = 4*A064680(n+2). - Paul Curtz, Mar 27 2011
4*a(n) = A061038(n) * A010121(n+2) = A109043(n)^2, n >= 2. - Paul Curtz, Apr 07 2011
a(n) = A129194(n) / A040001(n). - Andrew Howroyd, Jul 26 2018
From Peter Bala, Feb 19 2019: (Start)
a(n) = numerator(n^2/(n^2 + 4)) = n^2/(gcd(n^2,4)) = (n/gcd(n,2))^2.
a(n) = n^2/b(n), where b(n) = [1, 4, 1, 4, ...] is a purely periodic sequence of period 2. Thus a(n) is a quasi-polynomial in n.
O.g.f.: x*(1 + x)/(1 - x)^3 - 3*x^2*(1 + x^2)/(1 - x^2)^3.
Cf. A181318. (End)
From Werner Schulte, Aug 30 2020: (Start)
Multiplicative with a(2^e) = 2^(2*e-2) for e > 0, and a(p^e) = p^(2*e) for prime p > 2.
Dirichlet g.f.: zeta(s-2) * (1 - 3/2^s).
Dirichlet convolution with A259346 equals A000290.
Sum_{n>0} 1/a(n) = Pi^2 * 7 / 24. (End)
Sum_{k=1..n} a(k) ~ (5/24) * n^3. - Amiram Eldar, Nov 28 2022

A171621 Numerator of 1/4 - 1/n^2, each fourth term multiplied by 4.

Original entry on oeis.org

0, 5, 3, 21, 8, 45, 15, 77, 24, 117, 35, 165, 48, 221, 63, 285, 80, 357, 99, 437, 120, 525, 143, 621, 168, 725, 195, 837, 224, 957, 255, 1085, 288, 1221, 323, 1365, 360, 1517, 399, 1677, 440, 1845, 483, 2021, 528
Offset: 2

Views

Author

Paul Curtz, Dec 13 2009

Keywords

Comments

These are the square roots of the fifth column of the array of denominators mentioned in A171522.

Crossrefs

Programs

  • Magma
    [-(-5+3*(-1)^n)*(-4+n^2)/8: n in [0..100]]; // G. C. Greubel, Sep 19 2018
  • Maple
    A061037 := proc(n) 1/4-1/n^2 ; numer(%) ; end proc:
    A171621 := proc(n) if n mod 4 = 2 then 4*A061037(n) ; else A061037(n) ; end if; end proc:
    seq(A171621(n),n=2..90) ; # R. J. Mathar, Apr 02 2011
  • Mathematica
    Table[-(-5+3*(-1)^n)*(-4+n^2)/8, {n,0,100}] (* G. C. Greubel, Sep 19 2018 *)
    LinearRecurrence[{0,3,0,-3,0,1},{0,5,3,21,8,45},50] (* Harvey P. Dale, Nov 01 2019 *)
  • PARI
    concat(0, Vec(x^3*(-5-3*x-6*x^2+x^3+3*x^4)/((x-1)^3*(1+x)^3) + O(x^100))) \\ Colin Barker, Nov 03 2014
    

Formula

a(n) = A061037(n) * A010121(n+2).
a(2n+2) = A005563(n). a(2n+3) = A078371(n).
G.f.: x^3*(-5-3*x-6*x^2+x^3+3*x^4) / ( (x-1)^3*(1+x)^3 ). - R. J. Mathar, Apr 02 2011
a(n) = -(-5+3*(-1)^n)*(-4+n^2)/8. - Colin Barker, Nov 03 2014
Sum_{n>=3} 1/a(n) = 13/12. - Amiram Eldar, Aug 11 2022

A283971 a(n) = n except a(4*n + 2) = 2*n + 1.

Original entry on oeis.org

0, 1, 1, 3, 4, 5, 3, 7, 8, 9, 5, 11, 12, 13, 7, 15, 16, 17, 9, 19, 20, 21, 11, 23, 24, 25, 13, 27, 28, 29, 15, 31, 32, 33, 17, 35, 36, 37, 19, 39, 40, 41, 21, 43, 44, 45, 23, 47, 48, 49, 25, 51, 52, 53, 27, 55, 56, 57, 29, 59, 60, 61, 31, 63, 64, 65, 33, 67
Offset: 0

Views

Author

Paul Curtz, Mar 18 2017

Keywords

Comments

From Federico Provvedi, Nov 13 2018: (Start)
For n > 1, a(n) is also the cycle length generated by the cycle lengths of the digital roots, in base n, of the powers of k, with k > 0.
Example for n=10 (decimal base): for every h >= 0, the digital roots of 2^h generate a periodic cycle {1,2,4,8,7,5} with period 6; 3^h generates {1,3,9,9,9,9,...} so the periodic cycle {9} has period 1; 4^h generates the periodic cycle {1,4,7} with period 3; etc. So, for n=10 (decimal base representation) the sequence generated by the periods of the digital roots of powers of k (with k > 0) is also periodic {1,6,1,3,6,1,3,2,1} with period 9, hence a(10) = 9. (End)

Crossrefs

Programs

  • GAP
    a:=[0,1,1,3,4,5,3,7];; for n in [9..85] do a[n]:=2*a[n-4]-a[n-8]; od; a; # Muniru A Asiru, Jul 20 2018
    
  • Maple
    seq(coeff(series(x*(1+x+3*x^2+4*x^3+3*x^4+x^5+x^6)/((1-x)^2*(1+x)^2*(1+x^2)^2), x,n+1),x,n),n=0..80); # Muniru A Asiru, Jul 20 2018
  • Mathematica
    Table[If[Mod[n, 4] == 2, (n - 2)/2 + 1, n], {n, 67}] (* or *)
    CoefficientList[Series[x (1 + x + 3 x^2 + 4 x^3 + 3 x^4 + x^5 + x^6)/((1 - x)^2*(1 + x)^2*(1 + x^2)^2), {x, 0, 67}], x] (* Michael De Vlieger, Mar 19 2017 *)
    LinearRecurrence[{0, 0, 0, 2, 0, 0, 0, -1}, {0, 1, 1, 3, 4, 5, 3, 7}, 70] (* Robert G. Wilson v, Jul 23 2018 *)
    Table[Length[FindTransientRepeat[(Length[FindTransientRepeat[Mod[#1^Range[b]-1,b-1]+1,2][[2]]]&)/@Range[2, 2*b], 2][[2]]], {b, 2, 100}] (* Federico Provvedi, Nov 13 2018 *)
  • PARI
    a(n)=if(n%4==2, n\4*2 + 1, n) \\ Charles R Greathouse IV, Mar 18 2017
    
  • PARI
    concat(0, Vec(x*(1 + x + 3*x^2 + 4*x^3 + 3*x^4 + x^5 + x^6) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2) + O(x^40))) \\ Colin Barker, Mar 19 2017
    
  • Python
    def A283971(n): return n if (n-2)&3 else n>>1 # Chai Wah Wu, Jan 10 2023

Formula

a(2*n) = A022998(n), a(1+2*n) = 1 + 2*n.
a(n) = 2*a(n-4) - a(n-8).
From Colin Barker, Mar 19 2017: (Start)
G.f.: x*(1 + x + 3*x^2 + 4*x^3 + 3*x^4 + x^5 + x^6) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2).
a(n) = -((-1)^n - (-i)^n - i^n - 7)*n/8, where i = sqrt(-1).
(End)
a(n) = A060819(n) * periodic sequence of length 4: repeat [4, 1, 1, 1].
a(n) = a(n-4) + periodic sequence of length 4: repeat [4, 4, 2, 4].
From Werner Schulte, Jul 08 2018: (Start)
For n > 0, a(n) is multiplicative with a(p^e) = p^e for prime p >= 2 and e >= 0 except a(2^1) = 1.
Dirichlet g.f.: (1 - 1/2^s - 1/2^(2*s-1)) * zeta(s-1).
(End)
a(n) = n*(7 + cos(n*Pi/2) - cos(n*Pi) + cos(3*n*Pi/2))/8. - Wesley Ivan Hurt, Oct 04 2018
E.g.f.: (1/4)*x*(4*cosh(x) - sin(x) + 3*sinh(x)). - Franck Maminirina Ramaharo, Nov 13 2018
Sum_{k=1..n} a(k) ~ (7/16) * n^2. - Amiram Eldar, Nov 28 2022

A098457 Farey Bisection Expansion of sqrt(7).

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1
Offset: 1

Views

Author

John W. Layman, Sep 08 2004

Keywords

Comments

We define the Farey Bisection Expansion (FBE) of the nonnegative real number x to be the sequence {a(n)} of 0's and 1's determined as follows. Set na(0)=0, da(0)=1, nb(0)=1 and db(0)=0. For n=1, 2, 3,..., set num=na(n-1)+nb(n-1) and den=da(n-1)+db(n-1); if xA010121.

Examples

			G.f. = x + x^2 + x^4 + x^6 + x^7 + x^8 + x^9 + x^11 + x^13 + x^14 + x^15 + ...
		

Crossrefs

Programs

  • Magma
    &cat [[1, 1, 0, 1, 0, 1, 1]^^20]; // Wesley Ivan Hurt, Jul 11 2016
    
  • Maple
    seq(op([1, 1, 0, 1, 0, 1, 1]), n=0..20); # Wesley Ivan Hurt, Jul 11 2016
  • Mathematica
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 1},{1, 1, 0, 1, 0, 1, 1},105] (* Ray Chandler, Aug 26 2015 *)
  • PARI
    {a(n) = [1, 1, 0, 1, 0, 1, 1][(n-1)%7+1]}; /* Michael Somos, Dec 26 2016 */

Formula

From Wesley Ivan Hurt, Jul 11 2016: (Start)
G.f.: x * (1 + x + x^3 + x^5 + x^6) / (1 - x^7).
a(n) = a(n-7) for n>7.
a(n) = 1 - Sum_{k=1..4} floor((n + k)/7)*(-1)^k. (End)
a(n+1) = (-1)^(mod(mod(n, 7), 3)>0) * A131372(n). - Michael Somos, Dec 26 2016

A109054 Squares and numbers k such that the continued fraction expansion of sqrt(k) is multiplicative.

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 9, 13, 14, 15, 16, 22, 23, 24, 25, 32, 33, 34, 35, 36, 44, 47, 48, 49, 58, 59, 60, 62, 63, 64, 74, 75, 78, 79, 80, 81, 95, 96, 98, 99, 100, 114, 119, 120, 121, 135, 136, 138, 140, 141, 142, 143, 144, 160, 162, 164, 167, 168, 169, 185, 187, 189, 192
Offset: 1

Views

Author

Mitch Harris, Jun 18 2005

Keywords

Comments

If we consider each square k as having a continued fraction expansion c of all zeros after c(0) = sqrt(k)-1, then the continued fraction expansion of sqrt(k) for each square is trivially multiplicative.
For nonsquares, c(1) must be 1 and so k must satisfy m + 1/2 < sqrt(k) <= m+1, for some integer m.

Examples

			The continued fraction of sqrt(22) is c = (4; 1, 2, 4, 2, 1, 8, ...) = A010126, which is multiplicative with c(2^e) = 2, c(3^e) = 4, c(p^e) = 1 otherwise.
		

Crossrefs

Union of A000290 and A108575.
Continued fraction expansions: A040001, A010121, A040005, etc.

A187142 Smallest number k such that the continued fraction expansion of sqrt(k) contains n distinct numbers.

Original entry on oeis.org

1, 2, 7, 14, 19, 61, 94, 151, 211, 436, 604, 844, 919, 1324, 1894, 2011, 2731, 3691, 4951, 5086, 6451, 7606, 9619, 10294, 13126, 15814, 17599, 21499, 19231, 21319, 30319, 31606, 34654, 42379, 46006, 53299, 48799, 60811, 76651, 78094, 85999, 90931
Offset: 1

Views

Author

Keywords

Comments

For the first 191 terms, a(n) has the form p*2^i, where p is prime and i >= 0. - T. D. Noe, Mar 07 2011
Looking at just the periodic part of sqrt(k), it is the same sequence without the term a(1). - Robert G. Wilson v, Mar 22 2011
Conjecture: a(n) is of the form p, 2*p or 4*p, where p is prime. For the first 528 terms, a(n) is of the form 4*p only for n = 10, 11, 12, 14, 81 and 277. - Chai Wah Wu, Oct 04 2019

Examples

			ContinuedFraction(sqrt(2),x) => 1,2,2,2,...: two distinct terms (1,2);
sqrt(7) => 2,1,1,1,4,1,1,1,...: three distinct terms (1,2,4);
sqrt(14) => four distinct terms (1,2,3,6);
sqrt(19) => five distinct terms (1,2,3,4,8).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ Union@ Flatten@ ContinuedFraction@ Sqrt@ n; t = Table[ 0, {100}]; Do[a = f@ k; If[ a <= 100 && t[[a]] == 0, t[[a]] = k; Print[{a, k}]], {k, 10^5}]; t

A307453 a(n) is the least prime p for which the continued fraction expansion of sqrt(p) has exactly n consecutive 1's starting at position 2.

Original entry on oeis.org

2, 3, 31, 7, 13, 3797, 5273, 4987, 90371, 79873, 2081, 111301, 1258027, 5325101, 12564317, 9477889, 47370431, 709669249, 1529640443, 2196104969, 392143681, 8216809361, 30739072339, 200758317433, 370949963971, 161356959383, 1788677860531, 7049166342469, 4484287435283, 3690992602753
Offset: 0

Views

Author

Michel Marcus, Apr 09 2019

Keywords

Examples

			For p = 2,  we have [1; 2, ...]; see A040000.
For p = 3,  we have [1; 1, 2, ...]; see A040001.
For p = 31, we have [5; 1, 1, 3, ...]; see A010129.
For p = 7,  we have [2; 1, 1, 1, 4, ...]; see A010121.
		

Crossrefs

Programs

  • PARI
    isok(p, n) = {my(c=contfrac(sqrt(p)));  for (k=2, n+1, if (c[k] != 1, return (0));); return(c[n+2] !=  1);}
    a(n) = {my(p=2); while (! isok(p, n), p = nextprime(p+1)); p;}

Formula

Limit_{n->infinity} (sqrt(a(n)) - floor(sqrt(a(n)))) = A094214. - Daniel Suteu, Apr 09 2019

Extensions

a(21)-a(29) from Daniel Suteu, Apr 09 2019
a(0) added by Chai Wah Wu, Apr 09 2019

A320839 Factorial expansion of sqrt(7) = Sum_{n>=1} a(n)/n!.

Original entry on oeis.org

2, 1, 0, 3, 2, 2, 6, 4, 6, 2, 3, 11, 2, 8, 11, 8, 16, 5, 5, 16, 19, 5, 1, 14, 16, 7, 14, 10, 27, 12, 10, 29, 28, 19, 16, 3, 6, 4, 28, 33, 24, 21, 42, 10, 2, 45, 3, 34, 4, 1, 46, 48, 8, 5, 41, 20, 53, 17, 31, 50, 10, 6, 56, 27, 29, 18, 15, 11, 19, 49, 37, 64, 56, 51, 34, 21, 3, 27, 15, 61
Offset: 1

Views

Author

G. C. Greubel, Dec 10 2018

Keywords

Examples

			sqrt(7) = 2 + 1/2! + 0/3! + 3/4! + 2/5! + 2/6! + 6/7! + 4/8! + 6/9! + ...
		

Crossrefs

Cf. A010465 (decimal expansion), A010121 (continued fraction).
Cf. A009949 (sqrt(2)), A067881 (sqrt(3)), A068446 (sqrt(5)).

Programs

  • Maple
    Digits:=200: a:=n->`if`(n=1,floor(sqrt(7)),floor(factorial(n)*sqrt(7))-n*floor(factorial(n-1)*sqrt(7))): seq(a(n),n=1..90); # Muniru A Asiru, Dec 10 2018
Showing 1-10 of 14 results. Next