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 31-40 of 40 results.

A079542 Triangular array: T(n,1) = T(n,n) = n and T(n,k) = lcm(T(n-1,k-1), T(n-1,k)) for 1 < k < n.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 4, 6, 6, 4, 5, 12, 6, 12, 5, 6, 60, 12, 12, 60, 6, 7, 60, 60, 12, 60, 60, 7, 8, 420, 60, 60, 60, 60, 420, 8, 9, 840, 420, 60, 60, 60, 420, 840, 9, 10, 2520, 840, 420, 60, 60, 420, 840, 2520, 10, 11, 2520, 2520, 840, 420, 60, 420, 840, 2520, 2520, 11, 12
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 22 2003

Keywords

Comments

T(2*n-1,n) = A058312(n-1) for n <= 13.

Examples

			Triangle begins:
  1
  2  2
  3  2  3
  4  6  6  4
  5 12  6 12  5
  6 60 12 12 60  6
  7 60 60 12 60 60  7
		

Crossrefs

Cf. A080046.
T(n, 2) = A003418(n-1) for n > 2.

Programs

  • PARI
    T(n,k) = if ((k==1) || (k==n), n, lcm(T(n-1,k-1), T(n-1,k)));
    tabl(nn) = for (n=1, nn, for (k=1, n, print1(T(n,k), ", ")); print); \\ Michel Marcus, Apr 25 2018

A115388 Numerator of rational part of raw moment n of the line point picking problem.

Original entry on oeis.org

-1, 3, -4, 17, -41, 42, -289, 1171, -1739, 1753, -19157, 19262, -249251, 250241, -249383, 200107, -1696405, 1700409, -32239703, 161504821, -161227687, 161479627, -3708740681, 3713590526, -18545643343, 18566236531, -55641506293, 55694623643, -230529988171
Offset: 1

Views

Author

Eric W. Weisstein, Jan 21 2006

Keywords

Examples

			-1 + 2*log(2), 3 - 4*log(2), -4 + 6*log(2), 17/3 - 8*log(2), -41/6 + 10*log(2), ...
The above sequence of numbers is given by 4*Integral_{x = 0..Pi/4} tan(x)^(2*n+1) * cos(x)^2 dx for n >= 1, or, equivalently, by Integral_{y = 0..1} Integral_{x = 0..1} 2*n*(x*y)^n/(x + y)^2 dx dy for n >= 1. - _Peter Bala_, Jan 04 2023
		

Crossrefs

Programs

  • Maple
    a := n -> numer(1 + 2*n*add((-1)^(n+k+1)/k, k = 1..n)):
    seq(a(n), n = 1..28); # Peter Bala, Jan 05 2023
    # Alternative:
    a := n -> 2*n*((-1)^n*log(2) - LerchPhi(-1, 1, n + 1)) + 1:
    seq(numer(simplify(a(n))), n = 1..29); # Peter Luschny, Jan 05 2023

Formula

From Pontus von Brömssen, Nov 03 2019: (Start)
For even n, a(n)/A115389(n) = 2*n*Sum_{k = n/2..n-1} 1/k - 1.
For odd n >= 3, a(n)/A115389(n) = -2*n*((Sum_{k = (n-1)/2..n-2} 1/k) - 1/(n-1)) - 1. (End)
a(n) = numerator of 1 + (2*n)*Sum_{k = 1..n} (-1)^(n+k+1)/k. - Peter Bala, Jan 05 2023
a(n) = numerator of 2*n*((-1)^n*log(2) - LerchPhi(-1, 1, n + 1)) + 1. - Peter Luschny, Jan 05 2023

A115389 Denominator of rational part of raw moment n of the line point picking problem.

Original entry on oeis.org

1, 1, 1, 3, 6, 5, 30, 105, 140, 126, 1260, 1155, 13860, 12870, 12012, 9009, 72072, 68068, 1225224, 5819814, 5542680, 5290740, 116396280, 111546435, 535422888, 514829700, 1487285800, 1434168450, 5736673800, 5545451340, 166363540200, 644658718275, 312561802800
Offset: 1

Views

Author

Eric W. Weisstein, Jan 21 2006

Keywords

Examples

			-1 + 2*log(2), 3 - 4*log(2), -4 + 6*log(2), 17/3 - 8*log(2), -41/6 + 10*log(2), ...
		

Crossrefs

Programs

  • Maple
    a := n -> denom(1 + 2*n*add((-1)^(n+k+1)/k, k = 1..n)):
    seq(a(n), n = 1..30); # Peter Bala, Jan 05 2023
    # Alternative:
    a := n -> 2*n*((-1)^n*log(2) - LerchPhi(-1, 1, n + 1)) + 1:
    seq(denom(simplify(a(n))), n = 1..33); # Peter Luschny, Jan 05 2023

