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 24 results. Next

A098235 Number of ways to write n as a sum of two ordered positive squarefree numbers.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 6, 4, 3, 4, 7, 6, 5, 6, 10, 8, 8, 6, 11, 8, 9, 8, 14, 10, 9, 10, 13, 10, 9, 10, 16, 12, 13, 12, 22, 14, 13, 14, 22, 16, 15, 18, 25, 20, 15, 16, 26, 20, 16, 14, 27, 20, 20, 14, 26, 20, 21, 18, 29, 22, 21, 22, 30, 22, 21, 22, 35, 24, 25, 22, 42, 26, 27, 26, 39
Offset: 1

Views

Author

Ralf Stephan, Aug 31 2004

Keywords

Comments

a(n) ~ n * Prod[p prime, (1-2/p^2) * Prod[p^2|n, (p^2-1)/(p^2-2)]].

Examples

			a(12)=7 because 12=1+11=2+10=5+7=6+6=7+5=10+2=11+1.
		

Crossrefs

Programs

  • Mathematica
    Join[{0}, Table[Sum[(MoebiusMu[k]*MoebiusMu[n - k + 1])^2, {k, 1, n}], {n, 1, 50}]] (* G. C. Greubel, Dec 28 2016 *)
  • PARI
    a(n) = sum(k=1, n-1, (moebius(k)*moebius(n-k))^2) \\ Indranil Ghosh, Mar 10 2017
    
  • PARI
    a(n)=my(s); forsquarefree(k=1, n-1, s+=issquarefree(n-k)); s \\ Charles R Greathouse IV, Jan 08 2018

Formula

a(n) = Sum_{k=1..n-1} (mu(k)*mu(n-k))^2. - Benoit Cloitre, Sep 24 2006
a(n) = Sum_{k=1..n-1} ( A008966(k)*A008966(n-k) ). - Reinhard Zumkeller, Nov 04 2009
G.f.: ( Sum_{k>=1} mu(k)^2*x^k )^2, where mu(k) is the Moebius function (A008683). - Ilya Gutkovskiy, Dec 28 2016

A262351 Sum of the parts in the partitions of n into exactly two squarefree parts.

Original entry on oeis.org

0, 2, 3, 8, 5, 12, 14, 24, 18, 20, 22, 48, 39, 42, 45, 80, 68, 72, 57, 120, 84, 110, 92, 168, 125, 130, 135, 196, 145, 150, 155, 256, 198, 238, 210, 396, 259, 266, 273, 440, 328, 336, 387, 572, 450, 368, 376, 624, 490, 400, 357, 728, 530, 540, 385, 728, 570
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 18 2015

Keywords

Comments

One-half of the sum of the perimeters of the rectangles with squarefree length and width such that L + W = n, W <= L. For example, a(8) = 24; the rectangles are 1 X 7, 2 X 6 and 3 X 5 with perimeters 16, 16 and 16. Then (16 + 16 + 16)/2 = 48/2 = 24. - Wesley Ivan Hurt, Nov 04 2017

Examples

			a(4) = 8; There are two partitions of 4 into two squarefree parts: (3,1) and (2,2). Thus we have a(4) = (3+1) + (2+2) = 8.
a(7) = 14; There are three partitions of 7 into two parts: (6,1), (5,2) and (4,3). Since only two of these partitions have squarefree parts, we have a(7) = (6+1) + (5+2) = 14.
		

Crossrefs

