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 10 results.

A024167 a(n) = n!*(1 - 1/2 + 1/3 - ... + c/n), where c = (-1)^(n+1).

Original entry on oeis.org

1, 1, 5, 14, 94, 444, 3828, 25584, 270576, 2342880, 29400480, 312888960, 4546558080, 57424792320, 948550176000, 13869128448000, 256697973504000, 4264876094976000, 87435019510272000, 1627055289796608000, 36601063093905408000, 754132445894209536000
Offset: 1

Views

Author

Keywords

Comments

Stirling transform of (-1)^n*a(n-1) = [0, 1, -1, 5, -14, 94, ...] is A000629(n-2) = [0, 1, 2, 6, 26, ...]. - Michael Somos, Mar 04 2004
Stirling transform of a(n) = [1, 1, 5, 14, 94, ...] is A052882(n) = [1, 2, 9, 52, 375, ...]. - Michael Somos, Mar 04 2004
a(n) is the number of n-permutations that have a cycle with length greater than n/2. - Geoffrey Critzer, May 28 2009
From Jens Voß, May 07 2010: (Start)
a(4n) is divisible by 6*n + 1 for all n >= 1; the quotient of a(4*n) and 6*n+1 is A177188(n).
a(4*n+3) is divisible by 6*n + 5 for all n >= 0; the quotient of a(4*n+3) and 6*n + 5 is A177174(n). (End)

Examples

			G.f. = x + x^2 + 5*x^3 + 14*x^4 + 94*x^5 + 444*x^6 + 3828*x^7 + 25584*x^8 + ...
		

Crossrefs

Programs

  • Maple
    a := n -> n!*(log(2) - (-1)^n*LerchPhi(-1, 1, n+1));
    seq(simplify(a(n)), n=1..20); # Peter Luschny, Dec 27 2018
  • Mathematica
    f[k_] := k (-1)^(k + 1)
    t[n_] := Table[f[k], {k, 1, n}]
    a[n_] := SymmetricPolynomial[n - 1, t[n]]
    Table[a[n], {n, 1, 18}]    (* A024167 signed *)
    (* Clark Kimberling, Dec 30 2011 *)
    a[ n_] := If[ n < 0, 0, n! Sum[ -(-1)^k / k, {k, n}]]; (* Michael Somos, Nov 28 2013 *)
    a[ n_] := If[ n < 0, 0, n! (PolyGamma[n + 1] - PolyGamma[(n + Mod[n, 2, 1]) / 2])]; (* Michael Somos, Nov 28 2013 *)
    a[ n_] := If[ n < 1, 0, (-1)^Quotient[n, 2] SymmetricPolynomial[ n - 1, Table[ -(-1)^k k, {k, n}]]]; (* Michael Somos, Nov 28 2013 *)
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( log(1 + x + x * O(x^n)) / (1 - x), n))}; /* Michael Somos, Mar 02 2004 */
    
  • PARI
    x='x+O('x^33); Vec(serlaplace(log(1+x)/(1-x))) \\ Joerg Arndt, Dec 27 2018
    
  • Python
    def A():
        a, b, n = 1, 1, 2
        yield(a)
        while True:
            yield(a)
            b, a = a, a + b * n * n
            n += 1
    a = A(); print([next(a) for  in range(20)]) # _Peter Luschny, May 19 2020

Formula