Formula

a(n) = denominator of 1 + (2*n)*Sum_{k = 1..n} (-1)^(n+k+1)/k. - Peter Bala, Jan 05 2023
a(n) = denominator of 2*n*((-1)^n*log(2) - LerchPhi(-1, 1, n + 1)) + 1. - Peter Luschny, Jan 05 2023

A119955 Numbers n such that denominator of n-th Harmonic Number equals denominator of n-th Alternative Harmonic Number.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, 27, 49, 50, 51, 52, 53, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 289, 290, 291, 292, 293, 841, 842, 843, 844
Offset: 1

Views

Author

Alexander Adamchuk, Aug 02 2006

Keywords

Comments

Up to n=14 A002805[n] coincides with A058312[n]. a(n) up to a(12)=27 coincides with A096304[n].

Examples

			Denominators of Harmonic Number (H[n] = Sum[1/i, {i, n}]) are A002805[n] = {1,2,6,12,60,20,140,280,2520,2520,27720,27720,360360,360360,360360,...}.
Denominators of Alternative Harmonic Number (H'[n] = Sum[(-1)^(i+1)*1/i, {i, n}]) are A058312[n] = {1,2,6,12,60,60,420,840,2520,2520,27720,27720,360360,360360,72072,...}.
a(1) = 1 because A002805[1] = A058312[1].
15 is not in a(n) because A002805[15] = 360360 is not equal to A058312[15] = 72072.
		

Crossrefs

Programs

  • Mathematica
    Do[s1=Denominator[Sum[(-1)^(i+1)*1/i, {i, n}]]; s2=Denominator[Sum[1/i, {i, n}]]; If[Equal[s2, s1], Print[n]], {n, 1, 1500}]

A262136 Number of distinct fractional parts of the numbers Sum_{i=j..k} (-1)^i/i with 1 <= j <= k <= n, where the fractional part of x is given by x - floor(x).

Original entry on oeis.org

1, 2, 4, 7, 11, 14, 20, 27, 35, 44, 54, 64, 76, 89, 103, 118, 134, 151, 169, 186, 206, 227, 249, 272, 296, 321, 347, 374, 402, 430, 460, 491, 523, 556, 590, 625, 661, 698, 736, 775, 815, 854, 896, 939, 983, 1028, 1074, 1121, 1169, 1218, 1268, 1319, 1371, 1424, 1478, 1532, 1588, 1645, 1703, 1762
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 11 2015

Keywords

Comments

Note that (-1)^n/n+(-1)^(n+1)/(n+1) = (-1)^n/(n*(n+1)) for any n > 0.
Conjecture: (i) Suppose that Sum_{i=j..k} (-1)^i/i and Sum_{r=s..t} (-1)^r/r with 0 < min{2,k} <= j <= k, 0 < min{2,t} <= s <= t and j <= s have the same fractional part, but the ordered pairs (j,k) and (s,t) are different. Then Sum_{i=j..k} (-1)^i/i = Sum_{r=s..t} (-1)^r/r. Moreover, if j is odd, then j > 1, k = j*(j+1) and (s,t) = (j+2,j*(j+1)-1); if j is even, then either (k = j+1 and s = t = j*(j+1)), or (k = j*(j+1)-1 and (s,t) = (j+2,j*(j+1))).
(ii) Let a > b >= 0 and m > 0 be integers with gcd(a,b) = 1 < max{a,m}. For each r = 0,1, the numbers Sum_{i=j..k} (-1)^(i-r*j)/(a*i-b)^m with 1 <= j <= k and (j > 1 if k > a-b = 1) have pairwise distinct fractional parts.
This is an analog of the conjecture in A261878. Part (i) of the conjecture implies that a(n) = n*(n-1)/2 + 2 - floor((sqrt(4n+1)-1)/2) - floor((sqrt(4n+1)-1)/4) for all n > 1.

Examples

			a(6) = 14 since the sums (-1)^j/j+...+(-1)^k/k with 0 < min{k,2} <= j <= k <= 6 and (j,k) different from (4,6) and (6,6) have pairwise distinct fractional parts, but (-1)^6/6 = (-1)^2/2+(-1)^3/3 and 1/4-1/5+1/6 = 1/2-1/3+1/4-1/5.
		

Crossrefs

Programs

  • Mathematica
    frac[x_]:=x-Floor[x]
    u[0]:=0
    u[n_]:=u[n-1]+(-1)^n/n
    S[n_]:=Table[frac[u[n]-u[m-1]],{m,Min[2,n],n}]
    T[1]:=S[1]
    T[n_]:=Union[T[n-1],S[n]]
    Do[Print[n," ",Length[T[n]]],{n,1,60}]

A373893 a(n) is the length of the simple continued fraction for the n-th alternating harmonic number.

Original entry on oeis.org

0, 1, 2, 4, 7, 7, 5, 9, 8, 12, 9, 12, 11, 12, 13, 12, 18, 12, 17, 15, 15, 15, 19, 21, 18, 13, 21, 23, 25, 23, 26, 32, 28, 25, 24, 24, 31, 32, 33, 36, 41, 38, 38, 37, 44, 41, 37, 39, 47, 48, 42, 43, 43, 44, 46, 42, 44, 51, 45, 49, 52, 53, 62, 50, 57, 48, 55, 60, 52, 58, 70, 58, 60, 73, 67
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 21 2024

Keywords

Comments

By "simple continued fraction" is meant a continued fraction whose terms are positive integers and the final term is >= 2.

Examples

			Sum_{k=1..7} (-1)^(k+1)/k = 319/420 = 1/(1 + 1/(3 + 1/(6 + 1/(3 + 1/5)))), so a(7) = 5.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[ContinuedFraction[Sum[(-1)^(k + 1)/k, {k, 1, n}]]] - 1, {n, 1, 75}]
  • Python
    from fractions import Fraction
    from sympy.ntheory.continued_fraction import continued_fraction
    def A373893(n): return len(continued_fraction(sum(Fraction(1 if k&1 else -1,k) for k in range(1,n+1))))-1 # Chai Wah Wu, Jun 27 2024

