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

A246063 First occurrence of n in sequence A112329.

Original entry on oeis.org

2, 1, 3, 9, 15, 64, 45, 256, 96, 144, 192, 4096, 240, 16384, 768, 576, 480, 262144, 720, 1048576, 960, 2304, 12288, 16777216, 1440, 5184, 49152, 3600, 3840, 1073741824, 2880, 4294967296, 3360, 36864, 786432, 20736, 5040, 274877906944, 3145728, 147456, 6720
Offset: 0

Views

Author

Ray Chandler, Aug 24 2014

Keywords

Comments

Inspired by a comment from Robert G. Wilson v in sequence A112329.

Crossrefs

Programs

  • Mathematica
    g[lst_,p_]:=Module[{t,i,j},Union[Flatten[Table[t=lst[[i]];t[[j]]=p*t[[j]];Sort[t],{i,Length[lst]},{j,Length[lst[[i]]]}],1],Table[Sort[Append[lst[[i]],p]],{i,Length[lst]}]]];f[n_]:=Module[{i,j,p,e,lst={{}}},{p,e}=Transpose[FactorInteger[n]];Do[lst=g[lst,p[[i]]],{i,Length[p]},{j,e[[i]]}];lst];
    (* above factor functions from T. D. Noe in A162247 *)
    nmax=100;
    a1={2,1,3};
    Do[
    least=Infinity;
    fn=f[n];
    Do[
    exps=Reverse[fnitem]-1;
    odd=even=1;
    cnt=0;
    Do[
    cnt++;
    odd*=(Prime[cnt+1]^exp);
    even*=(Prime[cnt]^exp);
    ,{exp,exps}];
    least=Min[least,odd,4even];
    ,{fnitem,fn}];
    AppendTo[a1,least];
    ,{n,3,nmax}];
    a1
  • PARI
    d(n) = if (denominator(n)==1, numdiv(n), 0);
    f(n) = numdiv(n) - 2*d(n/2) + 2*d(n/4);
    a(n) = {my(k = 1); while (f(k) != n, k++); k;} \\ Michel Marcus, Jul 30 2017

Formula

a(p) = 2^(p+1) for prime p >= 5.

A048272 Number of odd divisors of n minus number of even divisors of n.

Original entry on oeis.org

1, 0, 2, -1, 2, 0, 2, -2, 3, 0, 2, -2, 2, 0, 4, -3, 2, 0, 2, -2, 4, 0, 2, -4, 3, 0, 4, -2, 2, 0, 2, -4, 4, 0, 4, -3, 2, 0, 4, -4, 2, 0, 2, -2, 6, 0, 2, -6, 3, 0, 4, -2, 2, 0, 4, -4, 4, 0, 2, -4, 2, 0, 6, -5, 4, 0, 2, -2, 4, 0, 2, -6, 2, 0, 6, -2, 4, 0, 2, -6, 5, 0, 2, -4, 4, 0, 4, -4, 2, 0, 4, -2, 4
Offset: 1

Views

Author

Keywords

Comments

abs(a(n)) = (1/2) * (number of pairs (i,j) satisfying n = i^2 - j^2 and -n <= i,j <= n). - Benoit Cloitre, Jun 14 2003
As A001227(n) is the number of ways to write n as the difference of 3-gonal numbers, a(n) describes the number of ways to write n as the difference of e-gonal numbers for e in {0,1,4,8}. If pe(n):=(1/2)*n*((e-2)*n+(4-e)) is the n-th e-gonal number, then 4*a(n) = |{(m,k) of Z X Z; pe(-1)(m+k)-pe(m-1)=n}| for e=1, 2*a(n) = |{(m,k) of Z X Z; pe(-1)(m+k)-pe(m-1)=n}| for e in {0,4} and for a(n) itself is a(n) = |{(m,k) of Z X Z; pe(-1)(m+k)-pe(m-1)=n}| for e=8. (Same for e=-1 see A035218.) - Volker Schmitt (clamsi(AT)gmx.net), Nov 09 2004
An argument by Gareth McCaughan suggests that the average of this sequence is log(2). - Hans Havermann, Feb 10 2013 [Supported by a graph. - Vaclav Kotesovec, Mar 01 2023]
From Keith F. Lynch, Jan 20 2024: (Start)
a(n) takes every possible integer value, positive, negative, and zero. Proof: For all nonnegative integers k, a(3^k) = 1+k, a(2^k) = 1-k.
a(n) takes every possible integer value except 1 and -1 infinitely many times. Proof: a(o^(k-1)) = k and a(4*o^(k-1)) = -k for all positive integers k and odd primes o, of which there are infinitely many. a(n) = 0 iff n = 2 (mod 4). a(n) = 1 iff n = 1. a(n) = -1 iff n = 4.
a(n) takes prime value p only for n = o^(p-1), where o is any odd prime.
Terms have a simple pattern that repeats with a period of 4: Positive, zero, positive, negative.
(End)
Inverse Möbius transform of (-1)^(n+1). - Wesley Ivan Hurt, Jun 22 2024