E.g.f.: log(1 + x)/(1 - x). - Vladeta Jovovic, Aug 25 2002
a(n) = a(n-1) + a(n-2) * (n-1)^2, n > 1. - Michael Somos, Oct 29 2002
b(n) = n! satisfies the above recurrence with b(1) = 1, b(2) = 2. This gives the finite continued fraction expansion a(n)/n! = 1/(1 + 1^2/(1 + 2^2/(1 + 3^2/(1 + ... + (n-1)^2/1)))). Cf. A142979. - Peter Bala, Jul 17 2008
a(n) = A081358(n) - A092691(n). - Gary Detlefs, Jul 09 2010
E.g.f.: (x/(x-1))/G(0) where G(k) = -1 + (x-1)*k + x*(k+1)^2/G(k+1); (continued fraction, Euler's 1st kind, 1-step). - Sergei N. Gladkovskii, Aug 18 2012
a(n) ~ log(2)*n!. - Daniel Suteu, Dec 03 2016
a(n) = (1/2)*n!*((-1)^n*(digamma((n+1)/2) - digamma((n+2)/2)) + log(4)). - Daniel Suteu, Dec 03 2016
a(n) = n!*(log(2) - (-1)^n*LerchPhi(-1, 1, n+1)). - Peter Luschny, Dec 27 2018
a(n) = A054651(n,n-1). - Pontus von Brömssen, Oct 25 2020
a(n) = Sum_{k=0..n} (-1)^k*k!*A094587(n, k+1). - Mélika Tebni, Jun 20 2022
a(n) = n * a(n-1) - (-1)^n * (n-1)! for n > 1. - Werner Schulte, Oct 20 2024

Extensions

More terms from Benoit Cloitre, Jan 27 2002
a(21)-a(22) from Pontus von Brömssen, Oct 25 2020

A244009 Decimal expansion of 1 - log(2).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Fraction of numbers which are sqrt-smooth, see A048098 and A063539. - Charles R Greathouse IV, Jul 14 2014
Asymptotic survival probability in the 100 prisoners problem. - Alois P. Heinz, Jul 08 2022

Examples

			0.30685281944005469058276787854...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 1.6.3, pp. 43-44.

Crossrefs

Essentially the same digits as A239354.

Programs

  • Maple
    f:= sum(1/(2*k*(2*k+1)), k=1..infinity):
    s:= convert(evalf(f, 140), string):
    seq(parse(s[i+1]), i=1..106);  # Alois P. Heinz, Jun 17 2014
  • Mathematica
    RealDigits[1-Log[2],10,120][[1]] (* Harvey P. Dale, Sep 23 2016 *)
  • PARI
    1-log(2) \\ Charles R Greathouse IV, Jul 14 2014

Formula

Equals Sum_{k>=0} 1/(2*k*(2*k+1)) = A239354 + 1/4 = A188859/2.
From Amiram Eldar, Aug 07 2020: (Start)
Equals Sum_{k>=1} 1/(k*(k+1)*2^k) = Sum_{k>=2} 1/A100381(k).
Equals Sum_{k>=2} (-1)^k * zeta(k)/2^k.
Equals Integral_{x=1..oo} 1/(x^2 + x^3) dx. (End)
Equals log(e/2) = log(A019739) = -log(2/e) = -log(A135002). - Wolfdieter Lang, Mar 04 2022
Equals lim_{n->oo} A024168(n)/n!. - Alois P. Heinz, Jul 08 2022
Equals 1/(4 - 4/(7 - 12/(10 - ... - 2*n*(n-1)/((3*n+1) - ...)))) (an equivalent continued fraction for 1 - log(2) was conjectured by the Ramanujan machine). - Peter Bala, Mar 04 2024
Equals Sum_{k>=1} zeta(2*k)/((2*k + 1)*2^(2*k-1)) (see Finch). - Stefano Spezia, Nov 02 2024

A075829 Let u(1) = x and u(n+1) = (n^2/u(n)) + 1 for n >= 1; then a(n) is such that u(n) = (b(n)*x + c(n))/(d(n)*x + a(n)) (in lowest terms) and a(n), b(n), c(n), d(n) are positive integers.

Original entry on oeis.org

1, 0, 1, 1, 5, 13, 23, 101, 307, 641, 893, 7303, 9613, 97249, 122989, 19793, 48595, 681971, 818107, 13093585, 77107553, 66022193, 76603673, 1529091919, 1752184789, 7690078169, 8719737569, 23184641107, 3721854001, 96460418429
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2002

Keywords

Comments

For x real <> 1 - 1/log(2), Lim_{n -> infinity} abs(u(n) - n) = abs((x - 1)/(1 + (x - 1)*log(2))). [Corrected by Petros Hadjicostas, May 18 2020]
Difference between the denominator and the numerator of the (n-1)-th alternating harmonic number Sum_{k=1..n-1} (-1)^(k+1)*1/k = A058313(n-1)/A058312(n-1). - Alexander Adamchuk, Jul 22 2006
From Petros Hadjicostas, May 06 2020: (Start)
Inspired by Michael Somos's result below, we established the following formulas (valid for n >= 2). All the denominators in the first three formulas are equal to A334958(n).
b(n) = A024167(n)/gcd(A024167(n-1), A024167(n)).
c(n) = A024168(n)/gcd(A024168(n-1), A024168(n)).
d(n) = A024167(n-1)/gcd(A024167(n-1), A024167(n)).
b(n) + c(n) = n*(d(n) + a(n)).
u(n) = (A024167(n)*x + A024168(n))/(A024167(n-1)*x + A024168(n-1)). (End)

Crossrefs

Cf. A075827 (= b), A075828 (= c), A075830 (= d).

Programs

  • Mathematica
    Denominator[Table[Sum[(-1)^(k+1)*1/k,{k,1,n-1}],{n,1,30}]]-Numerator[Table[Sum[(-1)^(k+1)*1/k,{k,1,n-1}],{n,1,30}]] (* Alexander Adamchuk, Jul 22 2006 *)
  • PARI
    u(n) = if(n<2, x, (n-1)^2/u(n-1)+1);
    a(n) = polcoeff(denominator(u(n)), 0, x);

Formula

a(n) = A024168(n-1)/gcd(A024168(n-1), A024168(n)). - Michael Somos, Oct 29 2002
From Alexander Adamchuk, Jul 22 2006: (Start)
a(n) = A058312(n-1) - A058313(n-1) for n > 1 with a(1) = 1.
a(n) = denominator(Sum_{k=1..n-1} (-1)^(k+1)*1/k) - numerator(Sum_{k=1..n-1}(-1)^(k+1)*1/k). (End)

Extensions

Name edited by Petros Hadjicostas, May 06 2020

A075830 Let u(1) = x and u(n+1) = (n^2/u(n)) + 1 for n >= 1; then a(n) is such that u(n) = (b(n)*x + c(n))/(a(n)*x + d(n)) (in lowest terms) and a(n), b(n), c(n), d(n) are positive integers.

Original entry on oeis.org

0, 1, 1, 5, 7, 47, 37, 319, 533, 1879, 1627, 20417, 18107, 263111, 237371, 52279, 95549, 1768477, 1632341, 33464927, 155685007, 166770367, 156188887, 3825136961, 3602044091, 19081066231, 18051406831, 57128792093, 7751493599
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2002

Keywords

Comments

For x real <> 1 - 1/log(2), Lim_{n -> infinity} abs(u(n)-n) = abs((x - 1)/(1 + (x - 1)*log(2))). [Corrected by Petros Hadjicostas, May 18 2020]
From Petros Hadjicostas, May 05 2020: (Start)
Given x > 0, u(n) = (A075827(n)*x + A075828(n))/(a(n)*x + A075829(n)) = (b(n)*x + c(n))/(a(n)*x + d(n)) with gcd(gcd(b(n), c(n)), gcd(a(n), d(n))) = 1 for each n >= 1.
Conjecture 1: Define the sequences (A(n): n >= 1) and (B(n): n >= 1) by A(n+1) = n^2/A(n) + 1 for n >= 2 with A(1) = infinity and A(2) = 1, and B(n+1) = n^2/B(n) + 1 for n >= 3 with B(1) = 0, B(2) = infinity, and B(3) = 1. Then a(n) = denominator(A(n)), b(n) = numerator(A(n)), c(n) = numerator(B(n)), and d(n) = denominator(B(n)) (assuming infinity = 1/0). Also, gcd(a(n), d(n)) = 1.
In 2002, Michael Somos claimed that d(n) = A024168(n-1)/gcd(A024168(n-1), A024168(n)) for n >= 2. In 2006, N. J. A. Sloane claimed that a(n) = A058313(n-1) for n >= 2 while Alexander Adamchuk claimed that d(n) = A058312(n-1) - A058313(n-1) for n >= 2.
Conjecture 2: a(n) = A024167(n-1)/gcd(A024167(n-1), A024167(n)).
Conjecture 3: b(p) = a(p+1) for p = 1 or prime. In general, it seems that b(n) = A048671(n)*a(n+1) for all n for which A048671(n) < n.
Conjecture 4: c(n) = n*(a(n) + d(n)) - b(n) for n >= 1. (End)
All conjectures are proved in the link below except for the second part of Conjecture 3. - Petros Hadjicostas, May 21 2020

Crossrefs

Apart from the leading term, same as A058313.
Cf. A075827 (= b), A075828 (= c), A075829 (= d).

Programs

  • PARI
    u(n)=if(n<2,x,(n-1)^2/u(n-1)+1);
    a(n)=polcoeff(denominator(u(n)),1,x);

Extensions

Name edited by Petros Hadjicostas, May 04 2020

A334958 GCD of consecutive terms of the factorial times the alternating harmonic series.

Original entry on oeis.org

1, 1, 1, 2, 2, 12, 12, 48, 144, 1440, 1440, 17280, 17280, 241920, 18144000, 145152000, 145152000, 2612736000, 2612736000, 10450944000, 219469824000, 4828336128000, 4828336128000, 115880067072000, 579400335360000, 15064408719360000, 135579678474240000, 26573616980951040000, 26573616980951040000
Offset: 1

Views

Author

Petros Hadjicostas, May 17 2020

Keywords

Comments

For n = 1..14, we have a(n) = A025527(n), but a(15) = 18144000 <> 3628800 = A025527(15).
It appears that A025527(n) | a(n) for all n >= 1 and A025527(n) = a(n) for infinitely many n. In addition, it seems that a(n)/a(n-1) = A048671(n) for infinitely many n >= 2. However, I have not established these claims.
This sequence appears in formulas for sequences A075827, A075828, A075829, and A075830 (the first one of which was established in 2002 by Michael Somos).
Conjecture: a(n) = n! * Product_{p <= n} p^min(0, v_p(H'(n))), where the product ranges over primes p, H'(n) = Sum_{k=1..n} (-1)^(k+1)/k, and v_p(r) is the p-adic valuation of rational r (checked for n < 1100).

Examples

			A024167(4) = 4!*(1 - 1/2 + 1/3 - 1/4) = 14, A024167(5) = 5!*(1 - 1/2 + 1/3 - 1/4 + 1/5) = 94, A024168(4) = 4!*(1/2 - 1/3 + 1/4) = 10, and A024168(5) = 5!*(1/2 - 1/3 + 1/4 - 1/5) = 26. Then a(4) = gcd(14, 94) = gcd(10, 26) = gcd(14, 4!) = gcd(10, 4!) = gcd(14, 10) = 2.
		

Crossrefs

Cf. A056612 (similar sequence for the harmonic series).

Programs

  • Maple
    b:= proc(n) b(n):= (-(-1)^n/n +`if`(n=1, 0, b(n-1))) end:
    a:= n-> (f-> igcd(b(n)*f, f))(n!):
    seq(a(n), n=1..30);  # Alois P. Heinz, May 18 2020
  • Mathematica
    b[n_] := b[n] = -(-1)^n/n + If[n == 1, 0, b[n-1]];
    a[n_] := GCD[b[n] #, #]&[n!];
    Array[a, 30] (* Jean-François Alcover, Oct 27 2020, after Alois P. Heinz *)
  • SageMath
    def A():
        a, b, n = 1, 1, 2
        while True:
            yield gcd(a, b)
            b, a = a, a + b * n * n
            n += 1
    a = A(); print([next(a) for  in range(29)]) # _Peter Luschny, May 19 2020

Formula

a(n) = gcd(A024167(n+1), A024167(n)) = gcd(A024168(n+1), A024168(n)) = gcd(A024167(n), n!) = gcd(A024168(n), n!) = gcd(A024167(n), A024168(n)).

A075827 Let u(1) = x and u(n+1) = (n^2/u(n)) + 1 for n >= 1; then a(n) is such that u(n) =(a(n)*x + b(n))/(c(n)*x + d(n)) (in lowest terms) and a(n), b(n), c(n), d(n) are positive integers.

Original entry on oeis.org

1, 1, 5, 14, 47, 222, 319, 2132, 5637, 16270, 20417, 217284, 263111, 3323194, 3920925, 764392, 1768477, 29382138, 33464927, 622740028, 3502177707, 3436155514, 3825136961, 86449058184, 95405331155, 469336577606, 514159128837, 1519292745404, 236266661971, 6755272778730, 7313175618421
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2002

Keywords

Comments

For x real <> 1 - 1/log(2), Lim_{n -> infinity} abs(u(n) - n) = abs((x - 1)/(1 + (x - 1)*log(2))). [Corrected by Petros Hadjicostas, May 18 2020]

Crossrefs

Cf. A075828 (= b), A075829 (= d), A075830 (= c).

Programs

  • PARI
    u(n) = if(n<2, x, (n-1)^2/u(n-1)+1);
    a(n) = polcoeff(numerator(u(n)), 1, x);
    for(n=1, 30, print1(a(n)", ")) \\ Petros Hadjicostas, May 06 2020

Formula

From Petros Hadjicostas, May 18 2020: (Start)
a(n) = A024167(n)/gcd(A024167(n), A024167(n-1)) = A024167(n)/A334958(n-1) for n >= 2. (Cf. Michael Somos's result for d = A075829 using A024168.)
u(n) = (A024167(n)*x + A024168(n))/(A024167(n-1)*x + A024168(n-1)) for n >= 2. (End)

Extensions

Name edited by Petros Hadjicostas, May 06 2020
More terms from Michel Marcus, Aug 01 2025

A075828 Let u(1) = x and u(n+1) = (n^2/u(n)) + 1 for n >= 1; then a(n) is such that u(n) =(b(n)*x + a(n))/(c(n)*x + d(n)) (in lowest terms) and a(n), b(n), c(n), d(n) are positive integers.

Original entry on oeis.org

0, 1, 1, 10, 13, 138, 101, 1228, 1923, 8930, 7303, 115356, 97249, 1721846, 1484475, 388760, 681971, 14725926, 13093585, 308430212, 1386466053, 1685280806, 1529091919, 42052434936, 38450390845, 226713176794, 208661769963
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2002

Keywords

Comments

For x real <> 1 - 1/log(2), Lim_{n -> infinity} abs(u(n) - n) = abs((x - 1)/(1 + (x - 1)*log(2))). [Corrected by Petros Hadjicostas, May 18 2020]

Crossrefs

Cf. A075827 (= b), A075829 (= d), A075830 (= c).

Programs

  • PARI
    u(n) = if(n<2, x, (n-1)^2/u(n-1)+1);
    a(n) = polcoeff(numerator(u(n)), 0 ,x)

Formula

From Petros Hadjicostas, May 18 2020: (Start)
a(n) = A024168(n)/gcd(A024168(n), A024168(n-1)) = A024168(n)/A334958(n) for n >= 2. (Cf. Michael Somos's claim for d = A075829 using A024168.)
u(n) = (A024167(n)*x + A024168(n))/(A024167(n-1)*x + A024168(n-1)) for n >= 2. (End)

Extensions

Name edited by Petros Hadjicostas, May 06 2020

A330858 Triangle read by rows: T(n,k) is the number of permutations in S_n for which all cycles have length <= k.

Original entry on oeis.org

1, 1, 2, 1, 4, 6, 1, 10, 18, 24, 1, 26, 66, 96, 120, 1, 76, 276, 456, 600, 720, 1, 232, 1212, 2472, 3480, 4320, 5040, 1, 764, 5916, 14736, 22800, 29520, 35280, 40320, 1, 2620, 31068, 92304, 164880, 225360, 277200, 322560, 362880, 1, 9496, 171576, 632736
Offset: 1

Views

Author

Peter Kagey, Apr 28 2020

Keywords

Examples

			For n = 3 and k = 2, the T(3,2) = 4 permutations in S_3 where all cycle lengths are less than or equal to 2 are:
(1)(2)(3), (12)(3), (13)(2), and (1)(23).
Table begins:
n\k| 1    2     3     4      5      6      7      8      9
---+------------------------------------------------------
  1| 1
  2| 1    2
  3| 1    4     6
  4| 1   10    18    24
  5| 1   26    66    96    120
  6| 1   76   276   456    600    720
  7| 1  232  1212  2472   3480   4320   5040
  8| 1  764  5916 14736  22800  29520  35280  40320
  9| 1 2620 31068 92304 164880 225360 277200 322560 362880
		

Crossrefs

T(n,floor(n/2)) gives A024168.
Cf. A126074.

Programs

  • Mathematica
    T[n_, k_] := T[n, k] = If[n <= k, n!, n*T[n-1, k] - FactorialPower[n-1, k]* T[n-k-1, k]];
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Apr 28 2020 *)
  • PARI
    T4(n, k)=if(k<1 || k>n, 0, n!/(n-k)!); \\ A068424
    T(n,k) = if (n<=k, n!, n*T(n-1,k) - T4(n-1,k)*T(n-k-1,k));
    tabl(nn) = for (n=1, nn, for (k=1, n, print1(T(n,k), ", ")); print); \\ Michel Marcus, May 09 2020

Formula

T(n,k) = n! if n <= k, otherwise T(n,k) = n*T(n-1,k) - A068424(n-1,k)*T(n-k-1,k).
T(n,k) = Sum_{j=1..k} A126074(n,j). - Alois P. Heinz, Jul 08 2022

A119248 a(n) is the difference between denominator and numerator of the n-th alternating harmonic number Sum_{k=1..n} (-1)^(k+1)/k = A058313(n)/A058312(n).

Original entry on oeis.org

0, 1, 1, 5, 13, 23, 101, 307, 641, 893, 7303, 9613, 97249, 122989, 19793, 48595, 681971, 818107, 13093585, 77107553, 66022193, 76603673, 1529091919, 1752184789, 7690078169, 8719737569, 23184641107, 3721854001, 96460418429
Offset: 1

Views

Author

Alexander Adamchuk, Jul 22 2006

Keywords

Comments

a(n)/A058312(n) = 1 - A058313(n)/A058312(n) appears in the locker puzzle (see the links in A364317) for the probability of success with the strategy used there for n lockers and allowed openings of up to floor(n/2) lockers. Note that gcd(a(n), A058312(n)) = 1. - Wolfdieter Lang, Aug 12 2023

Crossrefs

Programs

  • Mathematica
    Denominator[Table[Sum[(-1)^(k+1)/k,{k,1,n}],{n,1,30}]]-Numerator[Table[Sum[(-1)^(k+1)/k,{k,1,n}],{n,1,30}]]
  • PARI
    a(n) = my(x=sum(k=1, n, (-1)^(k+1)/k)); denominator(x) - numerator(x); \\ Michel Marcus, May 07 2020

Formula

a(n) = denominator(Sum_{k=1..n} (-1)^(k+1)/k) - numerator(Sum_{k=1..n} (-1)^(k+1)/k).
a(n) = A058312(n) - A058313(n).
a(n) = A075829(n+1).
a(n) = numerator(Sum_{k=2..n} (-1)^k/k). (Cf. A024168.) - Petros Hadjicostas, May 17 2020

A335023 Ratios of consecutive terms of A334958.

Original entry on oeis.org

1, 1, 2, 1, 6, 1, 4, 3, 10, 1, 12, 1, 14, 75, 8, 1, 18, 1, 4, 21, 22, 1, 24, 5, 26, 9, 196, 1, 30, 1, 16, 33, 34, 5, 36, 1, 38, 39, 40, 1, 42, 1, 44, 45, 46, 1, 48, 7, 50, 51, 52, 1, 54, 55, 56, 57, 58, 1, 60, 1, 62, 63, 32, 65, 66, 1, 68, 69, 70, 1, 72, 1, 74, 375, 76, 847
Offset: 1

Views

Author

Petros Hadjicostas, May 19 2020

Keywords

Comments

Conjecture: a(n) = 1 if and only if n+1 is prime.

Crossrefs

Programs

  • Maple
    b:= proc(n) b(n):= (-(-1)^n/n +`if`(n=1, 0, b(n-1))) end:
    g:= proc(n) g(n):= (f-> igcd(b(n)*f, f))(n!) end:
    a:= n-> g(n+1)/g(n):
    seq(a(n), n=1..80);  # Alois P. Heinz, May 20 2020
  • Mathematica
    b[n_] := b[n] = -(-1)^n/n + If[n==1, 0, b[n-1]];
    g[n_] := GCD[b[n] #, #]&[n!];
    a[n_] := g[n+1]/g[n];
    Array[a, 80] (* Jean-François Alcover, Nov 30 2020, after Alois P. Heinz *)
  • PARI
    f(n) = n!*sum(k=2, n, (-1)^k/k); \\ A024168
    g(n) = gcd(f(n+1), f(n)); \\ A334958
    a(n) = g(n+1)/g(n); \\ Michel Marcus, May 20 2020

Formula

a(n) = A334958(n+1)/A334958(n).
Showing 1-10 of 10 results.