A173756 Partial sums of A058313.

Original entry on oeis.org

1, 2, 7, 14, 61, 98, 417, 950, 2829, 4456, 24873, 42980, 306091, 543462, 595741, 691290, 2459767, 4092108, 37557035, 193242042, 360012409, 516201296, 4341338257, 7943382348, 27024448579, 45075855410, 102204647503, 109956141102, 346222803073, 571398562364
Offset: 1

Views

Author

Jonathan Vos Post, Feb 23 2010

Keywords

Comments

Partial sum of the numerator of the n-th alternating harmonic number.

Crossrefs

Cf. A001008 (numerator of the n-th harmonic number), A025530, A058312 (denominators of the underlying sequence), A058313, A075830.

Programs

  • Maple
    a := proc(n) local i, k:
    add(numer(add((-1)^(k + 1)/k, k = 1 .. i)), i = 1 .. n): end proc:
    seq(a(n), n = 1 .. 40); # Petros Hadjicostas, May 06 2020
  • PARI
    a(n) = sum(i=1, n, numerator(sum(k=1, i, (-1)^(k+1)/k))); \\ Michel Marcus, May 07 2020

Formula

a(n) = Sum_{i=1..n} A058313(i) = Sum_{i=1..n} numerator(Sum_{k=1..i} (-1)^(k+1)/k). [Corrected by Petros Hadjicostas and Michel Marcus, May 06 2020]

Extensions

Data corrected and extended by Petros Hadjicostas, May 06 2020

A305128 Expansion of e.g.f. Product_{k>=1} 1/(1 - x^k)^AH(k), where AH(k) is the k-th alternating harmonic number.

Original entry on oeis.org

1, 1, 3, 14, 79, 539, 4663, 42468, 457945, 5433281, 71036231, 994289658, 15544425103, 253283689619, 4489180389835, 84521336758904, 1687130833152561, 35365641206048129, 790065486354237643, 18340253632236738022, 449655289227002010351, 11492300073384698090795, 306803167368168113022271
Offset: 0

Views

Author

Ilya Gutkovskiy, May 26 2018

Keywords

Comments

a(n)/n! is the Euler transform of [1, 1 - 1/2, 1 - 1/2 + 1/3, 1 - 1/2 + 1/3 - 1/4, 1 - 1/2 + 1/3 - 1/4 + 1/5, ...].

Crossrefs

Programs

  • Mathematica
    nmax = 22; CoefficientList[Series[Product[1/(1 - x^k)^Sum[(-1)^(j + 1)/j, {j, 1, k}], {k, 1, nmax}], {x, 0, nmax}], x] Range[0, nmax]!
    a[n_] := a[n] = If[n == 0, 1, Sum[Sum[d ((-1)^(d + 1) LerchPhi[-1, 1, d + 1] + Log[2]), {d, Divisors[k]}] a[n - k], {k, 1, n}]/n]; Table[n! a[n], {n, 0, 22}]

Formula

E.g.f.: Product_{k>=1} 1/(1 - x^k)^(A058313(k)/A058312(k)).

