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.

A000188 (1) Number of solutions to x^2 == 0 (mod n). (2) Also square root of largest square dividing n. (3) Also max_{ d divides n } gcd(d, n/d).

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 4, 1, 3, 1, 2, 1, 1, 1, 2, 5, 1, 3, 2, 1, 1, 1, 4, 1, 1, 1, 6, 1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 4, 7, 5, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 3, 8, 1, 1, 1, 2, 1, 1, 1, 6, 1, 1, 5, 2, 1, 1, 1, 4, 9, 1, 1, 2, 1, 1, 1, 2, 1, 3
Offset: 1

Views

Author

Keywords

Comments

Shadow transform of the squares A000290. - Vladeta Jovovic, Aug 02 2002
Labos Elemer and Henry Bottomley independently proved that (2) and (3) define the same sequence. Bottomley also showed that (1) and (2) define the same sequence.
Proof that (2) = (3): Let max{gcd(d, n/d)} = K, then d = Kx, n/d = Ky so n = KKxy where xy is the squarefree part of n, otherwise K is not maximal. Observe also that g = gcd(K, xy) is not necessarily 1. Thus K is also the "maximal square-root factor" of n. - Labos Elemer, Jul 2000
We can write sqrt(n) = b*sqrt(c) where c is squarefree. Then b = A000188(n) is the "inner square root" of n, c = A007913(n) and b*c = A019554(n) = "outer square root" of n.

Examples

			a(8) = 2 because the largest square dividing 8 is 4, the square root of which is 2.
a(9) = 3 because 9 is a perfect square and its square root is 3.
a(10) = 1 because 10 is squarefree.
		

Crossrefs

Cf. A019554 (outer square root), A053150 (inner 3rd root), A019555 (outer 3rd root), A053164 (inner 4th root), A053166 (outer 4th root), A015052 (outer 5th root), A015053 (outer 6th root).
Cf. A240976 (Dgf at s=2).

Programs

  • Haskell
    a000188 n = product $ zipWith (^)
                          (a027748_row n) $ map (`div` 2) (a124010_row n)
    -- Reinhard Zumkeller, Apr 22 2012
    
  • Maple
    with(numtheory):A000188 := proc(n) local i: RETURN(op(mul(i,i=map(x->x[1]^floor(x[2]/2),ifactors(n)[2])))); end;
  • Mathematica
    Array[Function[n, Count[Array[PowerMod[#, 2, n ] &, n, 0 ], 0 ] ], 100]
    (* Second program: *)
    nMax = 90; sList = Range[Floor[Sqrt[nMax]]]^2; Sqrt[#] &/@ Table[ Last[ Select[ sList, Divisible[n, #] &]], {n, nMax}] (* Harvey P. Dale, May 11 2011 *)
    a[n_] := With[{d = Divisors[n]}, Max[GCD[d, Reverse[d]]]] (* Mamuka Jibladze, Feb 15 2015 *)
    f[p_, e_] := p^Floor[e/2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 18 2020 *)
  • PARI
    a(n)=if(n<1,0,sum(i=1,n,i*i%n==0))
    
  • PARI
    a(n)=sqrtint(n/core(n)) \\ Zak Seidov, Apr 07 2009
    
  • PARI
    a(n)=core(n, 1)[2] \\ Michel Marcus, Feb 27 2013
    
  • Python
    from sympy.ntheory.factor_ import core
    from sympy import integer_nthroot
    def A000188(n): return integer_nthroot(n//core(n),2)[0] # Chai Wah Wu, Jun 14 2021

Formula

a(n) = n/A019554(n) = sqrt(A008833(n)).
a(n) = Sum_{d^2|n} phi(d), where phi is the Euler totient function A000010.
Multiplicative with a(p^e) = p^floor(e/2). - David W. Wilson, Aug 01 2001
Dirichlet series: Sum_{n >= 1} a(n)/n^s = zeta(2*s - 1)*zeta(s)/zeta(2*s), (Re(s) > 1).
Dirichlet convolution of A037213 and A008966. - R. J. Mathar, Feb 27 2011
Finch & Sebah show that the average order of a(n) is 3 log n/Pi^2. - Charles R Greathouse IV, Jan 03 2013
a(n) = sqrt(n/A007913(n)). - M. F. Hasler, May 08 2014
Sum_{n>=1} lambda(n)*a(n)*x^n/(1-x^n) = Sum_{n>=1} n*x^(n^2), where lambda() is the Liouville function A008836 (cf. A205801). - Mamuka Jibladze, Feb 15 2015
a(2*n) = a(n)*(A096268(n-1) + 1). - observed by Velin Yanev, Jul 14 2017, The formula says that a(2n) = 2*a(n) only when 2-adic valuation of n (A007814(n)) is odd, otherwise a(2n) = a(n). This follows easily from the definition (2). - Antti Karttunen, Nov 28 2017
Sum_{k=1..n} a(k) ~ 3*n*((log(n) + 3*gamma - 1)/Pi^2 - 12*zeta'(2)/Pi^4), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Dec 01 2020
Conjecture: a(n) = Sum_{k=1..n} A010052(n*k). - Velin Yanev, Jul 04 2021
G.f.: Sum_{k>=1} phi(k) * x^(k^2) / (1 - x^(k^2)). - Ilya Gutkovskiy, Aug 20 2021

Extensions

Edited by M. F. Hasler, May 08 2014