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.

Showing 1-10 of 141 results. Next

A092520 Number of square divisors of n-th cube: a(n) = A046951(n^3).

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 5, 4, 4, 2, 8, 2, 4, 4, 7, 2, 8, 2, 8, 4, 4, 2, 10, 4, 4, 5, 8, 2, 8, 2, 8, 4, 4, 4, 16, 2, 4, 4, 10, 2, 8, 2, 8, 8, 4, 2, 14, 4, 8, 4, 8, 2, 10, 4, 10, 4, 4, 2, 16, 2, 4, 8, 10, 4, 8, 2, 8, 4, 8, 2, 20, 2, 4, 8, 8, 4, 8, 2, 14, 7, 4, 2, 16, 4, 4, 4, 10, 2, 16, 4, 8, 4, 4, 4, 16
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 06 2004

Keywords

Comments

Apparently the inverse Mobius transform of A056624 (and therefore multiplicative). - R. J. Mathar, Feb 07 2011

Examples

			For n=12, the divisors of 12^3 = 1728 are 1 = 1^2, 2, 3, 4 = 2^2, 6, 8, 9 = 3^2, 12, 16 = 4^2, 18, 24, 27, 32, 36 = 6^2, 48, 54, 64 = 8^2, 72, 96, 108, 144 = 12^2, 192, 216, 288, 432, 576 = 24^2, 864 and 1728: eight of them are squares, therefore a(12) = 8.
		

Crossrefs

Programs

Formula

a(n) = A000005(n) iff n is squarefree.
From Werner Schulte, Feb 19 2018: (Start)
Multiplicative with a(p^e) = floor((3*e+2)/2) = A001651(e+1), p prime and e >= 0.
Dirichlet g.f.: Sum_{n>0} a(n)/n^s = (zeta(s))^2 * zeta(2*s) / zeta(3*s). (End)
Sum_{k=1..n} a(k) ~ Pi^2 * n/(6*zeta(3)) * (log(n) - 1 + 2*gamma + 12*zeta'(2)/Pi^2 - 3*zeta'(3)/zeta(3)) + zeta(1/2)^2 * sqrt(n) / zeta(3/2), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Feb 08 2019

A338628 a(n) is the smallest number k such that n consecutive integers starting at k have the same number of square divisors (A046951).

Original entry on oeis.org

1, 1, 1, 844, 3624, 22020, 671346, 8870024, 264459172, 463239475, 1407472722, 108494875170, 12385053656370, 145065154350545
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 04 2020

Keywords

Examples

			844 has 2 square divisors {1, 4}, 845 has 2 square divisors {1, 169}, 846 has 2 square divisors {1, 9} and 847 has 2 square divisors {1, 121}. These are the first 4 consecutive numbers with the same number of square divisors, so a(4) = 844.
		

Crossrefs