A334750 Total number of swaps needed to sort all n! permutations of n elements by the optimal dual-pivot quicksort "Count".

Original entry on oeis.org

0, 0, 4, 16, 103, 711, 5526, 48066, 463248, 4908816, 56749536, 711299232, 9609618816, 139252708224, 2154724104960, 35464952597760, 618712803717120, 11405648080834560, 221541001069731840, 4522678391979417600, 96811891510299033600, 2168416142767145779200
Offset: 0

Views

Author

Petros Hadjicostas, May 09 2020

Keywords

Comments

The dual-pivot quicksort "Count" differs slightly from the original version of the dual-pivot quicksort algorithm of Aumüller et al. (2016, 2019). See Algorithm 1 in Neininger and Straub (2017, 2018).
By the design of the algorithm, for n >= 2, Neininger and Straub always require at least two swaps "at the end in order to bring the [two] pivots to their final positions".
Here a(n) is n! times the average number of swaps of the dual-pivot quicksort "Count" when sorting a random permutation of length n.

Crossrefs

Programs

  • PARI
    lista(nn) = { nn = max(nn, 3); my(va = vector(nn)); va[1] = 0; va[2] = 4; for(n=3, nn, va[n] = n!*(6*sum(k=1, n-2, (n-k-1)*va[k]/k!)/(n*(n-1)) + 5*n/8 + 13/16 - 1/(16*(n - (1 + (-1)^n)/2)))); concat(0, va); };
    
  • PARI
    H1(n) = sum(k=1, n, 1/k);
    H2(n) = sum(k=1, n, (-1)^k/k);
    H3(n) = if(0 == (n % 2), - (1/320)*(1/(n - 3) + 3/(n - 1)), (1/320)*(3/(n - 2) + 1/n));
    lista(nn) = { nn = max(nn, 3); my(va = vector(nn)); va[1] = 0; va[2] = 4; va[3] = 16; for(n=4, nn, va[n] = n!*((3/4)*n*H1(n) + (1/20)*n*H2(n) - (4/5)*n + (3/4)*H1(n) + (1/20)*H2(n) - 23/160 - (-1)^n/40 + H3(n))); concat(0,va); };

Formula

Recurrence: a(n)/n! = (6/(n*(n - 1)))*(Sum_{k=0..n-2} (n - k - 1)*a(k)/k!) + 5*n/8 + 13/16 - 1/(16*(n - I[n is even])) for n >= 2 with a(0) = a(1) = 0, where I(condition) = 1 if the condition holds, and = 0 otherwise. [See p. 7 in Neininger and Straub (2017).]
a(n) = n!*((3/4)*n*Harmonic(n) + (1/20)*n*Harmonic_alt(n) - (4/5)*n + (3/4)*Harmonic(n) + (1/20)*Harmonic_alt(n) - 23/160 - (-1)^n/40 - ([n even]/320)*(1/(n - 3) + 3/(n - 1)) + ([n odd]/320)*(3/(n - 2) + 1/n)) for n >= 4, where Harmonic_alt(n) = Sum_{k=1..n} (-1)^n/n = -A058313(n)/A058312(n). [See Theorem 2.1 in Neininger and Straub (2017, 2018).]

A347978 E.g.f.: 1/(1 + x)^(1/(1 - x)).

Original entry on oeis.org

1, -1, 0, -3, 4, -30, 186, -630, 11600, -26712, 1005480, -2581920, 117196872, -485308824, 17734457664, -131070696120, 3387342915840, -43890398953920, 801577841697216, -17363169328243392, 233460174245351040, -7968629225100337920, 84363134551361043840
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 22 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 22; CoefficientList[Series[1/(1 + x)^(1/(1 - x)), {x, 0, nmax}], x] Range[0, nmax]!
    A024167[n_] := n! Sum[(-1)^(k + 1)/k, {k, 1, n}]; a[0] = 1; a[n_] := a[n] = -Sum[Binomial[n - 1, k - 1] A024167[k] a[n - k], {k, 1, n}]; Table[a[n], {n, 0, 22}]
  • PARI
    my(x='x+O('x^30)); Vec(serlaplace(1/(1+x)^(1/(1-x)))) \\ Michel Marcus, Sep 22 2021

Formula

E.g.f.: exp( Sum_{k>=1} x^k * Sum_{j=1..k} (-1)^j / j ).
a(0) = 1; a(n) = -Sum_{k=1..n} binomial(n-1,k-1) * A024167(k) * a(n-k).
a(0) = 1; a(n) = -Sum_{k=1..n} binomial(n,k) * A073478(k) * a(n-k).
Previous Showing 31-40 of 40 results.