Examples

			a(20) = -2 because 20 = 2^2*5^1 and (1-2)*(1+1) = -2.
G.f. = x + 2*x^3 - x^4 + 2*x^5 + 2*x^7 - 2*x^8 + 3*x^9 + 2*x^11 - 2*x^12 + ...
		

References

  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 162, #16, (6), first formula.
  • S. Ramanujan, Notebooks, Tata Institute of Fundamental Research, Bombay 1957 Vol. 1, see page 97, 7(ii).

Crossrefs

Cf. A048298. A diagonal of A060184.
First differences of A059851.
Indices of records: A053624 (highs), A369151 (lows).

Programs

  • Haskell
    a048272 n = a001227 n - a183063 n  -- Reinhard Zumkeller, Jan 21 2012
    
  • Magma
    [&+[(-1)^(d+1):d in Divisors(n)] :n in [1..95] ]; // Marius A. Burtea, Aug 10 2019
  • Maple
    add(x^n/(1+x^n), n=1..60): series(%,x,59);
    A048272 := proc(n)
        local a;
        a := 1 ;
        for pfac in ifactors(n)[2] do
            if pfac[1] = 2 then
                a := a*(1-pfac[2]) ;
            else
                a := a*(pfac[2]+1) ;
            end if;
        end do:
        a ;
    end proc: # Schmitt, sign corrected R. J. Mathar, Jun 18 2016
    # alternative Maple program:
    a:= n-> -add((-1)^d, d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 28 2018
  • Mathematica
    Rest[ CoefficientList[ Series[ Sum[x^k/(1 - (-x)^k), {k, 111}], {x, 0, 110}], x]] (* Robert G. Wilson v, Sep 20 2005 *)
    dif[n_]:=Module[{divs=Divisors[n]},Count[divs,?OddQ]-Count[ divs, ?EvenQ]]; Array[dif,100] (* Harvey P. Dale, Aug 21 2011 *)
    a[n]:=Sum[-(-1)^d,{d,Divisors[n]}] (* Steven Foster Clark, May 04 2018 *)
    f[p_, e_] := If[p == 2, 1 - e, 1 + e]; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Jun 09 2022 *)
  • PARI
    {a(n) = if( n<1, 0, -sumdiv(n, d, (-1)^d))}; /* Michael Somos, Jul 22 2006 */
    
  • PARI
    N=17; default(seriesprecision,N); x=z+O(z^(N+1))
    c=sum(j=1,N,j*x^j); \\ log case
    s=-log(prod(j=1,N,(1+x^j)^(1/j)));
    s=serconvol(s,c)
    v=Vec(s) \\ Joerg Arndt, May 03 2008
    
  • PARI
    a(n)=my(o=valuation(n,2),f=factor(n>>o)[,2]);(1-o)*prod(i=1,#f,f[i]+1) \\ Charles R Greathouse IV, Feb 10 2013
    
  • PARI
    a(n)=direuler(p=1,n,if(p==2,(1-2*X)/(1-X)^2,1/(1-X)^2))[n] /* Ralf Stephan, Mar 27 2015 */
    
  • PARI
    {a(n) = my(d = n -> if(frac(n), 0, numdiv(n))); if( n<1, 0, if( n%4, 1, -1) * (d(n) - 2*d(n/2) + 2*d(n/4)))}; /* Michael Somos, Aug 11 2017 */
    

Formula

Coefficients in expansion of Sum_{n >= 1} x^n/(1+x^n) = Sum_{n >= 1} (-1)^(n-1)*x^n/(1-x^n). Expand Sum 1/(1+x^n) in powers of 1/x.
If n = 2^p1*3^p2*5^p3*7^p4*11^p5*..., a(n) = (1-p1)*Product_{i>=2} (1+p_i).
Multiplicative with a(2^e) = 1 - e and a(p^e) = 1 + e if p > 2. - Vladeta Jovovic, Jan 27 2002
a(n) = (-1)*Sum_{d|n} (-1)^d. - Benoit Cloitre, May 12 2003
Moebius transform is period 2 sequence [1, -1, ...]. - Michael Somos, Jul 22 2006
G.f.: Sum_{k>0} -(-1)^k * x^(k^2) * (1 + x^(2*k)) / (1 - x^(2*k)) [Ramanujan]. - Michael Somos, Jul 22 2006
Equals A051731 * [1, -1, 1, -1, 1, ...]. - Gary W. Adamson, Nov 07 2007
From Reinhard Zumkeller, Jan 21 2012: (Start)
a(n) = A001227(n) - A183063(n).
a(A008586(n)) < 0; a(A005843(n)) <= 0; a(A016825(n)) = 0; a(A042968(n)) >= 0; a(A005408(n)) > 0. (End)
a(n) = Sum_{k=0..n} A081362(k)*A015723(n-k). - Mircea Merca, Feb 26 2014
abs(a(n)) = A112329(n) = A094572(n) / 2. - Ray Chandler, Aug 23 2014
From Peter Bala, Jan 07 2015: (Start)
Logarithmic g.f.: log( Product_{n >= 1} (1 + x^n)^(1/n) ) = Sum_{n >= 1} a(n)*x^n/n.
a(n) = A001227(n) - A183063(n). By considering the logarithmic generating functions of these three sequences we obtain the identity
( Product_{n >= 0} (1 - x^(2*n+1))^(1/(2*n+1)) )^2 = Product_{n >= 1} ( (1 - x^n)/(1 + x^n) )^(1/n). (End)
Dirichlet g.f.: zeta(s)*eta(s) = zeta(s)^2*(1-2^(-s+1)). - Ralf Stephan, Mar 27 2015
a(2*n - 1) = A099774(n). - Michael Somos, Aug 12 2017
From Paul D. Hanna, Aug 10 2019: (Start)
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(n+1) - x^k)^(n-k) = Sum_{n>=0} a(n)*x^(2*n).
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(n+1) + x^k)^(n-k) * (-1)^k = Sum_{n>=0} a(n)*x^(2*n). (End)
a(n) = 2*A000005(2n) - 3*A000005(n). - Ridouane Oudra, Oct 15 2019
Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A000005(k) = 2*log(2)-1. - Amiram Eldar, Mar 01 2023

