|
|
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).
|
|
147
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
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, July 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), lcm(b,c) = A007947(n) = "squarefree kernel" of n and bc = A019554(n) = "outer square root" of n. [The relation with LCM is wrong if b is not squarefree. One must, e.g., replace b with A007947(b). - M. F. Hasler, Mar 03 2018]
|
|
LINKS
|
Andrew Reiter, On (mod n) spirals (2014), and posting to Number Theory Mailing List, Mar 23 2014.
|
|
FORMULA
|
a(n) = Sum_{d^2|n} phi(d), where phi is the Euler totient function A000010.
Dirichlet series: Sum_{n >= 1} a(n)/n^s = zeta(2*s - 1)*zeta(s)/zeta(2*s), (Re(s) > 1).
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
G.f.: Sum_{k>=1} phi(k) * x^(k^2) / (1 - x^(k^2)). - Ilya Gutkovskiy, Aug 20 2021
|
|
EXAMPLE
|
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.
|
|
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 *)
|
|
PROG
|
(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
(Haskell)
a000188 n = product $ zipWith (^)
(a027748_row n) $ map (`div` 2) (a124010_row n)
(Python)
from sympy.ntheory.factor_ import core
from sympy import integer_nthroot
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,nice,mult
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|