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-3 of 3 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]

A090586 Denominator of Sum/Product of first n numbers.

Original entry on oeis.org

1, 2, 1, 12, 8, 240, 180, 1120, 8064, 725760, 604800, 79833600, 68428800, 830269440, 10897286400, 2615348736000, 2324754432000, 711374856192000, 640237370572800, 11585247657984000, 221172909834240000, 102181884343418880000, 93666727314800640000
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 03 2003

Keywords

Comments

a(n) = A000142(n)/A069268(n);
a(p-1) = 2*A000142(p-2) for odd primes.
a(n) = A060593((n - 1)/2) for odd n. - Gregory Gerard Wojnar, Jun 10 2021

Crossrefs

Cf. A090585 (numerator), A060593.
Main diagonal of A093420.

Programs

  • Magma
    [Denominator(n + 1) / (2*Factorial(n - 1)): n in [1..30]]; // Vincenzo Librandi, Oct 15 2018
  • Maple
    seq(denom((n+1)/(2*(n-1)!)),n=1..25); # Robert Israel, Oct 14 2018
  • Mathematica
    Table[Denominator[(n + 1) / (2 (n - 1)!)], {n, 25}] (* Vincenzo Librandi, Oct 15 2018 *)
Showing 1-3 of 3 results.