Extensions

New definition from Vladeta Jovovic, Jan 27 2002

A279396 Triangle read by rows T(n, m) = sigma^*(n-m)(m), n >= 1, m = 1, 2, ..., n, with sigma^*(k)(n) given in a comment in A279395.

Original entry on oeis.org

1, 1, 0, 1, 1, 2, 1, 3, 4, 1, 1, 7, 10, 5, 2, 1, 15, 28, 19, 6, 0, 1, 31, 82, 71, 26, 4, 2, 1, 63, 244, 271, 126, 30, 8, 2, 1, 127, 730, 1055, 626, 196, 50, 13, 3, 1, 255, 2188, 4159, 3126, 1230, 344, 83, 13, 0, 1, 511, 6562, 16511, 15626, 7564, 2402, 583, 91, 6, 2, 1, 1023, 19684, 65791, 78126, 45990, 16808, 4367, 757, 78, 12, 2
Offset: 1

Views

Author

Wolfdieter Lang, Jan 10 2017

Keywords

Comments

The array A(k, n) = sigma^*A279395)%20=%20Sum">(k)(n) (notation of the Hardy reference, given also in a comment in A279395) = Sum{ d >= 1, d divides n} (-1)^(n-d)*d^k, for k >= 0 and n >=1, has the rows A112329, A113184, A064027, A008457, A279395, for k=0..4.
The triangle T(n, m) is obtained from the array A(k, n) read by upwards antidiagonals, with offset n=1.
The diagonals of triangle T are the rows of the array A. Each diagonal is multiplicative. See the given A-numbers above.
The row sums are given in A279397.
The column sums (with offset 0) are A000012, A000225, A034472, A099393, A034474, .. with o.g.f. G(m, z) = (-1)^m*Sum_{d | m} (-1)^d/(1 - d*z), m >= 1.