Programs

  • Mathematica
    Table[n*Sum[MoebiusMu[i]^2*MoebiusMu[n - i]^2, {i, Floor[n/2]}], {n, 70}]
    Table[Total[Flatten[Select[IntegerPartitions[n,{2}],AllTrue[ #,SquareFreeQ]&]]],{n,60}] (* Harvey P. Dale, Aug 19 2021 *)
  • PARI
    a(n)=my(s=issquarefree(n-1) && n>1); forfactored(k=(n+1)\2,n-2, if(vecmax(k[2][,2])==1 && issquarefree(n-k[1]), s++)); s*n \\ Charles R Greathouse IV, Nov 05 2017

Formula

a(n) = n * Sum_{i=1..floor(n/2)} mu(i)^2 * mu(n-i)^2, where mu is the Möbius function (A008683).
a(n) = n * A071068(n).

A261985 Sum of the smaller parts of the partitions of n into two squarefree parts.

Original entry on oeis.org

0, 1, 1, 3, 2, 4, 3, 6, 5, 8, 6, 14, 11, 11, 8, 17, 18, 16, 13, 32, 25, 27, 19, 39, 32, 39, 35, 58, 40, 47, 32, 61, 47, 65, 41, 93, 58, 67, 54, 95, 73, 80, 89, 130, 109, 94, 87, 142, 110, 106, 102, 203, 129, 130, 115, 189, 148, 151, 137, 232, 170, 165, 169
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 02 2015

Keywords

Comments

Sum of the widths of the distinct rectangles with squarefree length and width such that L + W = n, W <= L. For example a(16) = 17; the rectangles are 1 X 15, 2 X 14, 3 X 13, 5 X 11, 6 X 10 and the sum of the widths of these rectangles gives 1 + 2 + 3 + 5 + 6 = 17. - Wesley Ivan Hurt, Nov 02 2017

Examples

			a(4)=3; there are two partitions of 4 into two squarefree parts: (3,1) and (2,2). The sum of the smaller parts of these partitions is 1+2=3.
a(6)=4; there are two partitions of 6 into two squarefree parts: (5,1) and (3,3). The sum of the smaller parts is 1+3=4.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A261985:=n->add(i*mobius(i)^2*mobius(n-i)^2, i=1..floor(n/2)): seq(A261985(n), n=1..100);
  • Mathematica
    Table[Sum[i*MoebiusMu[i]^2*MoebiusMu[n - i]^2, {i, Floor[n/2]}], {n, 100}]
  • PARI
    a(n) = sum(i=1, n\2, i*moebius(i)^2*moebius(n-i)^2); \\ Altug Alkan, Jan 01 2018

Formula

a(n) = Sum_{i=1..floor(n/2)} (i * mu(i)^2 * mu(n-i)^2), where mu is the Moebius function (A008683).
a(n) = A262351(n) - A261927(n).
a(n) = A303221(n)/n. - Wesley Ivan Hurt, Jan 05 2024

A262991 Number of squarefree numbers among the parts of the partitions of n into two parts.

Original entry on oeis.org

0, 2, 2, 4, 3, 5, 5, 6, 6, 7, 7, 9, 8, 10, 10, 11, 11, 12, 12, 14, 13, 15, 15, 16, 16, 17, 17, 18, 17, 19, 19, 20, 20, 22, 22, 23, 23, 25, 25, 26, 26, 28, 28, 30, 29, 30, 30, 31, 31, 31, 31, 33, 32, 33, 33, 34, 34, 36, 36, 38, 37, 39, 39, 39, 39, 41, 41, 43
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 06 2015

Keywords

Examples

			a(5)=3; there are 2 partitions of 5 into two parts: (4,1) and (3,2). Three of the parts in the partitions are squarefree, so a(5)=3.
a(6)=5; there are 3 partitions of 6 into two parts: (5,1), (4,2) and (3,3). Five of the parts in the partitions are squarefree, so a(6)=5.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A262991:=n->add(mobius(i)^2+mobius(n-i)^2, i=1..floor(n/2)): seq(A262991(n), n=1..100);
  • Mathematica
    Table[Sum[MoebiusMu[i]^2 + MoebiusMu[n - i]^2, {i, Floor[n/2]}], {n, 100}]
    Table[Count[Flatten[IntegerPartitions[n,{2}]],?SquareFreeQ],{n,70}] (* _Harvey P. Dale, Aug 18 2021 *)
  • PARI
    vector(100, n, sum(k=1, n\2, moebius(k)^2 + moebius(n-k)^2)) \\ Altug Alkan, Oct 07 2015

Formula

a(n) = Sum_{i=1..floor(n/2)} mu(i)^2 + mu(n-i)^2, where mu is the Möebius function (A008683).
a(n) = A262868(n) + A262869(n).
a(n) = A294101(n) + 2*A071068(n). - Wesley Ivan Hurt, Jul 16 2025

A285734 a(1) = 0, and for n > 1, a(n) = the largest squarefree number x such that x < n-x, and n-x is also squarefree.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 2, 3, 3, 5, 5, 6, 6, 7, 5, 6, 7, 7, 6, 10, 10, 11, 10, 11, 11, 13, 13, 14, 14, 15, 14, 15, 14, 17, 14, 17, 15, 19, 17, 19, 19, 21, 21, 22, 22, 23, 21, 22, 23, 21, 22, 26, 23, 23, 26, 26, 26, 29, 29, 30, 30, 31, 30, 31, 31, 33, 33, 34, 34, 35, 34, 35, 35, 37, 37, 38, 38, 39, 38, 39, 39, 41, 41, 42, 42, 43, 41, 42, 43, 43, 38, 46, 46, 47, 42
Offset: 1

Views

Author

Antti Karttunen, May 02 2017

Keywords

Comments

For n > 1, a(n) = the largest squarefree number x <= n/2 for which n-x is also squarefree.
For any n > 1 there is at least one decomposition of n as a sum of two squarefree numbers (cf. A071068 and the Mathematics Stack Exchange link). Of all pairs (x,y) of squarefree numbers for which x <= y and x+y = n, sequences A285734 and A285735 give the unique pair for which the difference y-x is the least possible.

Crossrefs

Programs

  • PARI
    a(n)=forstep(x=n\2,1,-1, if(issquarefree(x) && issquarefree(n-x), return(x))); 0 \\ Charles R Greathouse IV, Nov 05 2017
  • Python
    from sympy.ntheory.factor_ import core
    def issquarefree(n): return core(n) == n
    def a285734(n):
        if n==1: return 0
        j=n//2
        while True:
            if issquarefree(j) and issquarefree(n - j): return j
            else: j-=1
    print([a285734(n) for n in range(1, 101)]) # Indranil Ghosh, May 02 2017
    
  • Scheme
    (define (A285734 n) (if (= 1 n) 0 (let loop ((j 1) (k (- n 1)) (s 0)) (if (> j k) s (loop (+ 1 j) (- k 1) (max s (* j (A008966 j) (A008966 k))))))))
    ;; Much faster version:
    (define (A285734 n) (if (= 1 n) 0 (let loop ((j (floor->exact (/ n 2)))) (if (and (= 1 (A008966 j)) (= 1 (A008966 (- n j)))) j (loop (- j 1))))))
    

Formula

a(n) = n - A285735(n).

A285735 a(1) = 1, and for n > 1, a(n) = the least squarefree number x such that x > n-x, and n-x is also squarefree.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 5, 5, 6, 5, 6, 6, 7, 7, 10, 10, 10, 11, 13, 10, 11, 11, 13, 13, 14, 13, 14, 14, 15, 15, 17, 17, 19, 17, 21, 19, 22, 19, 22, 21, 22, 21, 22, 22, 23, 23, 26, 26, 26, 29, 29, 26, 30, 31, 29, 30, 31, 29, 30, 30, 31, 31, 33, 33, 34, 33, 34, 34, 35, 35, 37, 37, 38, 37, 38, 38, 39, 39, 41, 41, 42, 41, 42, 42, 43, 43, 46, 46, 46, 47, 53, 46, 47, 47
Offset: 1

Views

Author

Antti Karttunen, May 02 2017

Keywords

Comments

For n > 1, a(n) = the least squarefree number x >= n/2 for which n-x is also squarefree.
For any n > 1 there is at least one decomposition of n as a sum of two squarefree numbers (cf. A071068 and the Mathematics Stack Exchange link). Of all pairs (x,y) of squarefree numbers for which x <= y and x+y = n, sequences A285734 and A285735 give the unique pair for which the difference y-x is the least possible.

Crossrefs

Programs

  • PARI
    a(n)=for(x=(n+1)\2,n, if(issquarefree(x) && issquarefree(n-x), return(x))); 1 \\ Charles R Greathouse IV, Nov 05 2017
  • Python
    from sympy.ntheory.factor_ import core
    def issquarefree(n): return core(n) == n
    def a285734(n):
        if n==1: return 0
        j=n//2
        while True:
            if issquarefree(j) and issquarefree(n - j): return j
            else: j-=1
    def a285735(n): return n - a285734(n)
    print([a285735(n) for n in range(1, 101)]) # Indranil Ghosh, May 02 2017
    
  • Scheme
    (define (A285735 n) (- n (A285734 n)))
    

Formula

a(n) = n - A285734(n).

A262868 Number of squarefree numbers appearing among the larger parts of the partitions of n into two parts.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 2, 3, 3, 3, 3, 4, 3, 4, 4, 5, 5, 6, 6, 7, 6, 7, 7, 8, 8, 8, 8, 8, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 14, 14, 14, 15, 15, 15, 15, 16, 15, 16, 16, 17, 17, 18, 18, 19, 18, 19, 19, 19, 19, 20, 20, 21, 20, 21, 21, 22, 22
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 03 2015

Keywords

Comments

Number of distinct rectangles with squarefree length and integer width such that L + W = n, W <= L. For example, a(14) = 4; the rectangles are 1 X 13, 3 X 11, 4 X 10 and 7 X 7. - Wesley Ivan Hurt, Nov 02 2017
a(10) = 3, a(100) = 30, a(10^3) = 302, a(10^4) = 3041, a(10^5) = 30393, a(10^6) = 303968, a(10^7) = 3039658, a(10^8) = 30396350, a(10^9) = 303963598, a(10^10) = 3039635373, a(10^11) = 30396355273, a(10^12) = 303963551068, a(10^13) = 3039635509338, a(10^14) = 30396355094469, a(10^15) = 303963550926043, a(10^16) = 3039635509271763, a(10^17) = 30396355092700721, and a(10^18) = 303963550927014110. The limit of a(n)/n is 3/Pi^2. - Charles R Greathouse IV, Nov 04 2017

Examples

			a(4)=2; there are two partitions of 4 into two parts: (3,1) and (2,2). Both of the larger parts are squarefree, thus a(4)=2.
a(5)=1; there are two partitions of 5 into two parts: (4,1) and (3,2). Among the larger parts, only 3 is squarefree, thus a(5)=1.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A262868:=n->add(mobius(n-i)^2, i=1..floor(n/2)): seq(A262868(n), n=1..100);
  • Mathematica
    Table[Sum[MoebiusMu[n - i]^2, {i, Floor[n/2]}], {n, 100}]
    Table[Count[IntegerPartitions[n,{2}][[All,1]],?SquareFreeQ],{n,80}] (* _Harvey P. Dale, Jan 03 2022 *)
  • PARI
    a(n) = sum(i=1, n\2, moebius(n-i)^2); \\ Michel Marcus, Oct 04 2015
    
  • PARI
    f(n)=my(s); forfactored(k=1,sqrtint(n),s+=n\k[1]^2*moebius(k)); s
    a(n)=n--; f(n) - f(n\2) \\ Charles R Greathouse IV, Nov 04 2017

Formula

a(n) = Sum_{i=1..floor(n/2)} mu(n-i)^2, where mu is the Möbius function A008683.
a(n) = A262991(n) - A262869(n).
a(n) ~ 3*n/Pi^2. - Charles R Greathouse IV, Nov 04 2017

A262869 Number of squarefree numbers appearing among the smaller parts of the partitions of n into two parts.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 22, 22, 23, 23
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 03 2015

Keywords

Comments

Number of distinct rectangles with integer length and squarefree width such that L + W = n, W <= L. For example, a(14) = 6; the rectangles are 13 X 1, 12 X 2, 11 X 3, 9 X 5, 8 X 6, 7 X 7. - Wesley Ivan Hurt, Nov 04 2017

Examples

			a(5)=2; there are two partitions of 5 into two parts: (4,1) and (3,2). Both of the smaller parts are squarefree, thus a(5)=2.
a(6)=3; there are three partitions of 6 into two parts: (5,1), (4,2) and (3,3). Among the three smaller parts, all are squarefree, thus a(6)=3.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A262869:=n->add(mobius(i)^2, i=1..floor(n/2)): seq(A262869(n), n=1..100);
  • Mathematica
    Table[Sum[MoebiusMu[i]^2, {i, Floor[n/2]}], {n, 100}]
    Table[Count[IntegerPartitions[n,{2}][[All,2]],?SquareFreeQ],{n,80}] (* _Harvey P. Dale, Oct 17 2021 *)
  • PARI
    a(n) = sum(i=1, n\2, moebius(i)^2); \\ Michel Marcus, Oct 04 2015
    
  • PARI
    a(n)=my(s); n\=2; forsquarefree(k=1, sqrtint(n), s += n\k[1]^2*moebius(k)); s \\ Charles R Greathouse IV, Jan 08 2018

Formula

a(n) = Sum_{i=1..floor(n/2)} mu(i)^2, where mu is the Möebius function (A008683).
a(n) = A262991(n) - A262868(n).
a(n) = A013928(floor(n/2)+1). - Georg Fischer, Nov 29 2022

A262870 Sum of the squarefree numbers appearing among the larger parts of the partitions of n into two parts.

Original entry on oeis.org

0, 1, 2, 5, 3, 8, 11, 18, 18, 18, 23, 34, 28, 41, 48, 63, 63, 80, 80, 99, 89, 110, 121, 144, 144, 144, 157, 157, 143, 172, 187, 218, 218, 251, 268, 303, 303, 340, 359, 398, 398, 439, 460, 503, 481, 481, 504, 551, 551, 551, 551, 602, 576, 629, 629, 684, 684
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 03 2015

Keywords

Examples

			a(4)=5; there are two partitions of 4 into two parts: (3,1) and (2,2). The sum of the larger squarefree parts is 3+2=5, thus a(4)=5.
a(5)=3; there are two partitions of 5 into two parts: (4,1) and (3,2). Of the larger parts, 3 is the only squarefree part, so a(5)=3.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A262870:=n->add((n-i)*mobius(n-i)^2, i=1..floor(n/2)): seq(A262870(n), n=1..100);
  • Mathematica
    Table[Sum[(n - i) MoebiusMu[n - i]^2, {i, Floor[n/2]}], {n, 70}]
  • PARI
    a(n) = sum(i=1, n\2, (n-i) * moebius(n-i)^2); \\ Michel Marcus, Oct 04 2015
    
  • PARI
    a(n)=my(s); forsquarefree(k=(n+1)\2,n-1, s += k[1]); s \\ Charles R Greathouse IV, Jan 08 2018

Formula

a(n) = Sum_{i=1..floor(n/2)} (n-i) * mu(n-i)^2, where mu is the Möebius function (A008683).
a(n) = A262992(n) - A262871(n).

A262871 Sum of the squarefree numbers appearing among the smaller parts of the partitions of n into two parts.

Original entry on oeis.org

0, 1, 1, 3, 3, 6, 6, 6, 6, 11, 11, 17, 17, 24, 24, 24, 24, 24, 24, 34, 34, 45, 45, 45, 45, 58, 58, 72, 72, 87, 87, 87, 87, 104, 104, 104, 104, 123, 123, 123, 123, 144, 144, 166, 166, 189, 189, 189, 189, 189, 189, 215, 215, 215, 215, 215, 215, 244, 244, 274
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 03 2015

Keywords

Examples

			a(5)=3; there are two partitions of 5 into two parts: (4,1) and (3,2). The sum of the smaller squarefree parts is 1+2=3. Thus a(5)=3.
a(6)=6; there are three partitions of 6 into two parts: (5,1), (4,2) and (3,3). All of the smaller parts are squarefree, so a(6) = 1+2+3 = 6.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A262871:=n->add(i*mobius(i)^2, i=1..floor(n/2)): seq(A262871(n), n=1..100);
  • Mathematica
    Table[Sum[i*MoebiusMu[i]^2, {i, Floor[n/2]}], {n, 70}]
  • PARI
    a(n) = sum(i=1, n\2, i * moebius(i)^2); \\ Michel Marcus, Oct 04 2015
    
  • PARI
    a(n)=my(s); forsquarefree(k=1,n\2, s += k[1]); s \\ Charles R Greathouse IV, Jan 08 2018

Formula

a(n) = Sum_{i=1..floor(n/2)} i * mu(i)^2, where mu is the Möebius function (A008683).
a(n) = A262992(n) - A262870(n).
Showing 1-10 of 24 results. Next