Programs

  • Mathematica
    Do[find = 0; k = 0; While[find == 0, k++; If[Length[Union[Table[Length[Select[Divisors[j], IntegerQ[Sqrt[#]] &]], {j, k, k + n - 1}]]] == 1, find = 1; Print[k]]], {n, 1, 7}]
  • PARI
    isok(n, k) = #Set(apply(x->sumdiv(x, d, issquare(d)), vector(n, i, k+i-1))) == 1;
    a(n) = my(k=1); while(! isok(n, k), k++); k; \\ Michel Marcus, Nov 05 2020

Extensions

a(8)-a(11) from Amiram Eldar, Nov 04 2020
a(12)-a(14) from Martin Ehrenstein, Jul 19 2023

A010052 Characteristic function of squares: a(n) = 1 if n is a square, otherwise 0.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Keywords

Comments

Also parity of the divisor function A000005 if n >= 1. - Omar E. Pol, Jan 14 2012
This sequence can be considered as k=1 analog of A025426 (k=2), A025427 (k=3), A025428 (k=4); see also A000161. - M. F. Hasler, Jan 25 2013
Also, the decimal expansion of Sum_{n >= 0} 1/(10^n)^n. - Eric Desbiaux, Mar 15 2009, rephrased and simplified by M. F. Hasler, Jan 26 2013
Run lengths of zeros gives A005843, the nonnegative even numbers. - Jeremy Gardiner, Jan 14 2018
Inverse Möbius transform of Liouville's lambda function (A008836), n >= 1. - Wesley Ivan Hurt, Jun 22 2024

Examples

			G.f. = 1 + x + x^4 + x^9 + x^16 + x^25 + x^36 + x^49 + x^64 + x^81 + ...
		

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, pp. 3-4, also p. 166, Ex. 5.5.1.
  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, Problem 20.
  • Richard Bellman, A Brief Introduction to Theta Functions, Dover, 2013 (11.14).
  • Michael D. Hirschhorn, The Power of q, Springer, 2017. See phi(q) page 8.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 55.

Crossrefs

Column k=1 of A243148, A337165, A341040 (for n>0).
Cf. A000005, A000122, A005369, A007913, A008836 (Mobius transf.), A037011, A063524, A258998, A271102 (Dirichlet inv), A046951 (inv. Mobius trans.).
First differences of A000196.

Programs

  • Haskell
    a010052 n = fromEnum $ a000196 n ^ 2 == n
    -- Reinhard Zumkeller, Jan 26 2012, Feb 20 2011
    a010052_list = concat (iterate (\xs -> xs ++ [0,0]) [1])
    -- Reinhard Zumkeller, Apr 27 2012
    
  • Maple
    readlib(issqr): f := i->if issqr(i) then 1 else 0; fi; [ seq(f(i),i=0..100) ];
  • Mathematica
    lst = {}; Do[AppendTo[lst, 2*Sum[Floor[n/k] - Floor[(n - 1)/k], {k, Floor[Sqrt[n]]}] - DivisorSigma[0, n]], {n, 93}]; Prepend[lst, 1] (* Eric Desbiaux, Jan 29 2012 *)
    Table[If[IntegerQ[Sqrt[n]],1,0],{n,0,100}] (* Harvey P. Dale, Jul 19 2014 *)
    a[n_] := SeriesCoefficient[1/(1 - q)* QHypergeometricPFQ[{-q, -q}, {-(q^2)}, -q, -q], {q, 0, Abs@n}] (* Mats Granvik, Jan 01 2016 *)
    Range[0, 120] /. {n_ /; IntegerQ@ Sqrt@ n -> 1, n_ /; n != 1 -> 0} (* Michael De Vlieger, Jan 02 2016 *)
    a[n_] := Sum[If[Mod[n, k] == 0, Re[Sqrt[LiouvilleLambda[k]]*Sqrt[LiouvilleLambda[n/k]]], 0], {k, 1, n}] (* Mats Granvik, Aug 10 2018 *)
  • PARI
    {a(n) = issquare(n)};
    
  • PARI
    a(n)=if(n<1,1,sumdiv(n,d,(-1)^bigomega(d))) \\ Benoit Cloitre, Oct 25 2009
    
  • PARI
    a(n) = if (n<1, 1, direuler( p=2, n, 1/ (1 - X^2 ))[n]); \\ Michel Marcus, Mar 08 2015
    
  • Python
    def A010052(n): return int(math.isqrt(n)**2==n) ##  appears to be faster than sympy.ntheory.primetest.is_square, up to 10^8 at least.
    # M. F. Hasler, Mar 21 2022
  • Scheme
    (define (A010052 n) (if (zero? n) 1 (- (A000196 n) (A000196 (- n 1))))) ;; (For the definition of A000196, see under that entry). - Antti Karttunen, Nov 03 2017
    

Formula

a(n) = floor(sqrt(n)) - floor(sqrt(n-1)), for n > 0.
a(n) = A000005(n) mod 2, n > 0. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 19 2001
G.f. A(x) satisfies: 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u-w)^2 - (v-w)*(v+w-1) - Michael Somos, Jul 19 2004
Dirichlet g.f.: zeta(2s). - Franklin T. Adams-Watters, Sep 11 2005
G.f.: (theta_3(0,x) + 1)/2, where theta_3 is a Jacobi theta function. - Franklin T. Adams-Watters, Jun 19 2006 [See A000122 for theta_3.]
a(n) = f(n,0) with f(x,y) = f(x-2*y-1,y+1) if x > 0, otherwise 0^(-x). - Reinhard Zumkeller, Sep 26 2008
a(n) = Sum_{d|n} (-1)^bigomega(d), for n >= 1. - Benoit Cloitre, Oct 25 2009
a(n) <= A093709(n). - Reinhard Zumkeller, Nov 14 2009
a(A000290(n)) = 1; a(A000037(n)) = 0. - Reinhard Zumkeller, Jun 20 2011
a(n) = 0 ^ A053186(n). - Reinhard Zumkeller, Feb 12 2012
a(n) = A063524(A007913(n)), for n > 0. - Reinhard Zumkeller, Jul 09 2014
a(n) = -(-1)^n * A258998(n) unless n = 0. 2 * a(n) = A000122(n) unless n = 0. - Michael Somos, Jun 16 2015
a(n) = A037011(A156552(n)), provided that A037011(n) = A000035(A106737(n)). [See A037011.] - Antti Karttunen, Nov 03 2017
a(n*m) = a(n/gcd(n,m))*a(m/gcd(n,m)) for all n and m > 0 (conjectured). - Velin Yanev, Feb 13 2019 [Proof from Michael B. Porter, Feb 16 2019: If nm is a square, nm = product_i (p_i^2), where p_i are prime, not necessarily distinct. Each p_i either appears twice in n, twice in m, or one time in each and therefore in the gcd. So n/gcd(n,m) and m/gcd(n,m) are both squares. If nm is not a square, there is a q_j that appears in one of n or m but not in the gcd. So either n/gcd(n,m) or m/gcd(n,m) is not a square.]
a(n) = Sum_{d|n} A008836(d), n >= 1, a(0) = 1. - Jinyuan Wang, Apr 20 2019
G.f.: A(q) = Sum_{n >= 0} q^(2*n)*Product_{k >= 2*n+1} 1 - (-q)^k. - Peter Bala, Feb 22 2021
Multiplicative with a(p^e) = 1 if e is even, and 0 otherwise. - Amiram Eldar, Dec 29 2022
a(n) = Sum_{d|n} mobius(core(n)), where core(n) = A007913(n). - Peter Bala, Jan 24 2024

Extensions

More terms from Franklin T. Adams-Watters, Jun 19 2006

A156552 Unary-encoded compressed factorization of natural numbers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 17, 10, 15, 64, 13, 128, 19, 18, 33, 256, 23, 12, 65, 14, 35, 512, 21, 1024, 31, 34, 129, 20, 27, 2048, 257, 66, 39, 4096, 37, 8192, 67, 22, 513, 16384, 47, 24, 25, 130, 131, 32768, 29, 36, 71, 258, 1025, 65536, 43, 131072, 2049, 38, 63, 68, 69, 262144
Offset: 1

Views

Author

Leonid Broukhis, Feb 09 2009

Keywords

Comments

The primes become the powers of 2 (2 -> 1, 3 -> 2, 5 -> 4, 7 -> 8); the composite numbers are formed by taking the values for the factors in the increasing order, multiplying them by the consecutive powers of 2, and summing. See the Example section.
From Antti Karttunen, Jun 27 2014: (Start)
The odd bisection (containing even terms) halved gives A244153.
The even bisection (containing odd terms), when one is subtracted from each and halved, gives this sequence back.
(End)
Question: Are there any other solutions that would satisfy the recurrence r(1) = 0; and for n > 1, r(n) = Sum_{d|n, d>1} 2^A033265(r(d)), apart from simple variants 2^k * A156552(n)? See also A297112, A297113. - Antti Karttunen, Dec 30 2017

Examples

			For 84 = 2*2*3*7 -> 1*1 + 1*2 + 2*4 + 8*8 =  75.
For 105 = 3*5*7 -> 2*1 + 4*2 + 8*4 = 42.
For 137 = p_33 -> 2^32 = 4294967296.
For 420 = 2*2*3*5*7 -> 1*1 + 1*2 + 2*4 + 4*8 + 8*16 = 171.
For 147 = 3*7*7 = p_2 * p_4 * p_4 -> 2*1 + 8*2 + 8*4 = 50.
		

Crossrefs

One less than A005941.
Inverse permutation: A005940 with starting offset 0 instead of 1.
Cf. also A297106, A297112 (Möbius transform), A297113, A153013, A290308, A300827, A323243, A323244, A323247, A324201, A324812 (n for which a(n) is a square), A324813, A324822, A324823, A324398, A324713, A324815, A324819, A324865, A324866, A324867.

Programs

  • Mathematica
    Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[ Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ n]], {n, 67}] (* Michael De Vlieger, Sep 08 2016 *)
  • PARI
    a(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ David A. Corneth, Mar 08 2019
    
  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n)))); \\ (based on the given recurrence) - Antti Karttunen, Mar 08 2019
    
  • Perl
    # Program corrected per instructions from Leonid Broukhis. - Antti Karttunen, Jun 26 2014
    # However, it gives correct answers only up to n=136, before corruption by a wrap-around effect.
    # Note that the correct answer for n=137 is A156552(137) = 4294967296.
    $max = $ARGV[0];
    $pow = 0;
    foreach $i (2..$max) {
    @a = split(/ /, `factor $i`);
    shift @a;
    $shift = 0;
    $cur = 0;
    while ($n = int shift @a) {
    $prime{$n} = 1 << $pow++ if !defined($prime{$n});
    $cur |= $prime{$n} << $shift++;
    }
    print "$cur, ";
    }
    print "\n";
    (Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library, two different implementations)
    (definec (A156552 n) (cond ((= n 1) 0) (else (+ (A000079 (+ -2 (A001222 n) (A061395 n))) (A156552 (A052126 n))))))
    (definec (A156552 n) (cond ((= 1 n) (- n 1)) ((even? n) (+ 1 (* 2 (A156552 (/ n 2))))) (else (* 2 (A156552 (A064989 n))))))
    ;; Antti Karttunen, Jun 26 2014
    
  • Python
    from sympy import primepi, factorint
    def A156552(n): return sum((1<Chai Wah Wu, Mar 10 2023

Formula

From Antti Karttunen, Jun 26 2014: (Start)
a(1) = 0, a(n) = A000079(A001222(n)+A061395(n)-2) + a(A052126(n)).
a(1) = 0, a(2n) = 1+2*a(n), a(2n+1) = 2*a(A064989(2n+1)). [Compare to the entanglement recurrence A243071].
For n >= 0, a(2n+1) = 2*A244153(n+1). [Follows from the latter clause of the above formula.]
a(n) = A005941(n) - 1.
As a composition of related permutations:
a(n) = A003188(A243354(n)).
a(n) = A054429(A243071(n)).
For all n >= 1, A005940(1+a(n)) = n and for all n >= 0, a(A005940(n+1)) = n. [The offset-0 version of A005940 works as an inverse for this permutation.]
This permutations also maps between the partition-lists A112798 and A125106:
A056239(n) = A161511(a(n)). [The sums of parts of each partition (the total sizes).]
A003963(n) = A243499(a(n)). [And also the products of those parts.]
(End)
From Antti Karttunen, Oct 09 2016: (Start)
A161511(a(n)) = A056239(n).
A029837(1+a(n)) = A252464(n). [Binary width of terms.]
A080791(a(n)) = A252735(n). [Number of nonleading 0-bits.]
A000120(a(n)) = A001222(n). [Binary weight.]
For all n >= 2, A001511(a(n)) = A055396(n).
For all n >= 2, A000120(a(n))-1 = A252736(n). [Binary weight minus one.]
A252750(a(n)) = A252748(n).
a(A250246(n)) = A252754(n).
a(A005117(n)) = A277010(n). [Maps squarefree numbers to a permutation of A003714, fibbinary numbers.]
A085357(a(n)) = A008966(n). [Ditto for their characteristic functions.]
For all n >= 0:
a(A276076(n)) = A277012(n).
a(A276086(n)) = A277022(n).
a(A260443(n)) = A277020(n).
(End)
From Antti Karttunen, Dec 30 2017: (Start)
For n > 1, a(n) = Sum_{d|n, d>1} 2^A033265(a(d)). [See comments.]
More linking formulas:
A106737(a(n)) = A000005(n).
A290077(a(n)) = A000010(n).
A069010(a(n)) = A001221(n).
A136277(a(n)) = A181591(n).
A132971(a(n)) = A008683(n).
A106400(a(n)) = A008836(n).
A268411(a(n)) = A092248(n).
A037011(a(n)) = A010052(n) [conjectured, depends on the exact definition of A037011].
A278161(a(n)) = A046951(n).
A001316(a(n)) = A061142(n).
A277561(a(n)) = A034444(n).
A286575(a(n)) = A037445(n).
A246029(a(n)) = A181819(n).
A278159(a(n)) = A124859(n).
A246660(a(n)) = A112624(n).
A246596(a(n)) = A069739(n).
A295896(a(n)) = A053866(n).
A295875(a(n)) = A295297(n).
A284569(a(n)) = A072411(n).
A286574(a(n)) = A064547(n).
A048735(a(n)) = A292380(n).
A292272(a(n)) = A292382(n).
A244154(a(n)) = A048673(n), a(A064216(n)) = A244153(n).
A279344(a(n)) = A279339(n), a(A279338(n)) = A279343(n).
a(A277324(n)) = A277189(n).
A037800(a(n)) = A297155(n).
For n > 1, A033265(a(n)) = 1+A297113(n).
(End)
From Antti Karttunen, Mar 08 2019: (Start)
a(n) = A048675(n) + A323905(n).
a(A324201(n)) = A000396(n), provided there are no odd perfect numbers.
The following sequences are derived from or related to the base-2 expansion of a(n):
A000265(a(n)) = A322993(n).
A002487(a(n)) = A323902(n).
A005187(a(n)) = A323247(n).
A324288(a(n)) = A324116(n).
A323505(a(n)) = A323508(n).
A079559(a(n)) = A323512(n).
A085405(a(n)) = A323239(n).
The following sequences are obtained by applying to a(n) a function that depends on the prime factorization of its argument, which goes "against the grain" because a(n) is the binary code of the factorization of n, which in these cases is then factored again:
A000203(a(n)) = A323243(n).
A033879(a(n)) = A323244(n) = 2*a(n) - A323243(n),
A294898(a(n)) = A323248(n).
A000005(a(n)) = A324105(n).
A000010(a(n)) = A324104(n).
A083254(a(n)) = A324103(n).
A001227(a(n)) = A324117(n).
A000593(a(n)) = A324118(n).
A001221(a(n)) = A324119(n).
A009194(a(n)) = A324396(n).
A318458(a(n)) = A324398(n).
A192895(a(n)) = A324100(n).
A106315(a(n)) = A324051(n).
A010052(a(n)) = A324822(n).
A053866(a(n)) = A324823(n).
A001065(a(n)) = A324865(n) = A323243(n) - a(n),
A318456(a(n)) = A324866(n) = A324865(n) OR a(n),
A318457(a(n)) = A324867(n) = A324865(n) XOR a(n),
A318458(a(n)) = A324398(n) = A324865(n) AND a(n),
A318466(a(n)) = A324819(n) = A323243(n) OR 2*a(n),
A318467(a(n)) = A324713(n) = A323243(n) XOR 2*a(n),
A318468(a(n)) = A324815(n) = A323243(n) AND 2*a(n).
(End)

Extensions

More terms from Antti Karttunen, Jun 28 2014

A008966 a(n) = 1 if n is squarefree, otherwise 0.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

a(n) depends only on prime signature of n (cf. A025487). So a(24) = a(375) since 24 = 2^3*3 and 375 = 3*5^3 both have prime signature (3, 1).
The infinite lower triangular matrix with A008966 on the main diagonal and the rest zeros is the square of triangle A143255. - Gary W. Adamson, Aug 02 2008

Crossrefs

Cf. A005117, A008836 (Dirichlet inverse), A013928 (partial sums).
Parity of A002033.
Cf. A082020 (Dgf at s=2), A157289 (Dgf at s=3), A157290 (Dgf at s=4).

Programs

  • Haskell
    a008966 = abs . a008683
    -- Reinhard Zumkeller, Dec 13 2015, Dec 15 2014, May 27 2012, Jan 25 2012
    
  • Magma
    [ Abs(MoebiusMu(n)) : n in [1..100]];
    
  • Maple
    A008966 := proc(n) if numtheory[issqrfree](n) then 1 ; else 0 ; end if; end proc: # R. J. Mathar, Mar 14 2011
  • Mathematica
    A008966[n_] := Abs[MoebiusMu[n]]; Table[A008966[n], {n, 100}] (* Enrique Pérez Herrero, Apr 15 2010 *)
    Table[If[SquareFreeQ[n],1,0],{n,100}] (* or *) Boole[SquareFreeQ/@ Range[ 100]] (* Harvey P. Dale, Feb 28 2015 *)
  • MuPAD
    func(abs(numlib::moebius(n)), n):
    
  • PARI
    a(n)=if(n<1,0,direuler(p=2,n,1+X))[n]
    
  • PARI
    a(n)=issquarefree(n) \\ Michel Marcus, Feb 22 2015
    
  • Python
    from sympy import factorint
    def A008966(n): return int(max(factorint(n).values(),default=1)==1) # Chai Wah Wu, Apr 05 2023

Formula

Dirichlet g.f.: zeta(s)/zeta(2s).
a(n) = abs(mu(n)), where mu is the Moebius function (A008683).
a(n) = 0^(bigomega(n) - omega(n)), where bigomega(n) and omega(n) are the numbers of prime factors of n with and without repetition (A001222, A001221, A046660). - Reinhard Zumkeller, Apr 05 2003
Multiplicative with p^e -> 0^(e - 1), p prime and e > 0. - Reinhard Zumkeller, Jul 15 2003
a(n) = 0^(A046951(n) - 1). - Reinhard Zumkeller, May 20 2007
a(n) = 1 - A107078(n). - Reinhard Zumkeller, Oct 03 2008
a(n) = floor(rad(n)/n), where rad() is A007947. - Enrique Pérez Herrero, Nov 13 2009
A175046(n) = a(n)*A073311(n). - Reinhard Zumkeller, Apr 05 2010
a(n) = floor(A000005(n^2)/A007425(n)). - Enrique Pérez Herrero, Apr 15 2010
a(A005117(n)) = 1; a(A013929(n)) = 0; a(n) = A013928(n + 1) - A013928(n). - Reinhard Zumkeller, Jul 05 2010
a(n) * A112526(n) = A063524(n). - Reinhard Zumkeller, Sep 16 2011
a(n) = mu(n) * lambda(n) = A008836(n) * A008683(n). - Enrique Pérez Herrero, Nov 29 2013
a(n) = Sum_{d|n} 2^omega(d)*mu(n/d). - Geoffrey Critzer, Feb 22 2015
a(n) = A085357(A156552(n)). - Antti Karttunen, Mar 06 2017
Limit_{n->oo} (1/n)*Sum_{j=1..n} a(j) = 6/Pi^2. - Andres Cicuttin, Aug 13 2017
a(1) = 1; a(n) = -Sum_{d|n, d < n} (-1)^bigomega(n/d) * a(d). - Ilya Gutkovskiy, Mar 10 2021

Extensions

Deleted an unclear comment. - N. J. A. Sloane, May 30 2021

A007913 Squarefree part of n: a(n) is the smallest positive number m such that n/m is a square.

Original entry on oeis.org

1, 2, 3, 1, 5, 6, 7, 2, 1, 10, 11, 3, 13, 14, 15, 1, 17, 2, 19, 5, 21, 22, 23, 6, 1, 26, 3, 7, 29, 30, 31, 2, 33, 34, 35, 1, 37, 38, 39, 10, 41, 42, 43, 11, 5, 46, 47, 3, 1, 2, 51, 13, 53, 6, 55, 14, 57, 58, 59, 15, 61, 62, 7, 1, 65, 66, 67, 17, 69, 70, 71, 2, 73, 74, 3, 19, 77
Offset: 1

Views

Author

R. Muller, Mar 15 1996

Keywords

Comments

Also called core(n). [Not to be confused with the squarefree kernel of n, A007947.]
Sequence read mod 4 gives A065882. - Philippe Deléham, Mar 28 2004
This is an arithmetic function and is undefined if n <= 0.
A note on square roots of numbers: 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(A007947(b),c) = A007947(n) = "squarefree kernel" of n and bc = A019554(n) = "outer square root" of n. [Corrected by M. F. Hasler, Mar 01 2018]
If n > 1, the quantity f(n) = log(n/core(n))/log(n) satisfies 0 <= f(n) <= 1; f(n) = 0 when n is squarefree and f(n) = 1 when n is a perfect square. One can define n as being "epsilon-almost squarefree" if f(n) < epsilon. - Kurt Foster (drsardonicus(AT)earthlink.net), Jun 28 2008
a(n) is the smallest natural number m such that product of geometric mean of the divisors of n and geometric mean of the divisors of m are integers. Geometric mean of the divisors of number n is real number b(n) = Sqrt(n). a(n) = 1 for infinitely many n. a(n) = 1 for numbers from A000290: a(A000290(n)) = 1. For n = 8; b(8) = sqrt(8), a(n) = 2 because b(2) = sqrt(2); sqrt(8) * sqrt(2) = 4 (integer). - Jaroslav Krizek, Apr 26 2010
Dirichlet convolution of A010052 with the sequence of absolute values of A055615. - R. J. Mathar, Feb 11 2011
Booker, Hiary, & Keating outline a method for bounding (on the GRH) a(n) for large n using L-functions. - Charles R Greathouse IV, Feb 01 2013
According to the formula a(n) = n/A000188(n)^2, the scatterplot exhibits the straight lines y=x, y=x/4, y=x/9, ..., i.e., y=x/k^2 for all k=1,2,3,... - M. F. Hasler, May 08 2014
The Dirichlet inverse of this sequence is A008836(n) * A063659(n). - Álvar Ibeas, Mar 19 2015
a(n) = 1 if n is a square, a(n) = n if n is a product of distinct primes. - Zak Seidov, Jan 30 2016
All solutions of the Diophantine equation n*x=y^2 or, equivalently, G(n,x)=y, with G being the geometric mean, are of the form x=k^2*a(n), y=k*sqrt(n*a(n)), where k is a positive integer. - Stanislav Sykora, Feb 03 2016
If f is a multiplicative function then Sum_{d divides n} f(a(d)) is also multiplicative. For example, A010052(n) = Sum_{d divides n} mu(a(d)) and A046951(n) = Sum_{d divides n} mu(a(d)^2). - Peter Bala, Jan 24 2024

Crossrefs

See A000188, A007947, A008833, A019554, A117811 for related information, specific to n.
See A027746, A027748, A124010 for factorization data for n.
Analogous sequences: A050985, A053165, A055231.
Cf. A002734, A005117 (range of values), A059897, A069891 (partial sums), A090699, A350389.
Related to A006519 via A225546.

Programs

  • Haskell
    a007913 n = product $
                zipWith (^) (a027748_row n) (map (`mod` 2) $ a124010_row n)
    -- Reinhard Zumkeller, Jul 06 2012
    
  • Magma
    [ Squarefree(n) : n in [1..256] ]; // N. J. A. Sloane, Dec 23 2006
    
  • Maple
    A007913 := proc(n) local f,a,d; f := ifactors(n)[2] ; a := 1 ; for d in f do if type(op(2,d),'odd') then a := a*op(1,d) ; end if; end do: a; end proc: # R. J. Mathar, Mar 18 2011
    # second Maple program:
    a:= n-> mul(i[1]^irem(i[2], 2), i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jul 20 2015
    seq(n / expand(numtheory:-nthpow(n, 2)), n=1..77);  # Peter Luschny, Jul 12 2022
  • Mathematica
    data = Table[Sqrt[n], {n, 1, 100}]; sp = data /. Sqrt[] -> 1; sfp = data/sp /. Sqrt[x] -> x (* Artur Jasinski, Nov 03 2008 *)
    Table[Times@@Power@@@({#[[1]],Mod[ #[[2]],2]}&/@FactorInteger[n]),{n,100}] (* Zak Seidov, Apr 08 2009 *)
    Table[{p, e} = Transpose[FactorInteger[n]]; Times @@ (p^Mod[e, 2]), {n, 100}] (* T. D. Noe, May 20 2013 *)
    Sqrt[#] /. (c_:1)*a_^(b_:0) -> (c*a^b)^2& /@ Range@100 (* Bill Gosper, Jul 18 2015 *)
  • PARI
    a(n)=core(n)
    
  • Python
    from sympy import factorint, prod
    def A007913(n):
        return prod(p for p, e in factorint(n).items() if e % 2)
    # Chai Wah Wu, Feb 03 2015
    
  • Sage
    [squarefree_part(n) for n in (1..77)] # Peter Luschny, Feb 04 2015

Formula

Multiplicative with a(p^k) = p^(k mod 2). - David W. Wilson, Aug 01 2001
a(n) modulo 2 = A035263(n); a(A036554(n)) is even; a(A003159(n)) is odd. - Philippe Deléham, Mar 28 2004
Dirichlet g.f.: zeta(2s)*zeta(s-1)/zeta(2s-2). - R. J. Mathar, Feb 11 2011
a(n) = n/( Sum_{k=1..n} floor(k^2/n)-floor((k^2 -1)/n) )^2. - Anthony Browne, Jun 06 2016
a(n) = rad(n)/a(n/rad(n)), where rad = A007947. This recurrence relation together with a(1) = 1 generate the sequence. - Velin Yanev, Sep 19 2017
From Peter Munn, Nov 18 2019: (Start)
a(k*m) = A059897(a(k), a(m)).
a(n) = n / A008833(n).
(End)
a(A225546(n)) = A225546(A006519(n)). - Peter Munn, Jan 04 2020
From Amiram Eldar, Mar 14 2021: (Start)
Theorems proven by Copil and Panaitopol (2007):
Lim sup_{n->oo} a(n+1)-a(n) = oo.
Lim inf_{n->oo} a(n+1)-a(n) = -oo.
Sum_{k=1..n} 1/a(k) ~ c*sqrt(n) + O(log(n)), where c = zeta(3/2)/zeta(3) (A090699). (End)
a(n) = A019554(n)^2/n. - Jianing Song, May 08 2022
Sum_{k=1..n} a(k) ~ c * n^2, where c = Pi^2/30 = 0.328986... . - Amiram Eldar, Oct 25 2022
a(n) = A007947(A350389(n)). - Amiram Eldar, Jan 20 2024

Extensions

More terms from Michael Somos, Nov 24 2001
Definition reformulated by Daniel Forgues, Mar 24 2009

A000688 Number of Abelian groups of order n; number of factorizations of n into prime powers.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 5, 1, 2, 1, 2, 1, 1, 1, 3, 2, 1, 3, 2, 1, 1, 1, 7, 1, 1, 1, 4, 1, 1, 1, 3, 1, 1, 1, 2, 2, 1, 1, 5, 2, 2, 1, 2, 1, 3, 1, 3, 1, 1, 1, 2, 1, 1, 2, 11, 1, 1, 1, 2, 1, 1, 1, 6, 1, 1, 2, 2, 1, 1, 1, 5, 5, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 2, 1, 1, 1, 7, 1, 2, 2, 4, 1, 1, 1, 3, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Equivalently, number of Abelian groups with n conjugacy classes. - Michael Somos, Aug 10 2010
a(n) depends only on prime signature of n (cf. A025487). So a(24) = a(375) since 24 = 2^3*3 and 375 = 3*5^3 both have prime signature (3, 1).
Also number of rings with n elements that are the direct product of fields; these are the commutative rings with n elements having no nilpotents; likewise the commutative rings where for every element x there is a k > 0 such that x^(k+1) = x. - Franklin T. Adams-Watters, Oct 20 2006
Range is A033637.
a(n) = 1 if and only if n is from A005117 (squarefree numbers). See the Ahmed Fares comment there, and the formula for n>=2 below. - Wolfdieter Lang, Sep 09 2012
Also, from a theorem of Molnár (see [Molnár]), the number of (non-isomorphic) abelian groups of order 2*n + 1 is equal to the number of non-congruent lattice Z-tilings of R^n by crosses, where a "cross" is a unit cube in R^n for which at each facet is attached another unit cube (Z, R are the integers and reals, respectively). (Cf. [Horak].) - L. Edson Jeffery, Nov 29 2012
Zeta(k*s) is the Dirichlet generating function of the characteristic function of numbers which are k-th powers (k=1 in A000012, k=2 in A010052, k=3 in A010057, see arXiv:1106.4038 Section 3.1). The infinite product over k (here) is the number of representations n=product_i (b_i)^(e_i) where all exponents e_i are distinct and >=1. Examples: a(n=4)=2: 4^1 = 2^2. a(n=8)=3: 8^1 = 2^1*2^2 = 2^3. a(n=9)=2: 9^1 = 3^2. a(n=12)=2: 12^1 = 3*2^2. a(n=16)=5: 16^1 = 2*2^3 = 4^2 = 2^2*4^1 = 2^4. If the e_i are the set {1,2} we get A046951, the number of representations as a product of a number and a square. - R. J. Mathar, Nov 05 2016
See A060689 for the number of non-abelian groups of order n. - M. F. Hasler, Oct 24 2017
Kendall & Rankin prove that the density of {n: a(n) = m} exists for each m. - Charles R Greathouse IV, Jul 14 2024

Examples

			a(1) = 1 since the trivial group {e} is the only group of order 1, and it is Abelian; alternatively, since the only factorization of 1 into prime powers is the empty product.
a(p) = 1 for any prime p, since the only factorization into prime powers is p = p^1, and (in view of Lagrange's theorem) there is only one group of prime order p; it is isomorphic to (Z/pZ,+) and thus Abelian.
From _Wolfdieter Lang_, Jul 22 2011: (Start)
a(8) = 3 because 8 = 2^3, hence a(8) = pa(3) = A000041(3) = 3 from the partitions (3), (2, 1) and (1, 1, 1), leading to the 3 factorizations of 8: 8, 4*2 and 2*2*2.
a(36) = 4 because 36 = 2^2*3^2, hence a(36) = pa(2)*pa(2) = 4 from the partitions (2) and (1, 1), leading to the 4 factorizations of 36: 2^2*3^2, 2^2*3^1*3^1, 2^1*2^1*3^2 and 2^1*2^1*3^1*3^1.
(End)
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 274-278.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section XIII.12, p. 468.
  • J. S. Rose, A Course on Group Theory, Camb. Univ. Press, 1978, see p. 7.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. Speiser, Die Theorie der Gruppen von endlicher Ordnung, 4. Auflage, Birkhäuser, 1956.

Crossrefs

Cf. A080729 (Dgf at s=2), A369634 (Dgf at s=3).

Programs

  • Haskell
    a000688 = product . map a000041 . a124010_row
    -- Reinhard Zumkeller, Aug 28 2014
    
  • Maple
    with(combinat): readlib(ifactors): for n from 1 to 120 do ans := 1: for i from 1 to nops(ifactors(n)[2]) do ans := ans*numbpart(ifactors(n)[2][i][2]) od: printf(`%d,`,ans): od: # James Sellers, Dec 07 2000
  • Mathematica
    f[n_] := Times @@ PartitionsP /@ Last /@ FactorInteger@n; Array[f, 107] (* Robert G. Wilson v, Sep 22 2006 *)
    Table[FiniteAbelianGroupCount[n], {n, 200}] (* Requires version 7.0 or later. - Vladimir Joseph Stephan Orlovsky, Jul 01 2011 *)
  • PARI
    A000688(n)=local(f);f=factor(n);prod(i=1,matsize(f)[1],numbpart(f[i,2])) \\ Michael B. Porter, Feb 08 2010
    
  • PARI
    a(n)=my(f=factor(n)[,2]); prod(i=1,#f,numbpart(f[i])) \\ Charles R Greathouse IV, Apr 16 2015
    
  • Python
    from sympy import factorint, npartitions
    from math import prod
    def A000688(n): return prod(map(npartitions,factorint(n).values())) # Chai Wah Wu, Jan 14 2022
  • Sage
    def a(n):
        F=factor(n)
        return prod([number_of_partitions(F[i][1]) for i in range(len(F))])
    # Ralf Stephan, Jun 21 2014
    

Formula

Multiplicative with a(p^k) = number of partitions of k = A000041(k); a(mn) = a(m)a(n) if (m, n) = 1.
a(2n) = A101872(n).
a(n) = Product_{j = 1..N(n)} A000041(e(j)), n >= 2, if
n = Product_{j = 1..N(n)} prime(j)^e(j), N(n) = A001221(n). See the Richert reference, quoting A. Speiser's book on finite groups (in German, p. 51 in words). - Wolfdieter Lang, Jul 23 2011
In terms of the cycle index of the symmetric group: Product_{q=1..m} [z^{v_q}] Z(S_v) 1/(1-z) where v is the maximum exponent of any prime in the prime factorization of n, v_q are the exponents of the prime factors, and Z(S_v) is the cycle index of the symmetric group on v elements. - Marko Riedel, Oct 03 2014
Dirichlet g.f.: Sum_{n >= 1} a(n)/n^s = Product_{k >= 1} zeta(ks) [Kendall]. - Álvar Ibeas, Nov 05 2014
a(n)=2 for all n in A054753 and for all n in A085987. a(n)=3 for all n in A030078 and for all n in A065036. a(n)=4 for all n in A085986. a(n)=5 for all n in A030514 and for all n in A178739. a(n)=6 for all n in A143610. - R. J. Mathar, Nov 05 2016
A050360(n) = a(A025487(n)). a(n) = A050360(A101296(n)). - R. J. Mathar, May 26 2017
a(n) = A000001(n) - A060689(n). - M. F. Hasler, Oct 24 2017
From Amiram Eldar, Nov 01 2020: (Start)
a(n) = a(A057521(n)).
Asymptotic mean: lim_{n->oo} (1/n) * Sum_{k=1..n} a(k) = A021002. (End)
a(n) = A005361(n) except when n is a term of A046101, since A000041(x) = x for x <= 3. - Miles Englezou, Feb 17 2024
Inverse Moebius transform of A188585: a(n) = Sum_{d|n} A188585(d). - Amiram Eldar, Jun 10 2025

A028982 Squares and twice squares.

Original entry on oeis.org

1, 2, 4, 8, 9, 16, 18, 25, 32, 36, 49, 50, 64, 72, 81, 98, 100, 121, 128, 144, 162, 169, 196, 200, 225, 242, 256, 288, 289, 324, 338, 361, 392, 400, 441, 450, 484, 512, 529, 576, 578, 625, 648, 676, 722, 729, 784, 800, 841, 882, 900, 961, 968, 1024
Offset: 1

Views

Author

Keywords

Comments

Numbers n such that sum of divisors of n (A000203) is odd.
Also the numbers with an odd number of run sums (trapezoidal arrangements, number of ways of being written as the difference of two triangular numbers). - Ron Knott, Jan 27 2003
Pell(n)*Sum_{k|n} 1/Pell(k) is odd, where Pell(n) is A000129(n). - Paul Barry, Oct 12 2005
Number of odd divisors of n (A001227) is odd. - Vladeta Jovovic, Aug 28 2007
A071324(a(n)) is odd. - Reinhard Zumkeller, Jul 03 2008
Sigma(a(n)) = A000203(a(n)) = A152677(n). - Jaroslav Krizek, Oct 06 2009
Numbers n such that sum of odd divisors of n (A000593) is odd. - Omar E. Pol, Jul 05 2016
A187793(a(n)) is odd. - Timothy L. Tiffin, Jul 18 2016
If k is odd (k = 2m+1 for m >= 0), then 2^k = 2^(2m+1) = 2*(2^m)^2. If k is even (k = 2m for m >= 0), then 2^k = 2^(2m) = (2^m)^2. So, the powers of 2 sequence (A000079) is a subsequence of this one. - Timothy L. Tiffin, Jul 18 2016
Numbers n such that A175317(n) = Sum_{d|n} pod(d) is odd, where pod(m) = the product of divisors of m (A007955). - Jaroslav Krizek, Dec 28 2016
Positions of zeros in A292377 and A292383, positions of ones in A286357 and A292583. (See A292583 for why.) - Antti Karttunen, Sep 25 2017
Numbers of the form A000079(i)*A016754(j), i,j>=0. - R. J. Mathar, May 30 2020
Equivalently, numbers whose odd part is square. Cf. A042968. - Peter Munn, Jul 14 2020
These are the Heinz numbers of the partitions counted by A119620. - Gus Wiseman, Oct 29 2021
Numbers m whose abundance, A033880(m), is odd. - Peter Munn, May 23 2022
Numbers with an odd number of middle divisors (cf. A067742). - Omar E. Pol, Aug 02 2022

Crossrefs

Complement of A028983.
Characteristic function is A053866, A093709.
Odd terms in A178910.
Supersequence of A000079.

Programs

  • Haskell
    import Data.List.Ordered (union)
    a028982 n = a028982_list !! (n-1)
    a028982_list = tail $ union a000290_list a001105_list
    -- Reinhard Zumkeller, Jun 27 2015
    
  • Mathematica
    Take[ Sort[ Flatten[ Table[{n^2, 2n^2}, {n, 35}] ]], 57] (* Robert G. Wilson v, Aug 27 2004 *)
  • PARI
    list(lim)=vecsort(concat(vector(sqrtint(lim\1),i,i^2), vector(sqrtint(lim\2),i,2*i^2))) \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    from itertools import count, islice
    from sympy.ntheory.primetest import is_square
    def A028982_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:int(is_square(n) or is_square(n<<1)),count(max(startvalue,1)))
    A028982_list = list(islice(A028982_gen(),30)) # Chai Wah Wu, Jan 09 2023
    
  • Python
    from math import isqrt
    def A028982(n):
        def f(x): return n-1+x-isqrt(x)-isqrt(x>>1)
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 22 2024

Formula

a(n) is asymptotic to c*n^2 with c = 2/(1+sqrt(2))^2 = 0.3431457.... - Benoit Cloitre, Sep 17 2002
In particular, a(n) = c*n^2 + O(n). - Charles R Greathouse IV, Jan 11 2013
a(A003152(n)) = n^2; a(A003151(n)) = 2*n^2. - Enrique Pérez Herrero, Oct 09 2013
Sum_{n>=1} 1/a(n) = Pi^2/4. - Amiram Eldar, Jun 28 2020

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

A007862 Number of triangular numbers that divide n.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 1, 1, 2, 2, 1, 3, 1, 1, 3, 1, 1, 3, 1, 2, 3, 1, 1, 3, 1, 1, 2, 2, 1, 5, 1, 1, 2, 1, 1, 4, 1, 1, 2, 2, 1, 4, 1, 1, 4, 1, 1, 3, 1, 2, 2, 1, 1, 3, 2, 2, 2, 1, 1, 5, 1, 1, 3, 1, 1, 4, 1, 1, 2, 2, 1, 4, 1, 1, 3, 1, 1, 4, 1, 2, 2, 1, 1, 5, 1, 1, 2, 1, 1, 6, 2, 1, 2, 1, 1, 3, 1, 1, 2, 2, 1, 3, 1, 1, 5
Offset: 1

Views

Author

Keywords

Comments

Also a(n) is the total number of ways to represent n+1 as a centered polygonal number of the form km(m+1)/2+1 for k>1. - Alexander Adamchuk, Apr 26 2007
Number of oblong numbers that divide 2n. - Ray Chandler, Jun 24 2008
The number of divisors d of 2n such that d+1 is also a divisor of 2n, see first formula. - Michel Marcus, Jun 18 2015
From Gus Wiseman, May 03 2019: (Start)
Also the number of integer partitions of n forming a finite arithmetic progression with offset 0, i.e. the differences are all equal (with the last part taken to be 0). The Heinz numbers of these partitions are given by A325327. For example, the a(1) = 1 through a(12) = 3 partitions are (A = 10, B = 11, C = 12):
1 2 3 4 5 6 7 8 9 A B C
21 42 63 4321 84
321 642
(End)

Crossrefs

Programs

  • Haskell
    a007862 = sum . map a010054 . a027750_row
    -- Reinhard Zumkeller, Jul 05 2014
    
  • Mathematica
    sup=90; TriN=Array[ (#+1)(#+2)/2&, Floor[ N[ Sqrt[ sup*2 ] ] ]-1 ]; Array[ Function[n, 1+Count[ Map[ Mod[ n, # ]&, TriN ], 0 ] ], sup ]
    Table[Count[Divisors[k], ?(IntegerQ[Sqrt[8 # + 1]] &)], {k, 105}] (* _Jayanta Basu, Aug 12 2013 *)
    Table[Length[Select[IntegerPartitions[n],SameQ@@Differences[Append[#,0]]&]],{n,0,30}] (* Gus Wiseman, May 03 2019 *)
  • PARI
    a(n) = sumdiv(n, d, ispolygonal(d, 3)); \\ Michel Marcus, Jun 18 2015
    
  • Python
    from itertools import pairwise
    from sympy import divisors
    def A007862(n): return sum(1 for a, b in pairwise(divisors(n<<1)) if a+1==b)  # Chai Wah Wu, Jun 09 2025

Formula

a(n) = Sum_{d|2*n,d+1|2*n} 1.
G.f.: Sum_{k>=1} x^A000217(k)/(1-x^A000217(k)). - Jon Perry, Jul 03 2004
a(A130317(n)) = n and a(m) <> n for m < A130317(n). - Reinhard Zumkeller, May 23 2007
a(n) = A129308(2n). - Ray Chandler, Jun 24 2008
a(n) = Sum_{k=1..A000005(n)} A010054(A027750(n,k)). - Reinhard Zumkeller, Jul 05 2014
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Dec 31 2023

Extensions

Extended by Ray Chandler, Jun 24 2008
Showing 1-10 of 141 results. Next