Examples

			The triangle T(n, m) begins:
n\m 1   2    3    4    5    6   7  8  9 10
1:  1
2:  1   0
3:  1   1    2
4:  1   3    4    1
5:  1   7   10    5    2
6:  1  15   28   19    6    0
7:  1  31   82   71   26    4   2
8:  1  63  244  271  126   30   8  2
9:  1 127  730 1055  626  196  50 13  3
10: 1 255 2188 4159 3126 1230 344 83 13  0
...
n = 11: 1 511 6562 16511 15626 7564 2402 583 91 6 2,
n = 12: 1 1023 19684 65791 78126 45990 16808 4367 757 78 12 2.
n = 13: 1 2047 59050 262655 390626 277876 117650 33823 6643 882 122 20 2,
n = 14: 1 4095 177148 1049599 1953126 1673310 823544 266303 59293 9390 1332 190 14 0,
n = 15: 1 8191 531442 4196351 9765626 10058524 5764802 2113663 532171 96906 14642 1988 170 8 4.
...
		

References

  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, AMS Chelsea Publishing, Providence, Rhode Island, 2002, p. 142.

Crossrefs

Formula

T(n, m) = Sum_{ d >= 1, d divides m} (-1)^(m-d)*d^(n-m) = sigma^*_(n-m)(m), n >= 1, m = 1,2, ..., n. For the definition of
sigma^*_(k)(n) see the Hardy reference or a comment in A279395.
O.g.f triangle T: G(z, x) = Sum_{m>=0}
G(m, z)*(x*z)^m, with the column o.g.f. G( m, z) (with offset 0) given in a comment above.

A279395 a(n) = Sum_{ d >= 1, d divides n} (-1)^(n-d)*d^4.

Original entry on oeis.org

1, 15, 82, 271, 626, 1230, 2402, 4367, 6643, 9390, 14642, 22222, 28562, 36030, 51332, 69903, 83522, 99645, 130322, 169646, 196964, 219630, 279842, 358094, 391251, 428430, 538084, 650942, 707282, 769980, 923522, 1118479, 1200644, 1252830, 1503652, 1800253, 1874162, 1954830, 2342084, 2733742
Offset: 1

Views

Author

Wolfdieter Lang, Jan 09 2017

Keywords

Comments

This is the k=4 member of the family sigma^*_k(n), defined in the Hardy reference, which is sigma_k(2*j+1) if n = 2*j+1 and sigma_k^e(2*j) - sigma_k^o(2*j) if n=2*j, where the superscript e and o stands for a restriction to even and odd divisors in the sum of their k-th powers, respectively.

References

  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, AMS Chelsea Publishing, Providence, Rhode Island, 2002, p. 142.

Crossrefs

Cf. A112329 (k=0), A113184 (k=1), A064027 (k=2), A008457(k=3).

Programs

  • Magma
    [&+[(-1)^(n-d)*d^4:d in Divisors(n)]:n in [1..40]]; // Marius A. Burtea, Aug 17 2019
  • Maple
    # A version with signs - N. J. A. Sloane, Nov 23 2018
    zet1:=(n,i)->add((-1)^(d-1)*d^i, d in divisors(n));
    szet1:=i->[seq(zet1(n,i),n=1..120)];
    szet1(4);
  • Mathematica
    f[p_, e_] := If[p == 2, (2^(4*(e + 1)) - 31)/15, (p^(4*(e + 1)) - 1)/(p^4 - 1)]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 40] (* Amiram Eldar, Aug 17 2019 *)
  • PARI
    a(n) = sumdiv(n, d, (-1)^(n-d)*d^4); \\ Michel Marcus, Jan 09 2017
    

Formula

