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.

A170826 a(n) = gcd(n^2, n!).

Original entry on oeis.org

1, 2, 3, 8, 5, 36, 7, 64, 81, 100, 11, 144, 13, 196, 225, 256, 17, 324, 19, 400, 441, 484, 23, 576, 625, 676, 729, 784, 29, 900, 31, 1024, 1089, 1156, 1225, 1296, 37, 1444, 1521, 1600, 41, 1764, 43, 1936, 2025, 2116, 47, 2304, 2401, 2500, 2601, 2704, 53, 2916
Offset: 1

Views

Author

N. J. A. Sloane, Dec 27 2009

Keywords

Crossrefs

Programs

  • Maple
    GCDWITHFACTORIAL:=proc(a) local b,i,k:
    if whattype(a) <> list then RETURN([]); fi:
    b:=[]:
    for i to nops(a) do b:=[op(b), gcd(a[i],i!)]: od;
    RETURN(b);
    end:
    A170826 := proc(n): gcd(n^2, n!) end: seq(A170826(n), n=1..54); # Johannes W. Meijer, Jun 04 2016
  • Mathematica
    Table[GCD[n^2, n!], {n, 54}] (* Michael De Vlieger, Jun 05 2016 *)
  • PARI
    a(n)=if(isprime(n),n,if(n==4,8,n^2)) \\ Charles R Greathouse IV, Feb 01 2013

Formula

If n is prime then a(n) = n; otherwise, if n <> 4 then a(n) = n^2. - Zak Seidov, Dec 28 2009
a(n) = n!/A092043(n). - Johannes W. Meijer, Jun 04 2016
a(n) = n^2 / n^c(n), where c = A010051 for n >= 5. - Wesley Ivan Hurt, Nov 10 2023