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.

A089026 a(n) = n if n is a prime, otherwise a(n) = 1.

Original entry on oeis.org

1, 2, 3, 1, 5, 1, 7, 1, 1, 1, 11, 1, 13, 1, 1, 1, 17, 1, 19, 1, 1, 1, 23, 1, 1, 1, 1, 1, 29, 1, 31, 1, 1, 1, 1, 1, 37, 1, 1, 1, 41, 1, 43, 1, 1, 1, 47, 1, 1, 1, 1, 1, 53, 1, 1, 1, 1, 1, 59, 1, 61, 1, 1, 1, 1, 1, 67, 1, 1, 1, 71, 1, 73, 1, 1, 1, 1, 1, 79, 1, 1, 1, 83, 1, 1, 1, 1, 1, 89, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Roger L. Bagula, Nov 12 2003

Keywords

Comments

This sequence was the subject of the 1st problem of the 9th Irish Mathematical Olympiad 1996 with gcd((n + 1)!, n! + 1) = a(n+1) for n >= 0 (see formula Jan 23 2009 and link). - Bernard Schott, Jul 22 2020
For sequence A with terms a(1), a(2), a(3),... , let R(0) = 1 and for k >= 1 let R(k) = rad(a(1)*a(2)*...*a(k)). Define the Rad-transform of A to be R(n)/R(n-1); n >= 1, where rad is A007947. Then this sequence is the Rad transform of the positive integers, A = A000027. - David James Sycamore, Apr 19 2024

Examples

			From Larry Tesler (tesler(AT)pobox.com), Nov 08 2010: (Start)
a(9) = (8*9*10)/(2^((5+2+1)-(3+1+0))*3^((3+1)-(2+0))*5^((2)-(1))*7^((1)-(1))) = 1 [composite].
a(10) = (8*9*10)/(2^((5+2+1)-(3+1+0))*3^((3+1)-(2+0))*5^((2)-(1))*7^((1)-(1))) = 1 [composite].
a(11) = (8*9*10*11*12)/(2^((6+3+1)-(3+1+0))*3^((4+1)-(2+0))*5^((2)-(1))*7^((1)-(1))) = 11 [prime]. (End)
		

References

  • Paulo Ribenboim, The little book of big primes, Springer 1991, p. 106.
  • L. Tesler, "Factorials and Primes", Math. Bulletin of the Bronx H.S. of Science (1961), 5-10. [From Larry Tesler (tesler(AT)pobox.com), Nov 08 2010]

Crossrefs

Differs from A080305 at n=30.