a(n) = Sum_{ d >= 1, d divides n} (-1)^(n-d)*d^4.
Bisection: a(2*j-1) = A001159(2*j-1), a(2*j) = 16*A001159(j) - A051001(j), j >= 1. See the comment above for k=4, and the Hardy reference.
G.f.: Sum_{k>=1} k^4*x^k/(1-(-x)^k).
Multiplicative with a(2^k) = 2^4*(2^(4*k)-1)/(2^4-1) - 1 = (2^(4*(k+1)) - 31)/15 and a(p^k) = (p^(4*(k+1))-1)/(p^4-1) for primes p > 2 (see A001159).

A143520 a(n) is n times number of divisors of n if n is odd, zero if n is twice odd, n times number of divisors of n/4 if n is divisible by 4.

Original entry on oeis.org

1, 0, 6, 4, 10, 0, 14, 16, 27, 0, 22, 24, 26, 0, 60, 48, 34, 0, 38, 40, 84, 0, 46, 96, 75, 0, 108, 56, 58, 0, 62, 128, 132, 0, 140, 108, 74, 0, 156, 160, 82, 0, 86, 88, 270, 0, 94, 288, 147, 0, 204, 104, 106, 0, 220, 224, 228, 0, 118, 240, 122, 0, 378, 320, 260, 0, 134, 136
Offset: 1

Views

Author

Michael Somos, Aug 22 2008

Keywords

Examples

			q + 6*q^3 + 4*q^4 + 10*q^5 + 14*q^7 + 16*q^8 + 27*q^9 + 22*q^11 + 24*q^12 + ...
		

Crossrefs

Programs

  • Haskell
    a143520 n = product $ zipWith (\p e -> (e + 2 * mod p 2 - 1) * p ^ e)
                                  (a027748_row n) (a124010_row n)
    -- Reinhard Zumkeller, Jan 21 2014
  • Mathematica
    Abs@Total[# (-1)^Divisors[#]] & /@ Range[68] (* George Beck, Oct 25 2014 *)
    f[p_, e_] := (e + 1)*p^e; f[2, e_] := (e - 1)*2^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 29 2022 *)
  • PARI
    {a(n) = local(A, p, e); if( n<1, 0, A = factor(n); prod(k=1, matsize(A)[1], if(p = A[k, 1], e = A[k, 2]; (e - (-1)^p) * p^e)))}
    
  • PARI
    {a(n) = if( n<1, 0, polcoeff( sum(k=1, n, k * x^k / (1 - (-x)^k)^2, x*O(x^n)), n))}
    

Formula

a(n) is multiplicative with a(2^e) = (e-1) * 2^e if e>0, a(p^e) = (e+1) * p^e if p>2.
a(4*n + 2) = 0.
G.f.: Sum_{k>0} k * x^k / (1 - (-x)^k)^2.
A038040(2*n + 1) = a(2*n + 1); 4 * A038040(n) = a(4*n).
From Amiram Eldar, Nov 29 2022: (Start)
a(n) = n * A112329(n).
Dirichlet g.f.: zeta(s-1)^2*(1+2^(3-2*s)-2^(2-s)).
Sum_{k=1..n} a(k) ~ n^2*log(n)/4 + (4*gamma-1)*n^2/8, where gamma is Euler's constant (A001620). (End)

A094572 Number of pairs of integers x, y (of either sign) with x^2 - y^2 = n.

Original entry on oeis.org

2, 0, 4, 2, 4, 0, 4, 4, 6, 0, 4, 4, 4, 0, 8, 6, 4, 0, 4, 4, 8, 0, 4, 8, 6, 0, 8, 4, 4, 0, 4, 8, 8, 0, 8, 6, 4, 0, 8, 8, 4, 0, 4, 4, 12, 0, 4, 12, 6, 0, 8, 4, 4, 0, 8, 8, 8, 0, 4, 8, 4, 0, 12, 10, 8, 0, 4, 4, 8, 0, 4, 12, 4, 0, 12, 4, 8, 0, 4, 12, 10, 0, 4, 8, 8, 0, 8, 8, 4, 0, 8, 4, 8, 0, 8, 16, 4, 0, 12, 6
Offset: 1

Views

Author

N. J. A. Sloane, Nov 02 2008

Keywords

Comments

The old entry with this sequence number was a duplicate of A058071.
a(n) == 2 (mod 4) if n is a square otherwise a(n) is divisible by 4. Cf. A112329. - Peter Bala, Jan 08 2025

