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.

A166123 If n is prime, a(n) = 1; otherwise, a(n) is gcd(n, d) where d is the denominator of the (n-1)-th Bernoulli number.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 15, 1, 1, 1, 7, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 5, 1, 3, 1, 1, 1, 7, 1, 3, 1, 1, 1, 1, 1, 3, 1
Offset: 1

Views

Author

Paul Curtz, Oct 07 2009

Keywords

Crossrefs

Programs

  • Mathematica
    Table[If[PrimeQ[n],1,GCD[n,Denominator[BernoulliB[n-1]]]],{n,100}] (* Harvey P. Dale, Sep 07 2017 *)
  • PARI
    a(n)=if(isprime(n),1,gcd(denominator(bernfrac(n-1)),n)) \\ Charles R Greathouse IV, Jun 20 2011
    
  • PARI
    a(n)=my(b=bernfrac(n-1));denominator(b)/denominator(b*n)/if(isprime(n),n,1) \\ Charles R Greathouse IV, Jun 20 2011
    
  • PARI
    a(n)=if(isprime(n),1,my(b=bernfrac(n-1));denominator(b)/denominator(b*n)) \\ Charles R Greathouse IV, Jun 20 2011

Formula

a(n) = A166120(n)/ A050932(n-1).