Programs

  • MATLAB
    a = [1:96]; a(isprime(a) == false) = 1; % Thomas Scheuerle, Oct 06 2022
    
  • Magma
    [IsPrime(n) select n else 1: n in [1..96]]; // Marius A. Burtea, Aug 02 2019
    
  • Mathematica
    digits=200; a=Table[If[PrimePi[n]-PrimePi[n-1]>0, n, 1], {n, 1, digits}]; Table[Numerator[(n/2)/(n-1)! ] + Floor[2/n] - 2*Floor[1/n], {n,1,200}] (* Alexander Adamchuk, May 20 2006 *)
    Range@ 120 /. k_ /; CompositeQ@ k -> 1 (* or *)
    Table[n Boole@ PrimeQ@ n, {n, 120}] /. 0 -> 1 (* or *)
    Table[If[PrimeQ@ n, n, 1], {n, 120}] (* Michael De Vlieger, Jul 02 2016 *)
  • PARI
    a(n) = n^isprime(n) \\ David A. Corneth, Oct 06 2022
  • Python
    from sympy import isprime
    def a(n): return n if isprime(n) else 1
    print([a(n) for n in range(1, 97)]) # Michael S. Branicky, Oct 06 2022
    
  • Sage
    def A089026(n):
        if n == 4: return 1
        f = factorial(n-1)
        return (f + 1) - n*(f//n)
    [A089026(n) for n in (1..96)]   # Peter Luschny, Oct 16 2013
    

Formula

From Peter Luschny, Nov 29 2003: (Start)
a(n) = denominator(n! * Sum_{m=0..n} (-1)^m*m!*Stirling2(n+1, m+1)/(m+1)).
a(n) = denominator(n! * Sum_{m=0..n} (-1)^m*m!*Stirling2(n, m)/(m+1)). (End)
From Alexander Adamchuk, May 20 2006: (Start)
a(n) = numerator((n/2)/(n-1)!) + floor(2/n) - 2*floor(1/n).
a(n) = A090585(n-1) = A000217(n-1)/A069268(n-1) for n>2. (End)
a(n) = gcd(n,(n-1)!+1). - Jaume Oliver Lafont, Jul 17 2008, Jan 23 2009
a(1) = 1, a(2) = 2, then a(n) = 1 or a(n) = n = prime(m) = (Product q+k, k = 1 .. 2*floor(n/2+1)-q) / (Product prime(i)^(Sum (floor((n+1)/(prime(i)^w)) - floor(q/(prime(i)^w)) ), w = 1 .. floor(log[base prime(i)] n+1) ), i = 2 .. m-1) where q = prime(m-1). - Larry Tesler (tesler(AT)pobox.com), Nov 08 2010
a(n) = (n!*HarmonicNumber(n) mod n)+1, n != 4. - Gary Detlefs, Dec 03 2011
a(n) = denominator of (n!)/n^(3/2). - Arkadiusz Wesolowski, Dec 04 2011
a(n) = A034386(n+1)/A034386(n). - Eric Desbiaux, May 10 2013
a(n) = n^c(n), where c = A010051. - Wesley Ivan Hurt, Jun 16 2013
a(n) = A014963(n)^(-A008683(n)). - Mats Granvik, Jul 02 2016
Conjecture: for n > 3, a(n) = gcd(n, A007406(n-1)). - Thomas Ordowski, Aug 02 2019
a(n) = 1 + c(n)*(n-1), where c = A010051. - Wesley Ivan Hurt, Jun 21 2025

A090585 Numerator of (Sum_{k=1..n} k) / (Product_{k=1..n} k).

Original entry on oeis.org

1, 3, 1, 5, 1, 7, 1, 1, 1, 11, 1, 13, 1, 1, 1, 17, 1, 19, 1, 1, 1, 23, 1, 1, 1, 1, 1, 29, 1, 31, 1, 1, 1, 1, 1, 37, 1, 1, 1, 41, 1, 43, 1, 1, 1, 47, 1, 1, 1, 1, 1, 53, 1, 1, 1, 1, 1, 59, 1, 61, 1, 1, 1, 1, 1, 67, 1, 1, 1, 71, 1, 73, 1, 1, 1, 1, 1, 79, 1, 1, 1, 83, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 03 2003

Keywords

Comments

If the offset is set to 2 then [a(n) <> 1] is the indicator function of the odd primes ([] Iverson bracket). [Peter Luschny, Jul 05 2009]

Examples

			For n=5, (1+2+3+4+5)/(1*2*3*4*5) = 15/120 = 1/8, so a(5) = 1. For n=6, (1+2+3+4+5+6)/(1*2*3*4*5*6) = 21/720 = 7/240, so a(6) = 7. - _Michael B. Porter_, Jul 02 2016
		

Crossrefs

Denominator = A090586.

Programs

  • Maple
    a := n -> denom(2*n!/(n+1)); # Peter Luschny, Jul 05 2009
  • Mathematica
    With[{nn=100},Numerator[Accumulate[Range[nn]]/Rest[FoldList[Times,1,Range[nn]]]]] (* Harvey P. Dale, Sep 09 2014 *)
  • PARI
    for(n=1,100,print1(gcd(n*(n+1)/2,round(factorial(n))+1),", ")); \\ Jaume Oliver Lafont, Jan 23 2009

Formula

a(n) = A000217(n) / A069268(n).
a(n) = A089026(n+1) for n>1.
Also for n>1, a(n) is a numerator of determinant of (n-1) X (n-1) matrix with M(i,j) = (i+2)/(i+1) if i=j, otherwise 1. E.g., a(2) = Numerator[Det[{{3/2}}]] = Numerator[3/2] = 3. a(3) = Numerator[Det[{{3/2,1},{1,4/3}}]] = Numerator[1/1] = 1. a(4) = Numerator[Det[{{3/2,1,1},{1,4/3,1},{1,1,5/4}}]] = Numerator[5/12] = 5. - Alexander Adamchuk, May 26 2006
a(n) = gcd(n*(n+1)/2, n!+1). [Jaume Oliver Lafont, Jan 23 2009]

A060593 a(n) is the number of ways that a cycle of length 2n+1 in the symmetric group S_(2n+1) can be decomposed as the product of two cycles of length 2n+1.

Original entry on oeis.org

1, 1, 8, 180, 8064, 604800, 68428800, 10897286400, 2324754432000, 640237370572800, 221172909834240000, 93666727314800640000, 47726800133326110720000, 28806532937614688256000000, 20325889640780924033433600000, 16578303738261941164769280000000
Offset: 0

Views

Author

Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 12 2001

Keywords

Comments

The sequence deals only with S_m for odd m because for even m the number of representations of an m-cycle in S_m as a product of two m-cycles is zero.
a(n) = product of first 2n-1 numbers divided by their sum. E.g., a(3) = (1*2*3*4*5)/(1+2+3+4+5) = 120/15 = 8. - Amarnath Murthy, Jun 03 2004
a(n) is also the number of permutations in Sym(2n) whose "cycle graph" (or "breakpoint graph") contains exactly one alternating cycle, for n>=1 (see Doignon and Labarre). - Anthony Labarre, Jun 19 2007

Examples

			a(1) = 1 because in S_3 the only way to write the cycle (123) as a product of two 3-cycles is: (123) = (132)(132).
		

Crossrefs

Programs

  • Maple
    for n from 0 to 25 do printf(`%d,`,(2*n)!/(n+1)) od:
  • Mathematica
    Table[(2*n)!/(n + 1), {n, 0, 13}] (* Amiram Eldar, Feb 08 2022 *)
  • PARI
    a(n) = (2*n)! / (n + 1); \\ Harry J. Smith, Jul 07 2009

Formula

a(n) = (2n)! / (n+1).
Integral representation as n-th moment of a positive function on positive half-axis, in Maple notation: a(n)=int(x^n*(exp(-sqrt(x))/sqrt(x)+Ei(-sqrt(x))), x=0..infinity), n=0, 1, 2, ..., where Ei(y) is the exponential integral. This representation is unique. - Karol A. Penson, Aug 27 2001
a(n) = n!^2*binomial(2*n,n)/(n+1). - Zerinvary Lajos, Jun 06 2006
a(n) = A090586(2*n + 1). - Gregory Gerard Wojnar, Jun 10 2021
From Amiram Eldar, Feb 08 2022: (Start)
Sum_{n>=0} 1/a(n) = cosh(1) + sinh(1)/2.
Sum_{n>=0} (-1)^n/a(n) = cos(1) - sin(1)/2. (End)
From Wolfdieter Lang, Feb 02 2024: (Start)
O.g.f.: hypergeometric([1,1,1,1/2],[2],4*x).
E.g.f.: hypergeometric([1,1,1/2],[2],4*x). (End)
a(n) = A177267(2n+1,n). - Alois P. Heinz, Feb 16 2024
D-finite with recurrence (n+1)*a(n) -2*n^2*(2*n-1)*a(n-1)=0. - R. J. Mathar, May 26 2025

Extensions

More terms from James Sellers, Apr 13 2001

A069268 Greatest common divisor of n! and n*(n+1)/2.

Original entry on oeis.org

1, 1, 6, 2, 15, 3, 28, 36, 45, 5, 66, 6, 91, 105, 120, 8, 153, 9, 190, 210, 231, 11, 276, 300, 325, 351, 378, 14, 435, 15, 496, 528, 561, 595, 630, 18, 703, 741, 780, 20, 861, 21, 946, 990, 1035, 23, 1128, 1176, 1225, 1275, 1326
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 14 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[GCD[n!,(n(n+1))/2],{n,60}] (* Harvey P. Dale, Oct 14 2013 *)

Formula

a(n) = if n>1 and n+1 is prime then n/2 else n*(n+1)/2.

A093420 Triangle read by rows: T(n,k) is the numerator of f(n, k) = (Product_{i = 0..k-1} (n-i))/(Sum_{i = 1..k} i) for 1 <= k <= n.

Original entry on oeis.org

1, 2, 2, 3, 2, 1, 4, 4, 4, 12, 5, 20, 10, 12, 8, 6, 10, 20, 36, 48, 240, 7, 14, 35, 84, 168, 240, 180, 8, 56, 56, 168, 448, 960, 1440, 1120, 9, 24, 84, 1512, 1008, 2880, 6480, 10080, 8064, 10, 30, 120, 504, 2016, 7200, 21600, 50400, 80640, 725760, 11, 110, 165
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  1,
  2,  2,
  3,  2,  1,
  4,  4,  4, 12,
  5, 20, 10, 12,   8,
  6, 10, 20, 36,  48, 240,
  7, 14, 35, 84, 168, 240, 180;
  ...
		

Crossrefs

Cf. A090585, A090586, A093412, A093421 (denominators), A093422.

Formula

T(n,n) = numerator(f(n, n)) = numerator(2*(n-1)!/(n+1)) = A090586(n).

Extensions

Edited and extended by David Wasserman, Aug 29 2006

A093421 Triangle read by rows: T(n,k) is the denominator of f(n, k) = (Product_{i = 0..k-1} (n-i))/(Sum_{i = 1..k} i) for 1 <= k <= n.

Original entry on oeis.org

1, 1, 3, 1, 1, 1, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2004

Keywords

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  1;
  1, 3;
  1, 1, 1;
  1, 1, 1, 5;
  1, 3, 1, 1, 1;
  1, 1, 1, 1, 1, 7;
  1, 1, 1, 1, 1, 1, 1;
  1, 3, 1, 1, 1, 1, 1, 1;
  1, 1, 1, 5, 1, 1, 1, 1, 1;
  1, 1, 1, 1, 1, 1, 1, 1, 1, 11;
  ...
		

Crossrefs

Cf. A090585, A090586, A093415, A093420 (numerators), A093423.

Formula

T(n,n) = denominator(f(n, n)) = denominator(2*(n-1)!/(n+1)).

Extensions

Edited and extended by David Wasserman, Aug 29 2006

A110560 Numerators of T(n+1)/n! reduced to lowest terms, where T(n) are the triangular numbers A000217.

Original entry on oeis.org

1, 3, 3, 5, 5, 7, 7, 1, 1, 11, 11, 13, 13, 1, 1, 17, 17, 19, 19, 1, 1, 23, 23, 1, 1, 1, 1, 29, 29, 31, 31, 1, 1, 1, 1, 37, 37, 1, 1, 41, 41, 43, 43, 1, 1, 47, 47, 1, 1, 1, 1, 53, 53, 1, 1, 1, 1, 59, 59, 61, 61, 1, 1, 1, 1, 67, 67, 1, 1, 71, 71, 73, 73, 1, 1, 1, 1, 79, 79, 1, 1, 83, 83
Offset: 0

Views

Author

Jonathan Vos Post, Jul 27 2005

Keywords

Comments

The exponential generating function of the triangular numbers was given in Sloane & Plouffe as g(x) = (1 + 2x + (x^2)/2)*e^x = 1 + 3*x + 3*x^2 + (5/3)*x^3 + (5/8)*x^4 + (7/40)*x^5 + (1/896)*x^6 + (11/72576)*x^7 + ... = 1 + 3*x/1! + 6*(x^2)/2! + 10*(x^3)/3! + 15*(x^4)/4! + ...

Examples

			a(3) = 5 because T(3+1)/3! = T(4)/3! = (4*5/2)/(1*2*3) = 10/6 = 5/3 so the fraction has numerator 5 and denominator A110561(3) = 3. Furthermore, the 3rd term of the exponential generating function of the triangular numbers is (5/3)*x^3.
		

References

  • Sloane, N. J. A. and Plouffe, S. The Encyclopedia of Integer Sequences. San Diego, CA: Academic Press, 1995, p. 9.

Crossrefs

Denominator = A110561.
Closely related to this is T(n)/n! which is A090585/A090586.

Programs

  • Mathematica
    T[n_] := n*(n + 1)/2; Table[Numerator[T[n + 1]/n! ], {n, 0, 82}]
    Join[{1},Numerator[With[{nn=90},Rest[Accumulate[Range[nn+1]]]/ Range[ nn]!]]] (* Harvey P. Dale, Feb 17 2016 *)

Formula

a(n)/A110561(n) is the n-th coefficient of the exponential generating function of T(n), the triangular numbers A000217.
a(n) = Denominator((n+2)!*HarmonicNumber(n+2)/binomial(n+2,2)). [Gary Detlefs, Dec 03 2011]

Extensions

Extended by Ray Chandler, Jul 27 2005

A110561 Denominators of T(n+1)/n! reduced to lowest terms, where T(n) are the triangular numbers A000217.

Original entry on oeis.org

1, 1, 1, 3, 8, 40, 180, 140, 896, 72576, 604800, 6652800, 68428800, 59304960, 726485760, 163459296000, 2324754432000, 39520825344000, 640237370572800, 579262382899200, 10532043325440000, 4644631106519040000
Offset: 0

Views

Author

Jonathan Vos Post, Jul 27 2005

Keywords

Comments

The exponential generating function of the triangular numbers was given in Sloane & Plouffe as g(x) = (1 + 2x + (x^2)/2)*e^x = 1 + 3*x + 3*x^2 + (5/3)*x^3 + (5/8)*x^4 + (7/40)*x^5 + (1/896)*x^6 + (11/72576)*x^7 + ... = 1 + 3*x/1! + 6*(x^2)/2! + 10*(x^3)/3! + 15*(x^4)/4! + ...

Examples

			a(3) = 3 because T(3+1)/3! = T(4)/3! = (4*5/2)/(1*2*3) = 10/6 = 5/3 so the fraction has denominator 3 and numerator A110560(3) = 5. Furthermore, the 3rd term of the exponential generating function of the triangular numbers is (5/3)*x^3.
		

References

  • Sloane, N. J. A. and Plouffe, S. The Encyclopedia of Integer Sequences. San Diego, CA: Academic Press, 1995, p. 9.

Crossrefs

Numerator = A110560.
Closely related to this is T(n)/n! which is A090585/A090586.

Programs

  • Mathematica
    T[n_] := n*(n + 1)/2; Table[Denominator[T[n + 1]/n! ], {n, 0, 21}]
    With[{nn=30},Denominator[Accumulate[Range[nn]]/Range[0,nn-1]!]] (* Harvey P. Dale, Aug 15 2014 *)

Formula

A110560(n)/A110561(n) is the n-th coefficient of the exponential generating function of T(n), the triangular numbers A000217.

Extensions

Extended by Ray Chandler, Jul 27 2005

A271387 Numerator of prime(n)#/n!, where prime(n)# is the prime factorial function.

Original entry on oeis.org

1, 2, 3, 5, 35, 77, 1001, 2431, 46189, 1062347, 30808063, 86822723, 3212440751, 10131543907, 435656388001, 20475850236047, 1085220062510491, 3766351981654057, 229747470880897477, 810162134158954261, 57521511525285752531, 4199070341345859934763, 331726556966322934846277
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 06 2016

Keywords

Examples

			1, 2, 3, 5, 35/4, 77/4, 1001/24, 2431/24, 46189/192, 1062347/1728, 30808063/17280, 86822723/17280, 3212440751/207360, 10131543907/207360, 435656388001/2903040, ...
a(8) = 46189, because prime(8)#/8! = (2*3*5*7*11*13*17*19)/(1*2*3*4*5*6*7*8) = 46189/192.
		

Crossrefs

Cf. A000040, A000142, A000720, A002110, A007947, A034386, A049614 (denominator of prime(n)#/n!), A090586, A135568.

Programs

  • Mathematica
    Table[Numerator[Product[Prime@ k, {k, n}]/n!], {n, 0, 22}] (* Michael De Vlieger, Apr 08 2016 *)
  • PARI
    a(n) = numerator(prod(k=1, n, prime(k))/n!); \\ Michel Marcus, Apr 09 2016

Formula

a(n) = prime(n)#/GCD(prime(n)#, n!), where GCD(a, b) is the greatest common divisor.
a(n) = prime(n)#/prime(pi(n))#, where pi(n) is the number of primes <= n.
a(n) = A002110(n)/A034386(n) = A002110(n)/A002110(A000720(n)) = A002110(n)/A007947(A000142(n)).

A273878 Numerator of (2*(n+1)!/(n+2)).

Original entry on oeis.org

1, 4, 3, 48, 40, 1440, 1260, 8960, 72576, 7257600, 6652800, 958003200, 889574400, 11623772160, 163459296000, 41845579776000, 39520825344000, 12804747411456000, 12164510040883200, 231704953159680000, 4644631106519040000
Offset: 0

Views

Author

Johannes W. Meijer, Jun 08 2016

Keywords

Comments

The moments, i.e. E(X^n) = int(x^n * p(x), x = 0..infinity) for n > 0, of the probability density function p(x) = 2*x*E(x, 1, 1), see A163931, lead to this sequence.

Examples

			The first few moments of p(x) are: 1, 4/3, 3, 48/5, 40, 1440/7, … .
		

Crossrefs

Programs

  • Maple
    a := proc(n): numer(2*(n+1)!/(n+2)) end: seq(a(n), n=0..20);
  • PARI
    a(n) = numerator(2*(n+1)!/(n+2)) \\ Felix Fröhlich, Jun 09 2016

Formula

a(n) = numer(2*(n+1)!/(n+2))
a(n) = (n+1) * A090586(n+1)
a(2*n) = A110468(n) and a(2*n+1) = (2*n)!*A085250(n+1)/A128060(n+2).
Showing 1-10 of 10 results.