References

  • M. N. Huxley, Area, Lattice Points and Exponential Sums, Oxford, 1996; p. 236.

Crossrefs

Programs

  • Maple
    with(numtheory); f:=proc(n) if n mod 2 = 1 then RETURN(2*tau(n)); fi; if n mod 4 = 0 then RETURN(2*tau(n/4)); fi; 0; end;
  • Mathematica
    Table[If[OddQ[n],2DivisorSigma[0,n],If[OddQ[n/2],0,2DivisorSigma[0,n/4]]],{n,100}] (* Ray Chandler, Aug 23 2014 *)
  • PARI
    a(n) = if(n%2, 2 * numdiv(n), if(n % 4 == 0, 2 * numdiv(n/4), 0)); \\ Amiram Eldar, Apr 13 2024

Formula

a(n) = 2*d(n) if n is odd, = 2*d(n/4) if n == 0 mod 4, otherwise 0, where d() = A000005().
a(n) = 2 * A112329(n). - Ray Chandler, Aug 23 2014
From Amiram Eldar, Apr 13 2024: (Start)
Dirichlet g.f.: 2*zeta(s)^2*(1 + 2^(1-2*s) - 2^(1-s)).
Sum_{k=1..n} a(k) ~ n*log(n) + (2*gamma-1)*n, where gamma is Euler's constant (A001620). (End)

A305122 G.f.: Sum_{k>=1} x^(2*k)/(1+x^(2*k)) * Product_{k>=1} (1+x^k)/(1-x^k).

Original entry on oeis.org

0, 0, 1, 2, 4, 8, 16, 28, 47, 78, 126, 198, 306, 464, 694, 1024, 1490, 2146, 3061, 4322, 6052, 8408, 11592, 15872, 21592, 29192, 39242, 52468, 69788, 92376, 121716, 159664, 208569, 271372, 351732, 454228, 584546, 749720, 958472, 1221560, 1552210, 1966698
Offset: 0

Views

Author

Vaclav Kotesovec, May 26 2018

Keywords

Comments

Convolution of A305121 and A000009.
The g.f. Sum_{k >= 1} x^(2*k)/(1 + x^(2*k)) * Product_{k >= 1} (1 + x ^k)/(1 - x^k) = Sum_{k >= 1} x^(2*k)/(1 + x^(2*k)) * Product_{k >= 1} (1 + x ^k)/(1 + x^k - 2*x^k) is congruent mod 2 to Sum_{k >= 1} x^(2*k)/(1 + x^(2*k)) = -G(-x^2), where G(x) is the g.f. of A112329. It follows that a(n) is odd iff n = 2*k^2 for some positive integer k. - Peter Bala, Jan 07 2025

Crossrefs

Programs

  • Mathematica
    nmax = 50; CoefficientList[Series[Sum[x^(2*k)/(1+x^(2*k)), {k, 1, nmax}] * Product[(1+x^k)/(1-x^k), {k, 1, nmax}], {x, 0, nmax}], x]

Formula

a(n) = A305101(n) - A305124(n).
a(n) ~ exp(sqrt(n)*Pi) * log(2) / (8*Pi*sqrt(n)).

A265290 Decimal expansion of Sum_{n>=1} |phi - c(n)|, where phi is the golden ratio (A001622) and c(n) are the convergents to phi.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 06 2015

Keywords

Comments

Define the deviance of x > 0 by dev(x) = Sum_{n>=1} |x - c(n,x)|, where c(n,x) = n-th convergent to x. The greatest value of dev(x) occurs when x = golden ratio, so that this constant is the maximal deviance.

Examples

			1.195955786017513596003474800021...
		

Crossrefs

