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 11-20 of 25 results. Next

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

Original entry on oeis.org

1, 1, 1, 4, 1, 6, 1, 8, 9, 10, 1, 12, 1, 14, 15, 16, 1, 18, 1, 20, 21, 22, 1, 24, 25, 26, 27, 28, 1, 30, 1, 32, 33, 34, 35, 36, 1, 38, 39, 40, 1, 42, 1, 44, 45, 46, 1, 48, 49, 50, 51, 52, 1, 54, 55, 56, 57, 58, 1, 60
Offset: 1

Views

Author

Keywords

Comments

Denominator of (1 + Gamma(n))/n.
Möbius transform of A380441(n). - Wesley Ivan Hurt, Jun 21 2025

References

  • Paulo Ribenboim, The little book of big primes, Springer 1991, p. 106.

Crossrefs

Cf. A005171, A005450 (numerators).

Programs

  • Magma
    [IsPrime(n) select 1 else n: n in [1..70]]; // Vincenzo Librandi, Feb 22 2013
    
  • Magma
    [Denominator((1 + Factorial(n-1))/n): n in [1..70]]; // G. C. Greubel, Nov 22 2022
    
  • Maple
    seq(denom((1 + (n-1)!)/n), n=1..80); # G. C. Greubel, Nov 22 2022
  • Mathematica
    Table[If[PrimeQ[n], 1, n], {n, 70}] (* Vincenzo Librandi, Feb 22 2013 *)
    a[n_] := ((n-1)! + 1)/n - Floor[(n-1)!/n] // Denominator; Table[a[n] , {n, 70}] (* Jean-François Alcover, Jul 17 2013, after Minac's formula *)
    Table[Denominator[(1 + Gamma[n])/n], {n,2,70}] (* G. C. Greubel, Nov 22 2022 *)
  • Sage
    def A005451(n):
        if n == 4: return n
        f = factorial(n-1)
        return 1/((f + 1)/n - f//n)
    [A005451(n) for n in (1..71)]   # Peter Luschny, Oct 16 2013
    
  • SageMath
    [denominator((1+gamma(n))/n) for n in range(1,71)] # G. C. Greubel, Nov 22 2022

Formula

Define b(n) = ( (n-1)*(n^2-3*n+1)*b(n-1) - (n-2)^3*b(n-2) )/(n*(n-3)); b(2) = b(3) = 1; a(n) = denominator(b(n)).
a(n) = A088140(n), n >= 3. - R. J. Mathar, Oct 28 2008
a(n) = gcd(n, (n!*n!!)/n^2). - Lechoslaw Ratajczak, Mar 09 2019
From Wesley Ivan Hurt, Jun 21 2025: (Start)
a(n) = n^c(n), where c = A005171.
a(n) = Sum_{d|n} A380441(d) * mu(n/d). (End)

Extensions

Name edited and a(1)=1 prepended by G. C. Greubel, Nov 22 2022. Name further edited by N. J. A. Sloane, Nov 22 2022

A128059 a(n) = numerator((2*n-1)^2/(2*(2*n)!)).

Original entry on oeis.org

1, 1, 3, 5, 7, 1, 11, 13, 1, 17, 19, 1, 23, 1, 1, 29, 31, 1, 1, 37, 1, 41, 43, 1, 47, 1, 1, 53, 1, 1, 59, 61, 1, 1, 67, 1, 71, 73, 1, 1, 79, 1, 83, 1, 1, 89, 1, 1, 1, 97, 1, 101, 103, 1, 107, 109, 1, 113, 1, 1, 1, 1, 1, 1, 127
Offset: 0

Views

Author

Paul Barry, Feb 13 2007

Keywords

Comments

1's between primes correspond to odd nonprimes (see A047846).

Crossrefs

Essentially the odd bisection of A089026.

Programs

  • Haskell
    a128059 0 = 1
    a128059 n = f n n where
       f 1 _ = 1
       f x q = if a010051' q' == 1 then q' else f x' q'
               where x' = x - 1; q' = q + x'
    -- Reinhard Zumkeller, Jun 14 2015
    
  • Maple
    A128059 := proc(n): numer(((2*n-1)^2)/(2*(2*n)!)) end: seq(A128059(n), n=0..64); # Artur Jasinski, Nov 29 2008
    A128059 := proc(n): if isprime(2*n-1) then 2*n-1 else 1 fi: end: seq(A128059(n), n=0..64); # Johannes W. Meijer, Oct 25 2012, Jun 01 2016
  • Mathematica
    Table[Numerator[(2 n - 1)^2/(2 (2 n)!)], {n, 0, 64}] (* Michael De Vlieger, Jun 01 2016 *)
  • Python
    from sympy import isprime
    def A128059(n): return a if isprime(a:=(n<<1)-1) else 1 # Chai Wah Wu, Feb 26 2024

Formula

Conjecture: a(n) = denominator(f(n-1)) with f(n) = lcm(2,3,4,5,...,n)*(Sum_{k=0..n} frac(Bernoulli(2*k))*binomial(n+k,k)). - Yalcin Aktar, Jul 23 2008
a(n) = 2*n-3 if 2*n-3 is prime and a(n) = 1 otherwise. a(n+4) = A145737(n+2), for n >= 1. - Artur Jasinski, Nov 29 2008
a(n+1) = denominator( (2n)!/(2n+1) ), n > 0. - Wesley Ivan Hurt, Jun 19 2013
a(n+1) = abs(2n*(pi(2n) - pi(2n-2)) - 1) where abs is the absolute value function and pi is the prime counting function (A000720). - Anthony Browne, Jun 28 2016
a(n+1) = denominator(Bernoulli(2*n)*(2*n)!) = numerator(Clausen(2*n,1)/(2*n)!) with Clausen defined in A160014. - Peter Luschny, Sep 25 2016

A195185 Inverse permutation of A195184; every positive integer occurs exactly once.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 10, 7, 8, 9, 14, 11, 12, 13, 15, 21, 19, 16, 17, 18, 20, 27, 25, 22, 23, 24, 26, 28, 36, 34, 32, 29, 30, 31, 33, 35, 45, 44, 42, 40, 37, 38, 39, 41, 43, 55, 54, 53, 51, 49, 46, 47, 48, 50, 52, 65, 64, 63, 61, 59, 56, 57, 58, 60, 62, 66, 78, 76, 75
Offset: 1

Views

Author

Clark Kimberling, Sep 10 2011

Keywords

Crossrefs

Programs

  • Mathematica
    p[n_] := If[PrimeQ[n], n, 1]
    Table[p[n], {n, 1, 90}]  (* A089026 *)
    g[1] = {1}; g[n_] := Insert[g[n - 1], n, p[n]]
    f[1] = g[1]; f[n_] := Join[f[n - 1], g[n]]
    f[20] (* A195183 *)
    row[n_] := Position[f[30], n];
    u = TableForm[Table[row[n], {n, 1, 5}]]
    v[n_, k_] := Part[row[n], k];
    w = Flatten[Table[v[k, n - k + 1], {n, 1, 13},
      {k, 1, n}]]  (* A195184 *)
    q[n_] := Position[w, n]; Flatten[
    Table[q[n], {n, 1, 80}]]  (* A195185 *)

A201146 Triangle read by rows: T(n,k) = (n#)/(k#), 1 <= k <= n.

Original entry on oeis.org

1, 2, 1, 6, 3, 1, 6, 3, 1, 1, 30, 15, 5, 5, 1, 30, 15, 5, 5, 1, 1, 210, 105, 35, 35, 7, 7, 1, 210, 105, 35, 35, 7, 7, 1, 1, 210, 105, 35, 35, 7, 7, 1, 1, 1, 210, 105, 35, 35, 7, 7, 1, 1, 1, 1, 2310, 1155, 385, 385, 77, 77, 11, 11, 11, 11, 1, 2310, 1155, 385, 385
Offset: 1

Views

Author

Arkadiusz Wesolowski, Nov 27 2011

Keywords

Comments

Row sums give A201156.
Central terms give A068111: T(2*n-1,n) = A068111(n).
T(n,1) = A034386(n).
T(n,n-1) = A089026(n) for n > 1.
T(n,n) = A000012(n).
Let n > 1 and p = A000040(n). Then T(p,p-1) = T(p+1,p-1) = p.
T(2*n-1,n-1) = A073838(n) for n > 1.
T(2*n,n+1) = A144186(n).

Examples

			1:                                   1
2:                               2       1
3:                           6       3       1
4:                       6       3       1       1
5:                   30      15      5       5       1
6:               30      15      5       5       1       1
7:           210     105     35      35      7       7       1
8:       210     105     35      35      7       7       1       1
9:   210     105     35      35      7       7       1       1       1
		

Crossrefs

Cf. A034386.

Programs

  • Mathematica
    lst = {}; Do[AppendTo[lst, Product[Prime[i], {i, PrimePi[n]}]/Product[Prime[i], {i, PrimePi[k]}]], {n, 12}, {k, n}]; lst (* Arkadiusz Wesolowski, Dec 02 2011 *)

A300902 a(n) = n! / Product_{p prime < n}.

Original entry on oeis.org

1, 1, 2, 3, 4, 20, 24, 168, 192, 1728, 17280, 190080, 207360, 2695680, 2903040, 43545600, 696729600, 11844403200, 12541132800, 238281523200, 250822656000, 5267275776000, 115880067072000, 2665241542656000, 2781121609728000, 69528040243200000, 1807729046323200000
Offset: 0

Views

Author

Pedro Caceres, Mar 14 2018

Keywords

Comments

Sum_{n >= 0} 1/a(n) = 3.1868081118360746...

Examples

			a(6) = 6! / Product_{p prime < 6} = 6 * 5 * 4 * 3 * 2/(5 * 3 * 2) = 6 * 4 = 24.
		

Crossrefs

Programs

  • Julia
    using Nemo
    A300902(n) = div(fac(n), primorial(max(1, n-1)))
    [A300902(n) for n in 0:26] |> println # Peter Luschny, Mar 16 2018
    
  • Maple
    a:= n-> n!/mul(`if`(isprime(i), i, 1), i=1..n-1):
    seq(a(n), n=0..30);  # Alois P. Heinz, Mar 16 2018
  • Mathematica
    Table[n!/(Times@@Prime[Range[PrimePi[n - 1]]]), {n, 0, 29}] (* Alonso del Arte, Mar 25 2018 *)
  • PARI
    a(n) = my(v=primes(primepi(n-1))); n!/prod(k=1, #v, v[k]); \\ Michel Marcus, Mar 15 2018
    
  • Python
    from _future_ import division
    from sympy import isprime
    A300902_list, m = [1], 1
    for n in range(1,501):
        m *= n
        A300902_list.append(m)
        if isprime(n):
            m //= n # Chai Wah Wu, Mar 16 2018

Formula

a(n) = A000142(n)/A034386(n-1) for n>0, a(0) = 1.
a(n) = A049614(n)*A089026(n) for n>0, a(0) = 1.

A309391 a(n) = gcd(n, A064169(n-2)) for n > 2.

Original entry on oeis.org

3, 1, 5, 1, 7, 1, 1, 1, 11, 1, 13, 1, 1, 1, 17, 1, 19, 1, 1, 1, 23, 1, 5, 1, 1, 1, 29, 1, 31, 1, 1, 1, 1, 1, 37, 1, 1, 1, 41, 1, 43, 1, 1, 1, 47, 1, 7, 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, 11, 89, 1
Offset: 3

Views

Author

Amiram Eldar and Thomas Ordowski, Jul 28 2019

Keywords

Comments

Probably, there are no composite terms in this sequence.
For n > 2, a(n) = gcd(n, A001008(n-1)).
By Wolstenholme's theorem, if p is an odd prime, then a(p) = p.
Conjecture: for n > 2, if a(n) = n, then n is a prime.
If so, then there are no pseudoprimes n such that a(n) = n.
Composite numbers m <> p^2 for which a(m) > 1 are 88, 1290, 9339, ...

Examples

			a(25) = gcd(25, A064169(25-2)) = gcd(25, 325333835) = 5,
a(25) = gcd(25, A001008(25-1)) = gcd(25, 1347822955) = 5.
It should be noted that a(88) = 11, a(1290) = 43, a(9339) = 11, ...
		

Crossrefs

Cf. A001008, A002805, A007406 (see our comment), A064169, A065091, A089026, A309397.

Programs

  • Magma
    [Gcd(k, Numerator(a)-Denominator(a)) where a is HarmonicNumber(k-2):k in [3..90]]; // Marius A. Burtea, Jul 29 2019
  • Maple
    H:= 0:
    for n from 3 to 100 do
      H:= H + 1/(n-2);
      A[n]:= igcd(n, numer(H)-denom(H));
    od:
    seq(A[i],i=3..100); # Robert Israel, Aug 04 2019
  • Mathematica
    a[n_] := GCD[n, Numerator[(h = HarmonicNumber[n-2])] - Denominator[h]]; Array[a, 81, 3]

Formula

a(p) = p for every odd prime p.
a(p^2) = p iff p > 3 is a prime.
Note that a(n) >= A089026(n) for n > 2.

A166333 The largest prime that divides A027642(n) (the denominator of the Bernoulli number B_n), or 1 if A027642(n) is 1.

Original entry on oeis.org

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

Views

Author

Paul Curtz, Oct 12 2009

Keywords

Comments

The largest member of the extended prime list A008578 which divides the denominator of Bernoulli(n).
Essentially A073409 padded with 1's.

Crossrefs

Programs

Formula

a(n) = A006530(A027642(n)). - Antti Karttunen, Dec 19 2018

Extensions

Edited and extended by R. J. Mathar, Oct 21 2009
Name and comment swapped by Antti Karttunen, Dec 19 2018

A174530 Numerators of the second row of the Akiyama-Tanigawa table for the sequence 1/n!.

Original entry on oeis.org

-1, 0, 3, 4, 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
Offset: 0

Views

Author

Paul Curtz, Mar 21 2010

Keywords

Comments

Filling the top row of a table with T(0,k) = 1/k!, k>=0, the Akiyama-Tanigawa algorithm constructs the following table T(n,k) of fractions, n>=0, k>=0:
1, 1, 1/2, 1/6, 1/24, 1/120, 1/720, 1/5040, 1/40320, 1/362880,...
0, 1, 1, 1/2, 1/6, 1/24, 1/120, 1/720, 1/5040, 1/40320, 1/362880, ...
-1, 0, 3/2, 4/3, 5/8, 1/5, 7/144, 1/105, 1/640, 1/4536, 11/403200, ...
-1, -3, 1/2, 17/6, 17/8, 109/120, 197/720, 107/1680, 487/40320, ..
2, -7, -7, 17/6, 73/12, 457/120, 529/360, 2081/5040, 263/2880,...
9, 0, -59/2, -13, 91/8, 421/30, 355/48, 2161/840, 3871/5760, 709/5040, ..
9, 59, -99/2, -195/2, -319/24, 1593/40, 2701/80, 76631/5040, 4285/896,...
The numerators of T(2,k) are the current sequence.
The denominators are 1, 1, 2, 3, 8, 5, 144, 105, 640, 4536, 403200, 332640, 43545600, 37065600,...
T(0,k) = T(1,k+1), shifted.
The left column is T(n,0) = (-1)^(n+1)*A014182(n).
The column T(n,1) appears to be (-1)^n*A074051(n). - R. J. Mathar, Jan 16 2011
a(n) = numerator(A005563(n-1)/(n-1)!), for n>0. - Fred Daniel Kline, Mar 20 2016

Crossrefs

Programs

  • Mathematica
    nn = 78; Numerator[Simplify[CoefficientList[Series[-Zeta[x] + (Derivative[1][Zeta][x] + x*Derivative[2][Zeta][x])*x, {x, 0, nn}], x]/Table[Derivative[n][Zeta][0], {n, 0, nn}]]] (* Mats Granvik, Nov 11 2013 *)

A300951 a(n) = Product_{j=1..floor(n/2)} p(j) where p(j) = j if j is prime else 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 6, 6, 6, 6, 30, 30, 30, 30, 210, 210, 210, 210, 210, 210, 210, 210, 2310, 2310, 2310, 2310, 30030, 30030, 30030, 30030, 30030, 30030, 30030, 30030, 510510, 510510, 510510, 510510, 9699690, 9699690, 9699690, 9699690, 9699690, 9699690, 9699690
Offset: 0

Views

Author

Peter Luschny, Mar 16 2018

Keywords

Comments

a(4*n+2)=a(4*n+3)=a(4*n+4)=a(4*n+5) for n >= 1. - Robert Israel, Mar 16 2018
The length of the n-th run is given by 2*A054541(n). - Michel Marcus, Mar 17 2018

Crossrefs

Programs

  • Maple
    a := n -> mul(`if`(isprime(j), j, 1), j=1..iquo(n,2)):
    seq(a(n), n=0..44);
    # Alternative:
    f:= proc(n) option remember;
      if n::even and isprime(n/2) then procname(n-1)*n/2 else procname(n-1) fi
    end proc:
    f(0):= 1:
    map(f, [$0..100]); # Robert Israel, Mar 16 2018
  • Mathematica
    {#,#}&/@FoldList[Times,Table[If[PrimeQ[n],n,1],{n,0,30}]]//Flatten (* Harvey P. Dale, Dec 25 2019 *)
  • PARI
    a(n) = prod(i=1, n\2, if(isprime(i), i, 1)); \\ Altug Alkan, Mar 16 2018

Formula

a(n) = A002110(A056172(n)). - Robert Israel, Mar 16 2018

A349214 a(n) = Sum_{k=1..n} k^c(k), where c is the prime characteristic (A010051).

Original entry on oeis.org

1, 3, 6, 7, 12, 13, 20, 21, 22, 23, 34, 35, 48, 49, 50, 51, 68, 69, 88, 89, 90, 91, 114, 115, 116, 117, 118, 119, 148, 149, 180, 181, 182, 183, 184, 185, 222, 223, 224, 225, 266, 267, 310, 311, 312, 313, 360, 361, 362, 363, 364, 365, 418, 419, 420, 421, 422, 423, 482, 483, 544
Offset: 1

Views

Author

Wesley Ivan Hurt, Nov 10 2021

Keywords

Comments

For k in 1 <= k <= n, add k if k is prime, otherwise add 1. For example a(6) = 1 + 2 + 3 + 1 + 5 + 1 = 13.

Crossrefs

Partial sums of A089026.

Programs

  • Mathematica
    a[n_] := Sum[k^Boole[PrimeQ[k]], {k, 1, n}]; Array[a, 60] (* Amiram Eldar, Nov 11 2021 *)
  • PARI
    a(n) = sum(k=1, n, if (isprime(k), k, 1)); \\ Michel Marcus, Nov 11 2021
    
  • Python
    from sympy import primerange
    def A349214(n):
        p = list(primerange(2,n+1))
        return n-len(p)+sum(p) # Chai Wah Wu, Nov 11 2021

Formula

a(n) = A034387(n) + A062298(n). - Wesley Ivan Hurt, Nov 23 2021
Previous Showing 11-20 of 25 results. Next