Programs

  • Maple
    x := (3 - sqrt(5))/2:
    evalf(sqrt(5)*add(x^(n^2)*(1 + x^(2*n))/(1 - x^(2*n)), n = 1..16), 100); # Peter Bala, Aug 21 2022
  • Mathematica
    x = GoldenRatio; z = 600; c = Convergents[x, z];
    s1 = Sum[x - c[[2 k - 1]], {k, 1, z/2}]; N[s1, 200]
    s2 = Sum[c[[2 k]] - x, {k, 1, z/2}]; N[s2, 200]
    N[s1 + s2, 200]
    RealDigits[s1, 10, 120][[1]]  (* A265288 *)
    RealDigits[s2, 10, 120][[1]]  (* A265289 *)
    RealDigits[s1 + s2, 10, 120][[1]] (* A265290, dev(x) *)
    d[x_] := If[IntegerQ[1000!*x], Total[Abs[x - Convergents[x]]],
      Total[Abs[x - Convergents[x, 30]]]]
    Plot[{d[x], 1.195}, {x, 0, 1}]

Formula

Equals Sum_{n>=1} 1/(F(2*n-1)*F(2*n)), where F(n) is the n-th Fibonacci number (A000045).
From Amiram Eldar, Oct 05 2020: (Start)
Equals Sum_{k>=1} 1/(phi^k * F(k)).
Equals sqrt(5) * Sum_{k>=1} 1/(phi^(2*k) - (-1)^k) = sqrt(5) * Sum_{k>=1} (-1)^(k+1)/(phi^(2*k) + (-1)^k).
Equals (A290565 + 1/phi)/2. (End)
A rapidly converging series for the constant is sqrt(5)*Sum_{k >= 1} x^(k^2)*(1 + x^(2*k))/(1 - x^(2*k)), where x = (3 - sqrt(5))/2. See A112329. - Peter Bala, Aug 21 2022

A265293 Decimal expansion of Sum_{n >= 1} (c(2*n) - c(2*n-1)), where c(n) = the n-th convergent to x = sqrt(2).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 06 2015

Keywords

Examples

			sum = 0.51717422022067188621996435233866923610552...
		

Crossrefs

Programs

  • Maple
    x := 3 - 2*sqrt(2):
    evalf(2*sqrt(2)*add(x^(n^2)*(1 + x^(2*n))/(1 - x^(2*n)), n = 1..12), 100); # Peter Bala, Aug 20 2022
  • Mathematica
    x = Sqrt[2]; z = 600; c = Convergents[x, z];
    s1 = Sum[x - c[[2 k - 1]], {k, 1, z/2}]; N[s1, 200]
    s2 = Sum[c[[2 k]] - x, {k, 1, z/2}]; N[s2, 200]
    N[s1 + s2, 200]
    RealDigits[s1, 10, 120][[1]]  (* A265291 *)
    RealDigits[s2, 10, 120][[1]]  (* A265292 *)
    RealDigits[s1 + s2, 10, 120][[1]](* A265293 *)

Formula

From Peter Bala, Aug 20 2022: (Start)
Constant equals Sum_{n >= 1} 1/((1 + sqrt(2))^n*Pell(n)) = 2*sqrt(2)*Sum_{n >= 1} 1/( (3 + 2*sqrt(2))^n - (-1)^n ), where Pell(n) = A000129(n).
A more rapidly converging series for the constant is 2*sqrt(2)*Sum_{n >= 1} x^(n^2)*(1 + x^(2*n))/(1 - x^(2*n)), where x = 3 - 2*sqrt(2). See A112329. (End)

A327124 Expansion of Sum_{k>=1} ((1 - (-x)^k)^k - 1).

Original entry on oeis.org

1, -2, 3, -3, 5, -3, 7, -2, 10, 0, 11, -1, 13, 7, 25, 13, 17, -2, 19, 30, 56, 33, 23, 1, 26, 52, 111, 98, 29, -51, 31, 158, 198, 102, 56, 24, 37, 133, 325, 304, 41, -189, 43, 517, 626, 207, 47, 191, 50, -2, 731, 988, 53, -435, 517, 1315, 1026, 348, 59, 18
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 14 2019

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 60; CoefficientList[Series[Sum[((1 - (-x)^k)^k - 1), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[DivisorSum[n, (-1)^(n - #) Binomial[n/#, #] &], {n, 1, 60}]
  • PARI
    a(n)={sumdiv(n, d, (-1)^(n-d) * binomial(n/d,d))} \\ Andrew Howroyd, Sep 14 2019

Formula

a(n) = Sum_{d|n} (-1)^(n-d) * binomial(n/d,d).
a(p) = p, where p is odd prime.
Showing 1-10 of 12 results. Next