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.

Previous Showing 31-40 of 51 results. Next

A350861 Number of solutions to +-1^3 +- 2^3 +- 3^3 +- ... +- n^3 = 0 or 1.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 4, 1, 4, 2, 6, 1, 4, 124, 12, 344, 536, 712, 1140, 713, 4574, 2260, 4384, 5956, 10634, 73758, 48774, 197767, 406032, 638830, 1147500, 1097442, 4249160, 3263500, 6499466, 11844316, 21907736, 82561050, 85185855, 261696060
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 19 2022

Keywords

Examples

			a(12) = 2: +1^3 + 2^3 - 3^3 + 4^3 - 5^3 - 6^3 - 7^3 + 8^3 + 9^3 - 10^3 - 11^3 + 12^3 = -1^3 - 2^3 + 3^3 - 4^3 + 5^3 + 6^3 + 7^3 - 8^3 - 9^3 + 10^3 + 11^3 - 12^3 = 0.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local S,k,x,s;
      S:= mul(1 + x^(2*k^3),k=1..n);
      s:= sum(k^3,k=1..n);
      coeff(S,x,s) + coeff(S,x,s+1)
    end proc:
    map(f, [$0..50]); # Robert Israel, Mar 15 2023
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def b(n, i):
        if n > (i*(i+1)//2)**2: return 0
        if i == 0: return 1
        return b(n+i**3, i-1) + b(abs(n-i**3), i-1)
    def a(n): return b(0, n) + b(1, n)
    print([a(n) for n in range(46)]) # Michael S. Branicky, Jan 19 2022

A359348 Maximal coefficient of (1 + x) * (1 + x^3) * (1 + x^6) * ... * (1 + x^(n*(n+1)/2)).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 4, 5, 7, 12, 18, 27, 44, 73, 122, 210, 362, 620, 1050, 1857, 3290, 5949, 10665, 19086, 34330, 62252, 113643, 209460, 383888, 706457, 1300198, 2407535, 4468367, 8331820, 15525814, 28987902, 54180854, 101560631, 190708871, 358969426
Offset: 0

Views

Author

Seiichi Manyama, Dec 27 2022

Keywords

Examples

			(1 + x) * (1 + x^3) * (1 + x^6) * (1 + x^10) = 1 + x + x^3 + x^4 + x^6 + x^7 + x^9 + 2 * x^10 + x^11 + x^13 + x^14 + x^16 + x^17 + x^19 + x^20. So a(4) = 2.
		

Crossrefs

Programs

  • PARI
    a(n) = vecmax(Vec(prod(k=1, n, 1+x^(k*(k+1)/2))));

Formula

a(n) ~ sqrt(5) * 2^(n + 3/2) / (sqrt(Pi) * n^(5/2)). - Vaclav Kotesovec, Dec 29 2022

A369629 Number of solutions to +- 1^4 +- 2^4 +- 3^4 +- ... +- n^4 = 0 or 1.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 0, 16, 18, 0, 21, 32, 100, 126, 0, 424, 510, 0, 1428, 2792, 5988, 9786, 7, 29058, 45106, 22, 150437, 276828, 473854, 836737, 1838, 2455340, 4777436, 15847, 14696425, 27466324, 46429640, 83010230, 738627
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 28 2024

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from collections import Counter
    def A369629_gen(): # generator of terms
        ccount = Counter({0:1})
        yield 1
        for i in count(1):
            bcount = Counter()
            for a in ccount:
                bcount[a+(j:=i**4)] += ccount[a]
                bcount[a-j] += ccount[a]
            ccount = bcount
            yield(ccount[0]+ccount[1])
    A369629_list = list(islice(A369629_gen(),20)) # Chai Wah Wu, Jan 29 2024

Extensions

a(46)-a(50) from Chai Wah Wu, Jan 29 2024

A342602 Number of solutions to 1 +-* 2 +-* 3 +-* ... +-* n = 0.

Original entry on oeis.org

0, 0, 1, 1, 1, 4, 6, 14, 29, 63, 129, 300, 756, 1677, 4134, 9525, 22841, 57175, 141819, 354992, 882420, 2218078, 5588989, 14173217, 35918542
Offset: 1

Views

Author

Scott R. Shannon, Mar 27 2021

Keywords

Comments

Normal operator precedence is followed, so multiplication is performed before addition or subtraction. Unlike A058377, which uses only addition and subtraction, this sequence has solutions for all values of n >= 3.
The author thanks Ursula Ponting for useful discussions.

Examples

			a(3) = 1 as 1 + 2 - 3 = 0 is the only solution.
a(4) = 1 as 1 - 2 - 3 + 4 = 0 is the only solution.
a(5) = 1 as 1 * 2 - 3 - 4 + 5 = 0 is the only solution. This is the first term where a solution exists while no corresponding solution exists in A058377.
a(6) = 4. The solutions, all of which use multiplication, are
         1 + 2 * 3 + 4 - 5 - 6 = 0,
         1 - 2 + 3 * 4 - 5 - 6 = 0,
         1 - 2 * 3 + 4 - 5 + 6 = 0,
         1 * 2 + 3 - 4 + 5 - 6 = 0.
a(10) = 63. An example solution is
         1 - 2 * 3 * 4 - 5 - 6 - 7 * 8 + 9 * 10 = 0.
a(20) = 354992. An example solution is
         1 * 2 * 3 * 4 * 5 * 6 * 7 + 8 * 9 + 10 * 11 - 12 * 13 + 14 * 15
             - 16 * 17 * 18 - 19 * 20 = 0
  which includes thirteen multiplications.
		

Crossrefs

Cf. A342804 (using +-*/), A342995 (using +-/), A058377 (using +-), A063865, A000217, A025591, A161943.

Programs

  • Mathematica
    Table[Length@Select[Tuples[{"+","-","*"},k-1],ToExpression[""<>Riffle[ToString/@Range@k,#]]==0&],{k,11}] (* Giorgos Kalogeropoulos, Apr 02 2021 *)
  • Python
    from itertools import product
    def a(n):
      nn = [str(i) for i in range(1, n+1)]
      return sum(eval("".join([*sum(zip(nn, ops+("",)), ())])) == 0 for ops in product("+-*", repeat=n-1))
    print([a(n) for n in range(1, 14)]) # Michael S. Branicky, Apr 02 2021

A342995 Number of solutions to 1 +-/ 2 +-/ 3 +-/ ... +-/ n = 0.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 4, 8, 0, 3, 37, 80, 6, 17, 461, 868, 190, 364, 5570, 11342, 3993, 7307, 78644
Offset: 1

Views

Author

Scott R. Shannon, Apr 01 2021

Keywords

Comments

Normal operator precedence is followed, so division is performed before addition or subtraction. Unlike A058377, which uses only addition and subtraction, this sequence has solutions for all values of n >= 10.

Examples

			a(3) = 1 as 1 + 2 - 3 = 0 is the only solution.
a(4) = 1 as 1 - 2 - 3 + 4 = 0 is the only solution.
a(5) = 0, as in A058377.
a(6) = 1 as 1 - 2 / 3 / 4 - 5 / 6 = 0 is the only solution. This is the first term where a solution exists while no corresponding solution exists in A058377.
a(8) = 8. Seven of the solutions involve just addition and subtraction, matching those in A058377, but one additional solution exists using division:
        1 / 2 / 3 / 4 + 5 / 6 - 7 / 8 = 0.
a(10) = 3. All three solutions require division:
        1 + 2 / 3 / 4 + 5 / 6 + 7 - 8 + 9 - 10 = 0,
        1 - 2 / 3 / 4 - 5 / 6 + 7 - 8 - 9 + 10 = 0,
        1 - 2 / 3 / 4 - 5 / 6 - 7 + 8 + 9 - 10 = 0.
a(15) = 461. Of these, 361 use only addition and subtraction, the other 100 also require division. One example of the latter is
        1 / 2 / 3 / 4 - 5 - 6 - 7 / 8 + 9 / 10 + 11 + 12 - 13 + 14 / 15 = 0.
a(20) = 11342. An example solution is
        1 / 2 / 3 - 4 / 5 / 6 + 7 / 8 / 9 + 10 + 11 / 12 - 13 + 14 / 15 / 16
             + 17 / 18 + 19 / 20 = 0
  which sums seven fractions that include eleven divisions.
		

Crossrefs

Cf. A342804 (using +-*/), A342602 (using +-*), A058377 (using +-), A063865, A000217, A025591, A161943.

Programs

  • Mathematica
    Table[Length@Select[Tuples[{"+","-","/"},k-1],ToExpression[""<>Riffle[ToString/@Range@k,#]]==0&],{k,11}] (* Giorgos Kalogeropoulos, Apr 02 2021 *)
  • Python
    from itertools import product
    from fractions import Fraction
    def a(n):
      nn = ["Fraction("+str(i)+", 1)" for i in range(1, n+1)]
      return sum(eval("".join([*sum(zip(nn, ops+("",)), ())])) == 0 for ops in product("+-/", repeat=n-1))
    print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Apr 02 2021

A350403 Number of solutions to +-1^2 +- 2^2 +- 3^2 +- ... +- n^2 = 0 or 1.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 2, 2, 2, 5, 2, 2, 10, 13, 43, 86, 114, 193, 274, 478, 860, 1552, 3245, 5808, 10838, 18628, 31048, 55626, 100426, 188536, 372710, 696164, 1298600, 2376996, 4197425, 7826992, 14574366, 27465147, 53072709, 100061106, 187392994, 351329160
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 29 2021

Keywords

Examples

			a(8) = 2: +1^2 - 2^2 - 3^2 + 4^2 - 5^2 + 6^2 + 7^2 - 8^2 =
          -1^2 + 2^2 + 3^2 - 4^2 + 5^2 - 6^2 - 7^2 + 8^2 = 0.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)*(2*i+1)/6, 0,
          `if`(i=0, 1, b(n+i^2, i-1)+b(abs(n-i^2), i-1)))
        end:
    a:=n-> b(0, n)+b(1, n):
    seq(a(n), n=0..42);  # Alois P. Heinz, Jan 16 2022
  • Mathematica
    b[n_, i_] := b[n, i] = If[n > i*(i + 1)*(2*i + 1)/6, 0,
         If[i == 0, 1, b[n + i^2, i - 1] + b[Abs[n - i^2], i - 1]]];
    a[n_] := b[0, n] + b[1, n];
    Table[a[n], {n, 0, 42}] (* Jean-François Alcover, Mar 01 2022, after Alois P. Heinz *)
  • Python
    from itertools import product
    def a(n):
        if n == 0: return 1
        nn = ["0"] + [str(i)+"**2" for i in range(1, n+1)]
        return sum(eval("".join([*sum(zip(nn, ops+("", )), ())])) in {0, 1} for ops in product("+-", repeat=n))
    print([a(n) for n in range(18)]) # Michael S. Branicky, Jan 16 2022
    
  • Python
    from functools import cache
    @cache
    def b(n, i):
        if n > i*(i+1)*(2*i+1)//6: return 0
        if i == 0: return 1
        return b(n+i**2, i-1) + b(abs(n-i**2), i-1)
    def a(n): return b(0, n) + b(1, n)
    print([a(n) for n in range(43)]) # Michael S. Branicky, Jan 16 2022 after Alois P. Heinz

A369708 Maximal coefficient of (1 + x^3) * (1 + x^5) * (1 + x^7) * ... * (1 + x^prime(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 4, 5, 8, 14, 23, 40, 70, 126, 221, 394, 711, 1290, 2354, 4344, 8015, 14868, 27585, 51094, 95160, 178436, 335645, 634568, 1202236, 2261052, 4267640, 8067296, 15318171, 29031484, 55248527, 105251904, 200711160, 383580180, 733704990
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, 1, expand(b(n-1)*(1+x^ithprime(n)))) end:
    a:= n-> max(coeffs(b(n))):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jan 29 2024
  • Mathematica
    Table[Max[CoefficientList[Product[(1 + x^Prime[k]), {k, 2, n}], x]], {n, 0, 40}]
  • PARI
    a(n) = vecmax(Vec(prod(i=2, n, 1+x^prime(i)))); \\ Michel Marcus, Jan 29 2024
    
  • Python
    from collections import Counter
    from sympy import prime
    def A369708(n):
        c = {0:1}
        for i in range(2,n+1):
            p, d = prime(i), Counter(c)
            for k in c:
                d[k+p] += c[k]
            c = d
        return max(c.values()) # Chai Wah Wu, Jan 31 2024

A369712 Maximal coefficient of (1 + x) * (1 + x^2)^2 * (1 + x^3)^3 * ... * (1 + x^n)^n.

Original entry on oeis.org

1, 1, 2, 9, 79, 1702, 78353, 7559080, 1509040932, 619097417818, 519429629728698, 887531129680197018, 3078434842626707386602, 21627792113204714623569767, 307257554772242590850211062866, 8813577747274880345454470354985336, 509819403352972623999938010230619997952
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, expand(b(n-1)*(1+x^n)^n)) end:
    a:= n-> max(coeffs(b(n))):
    seq(a(n), n=0..16);  # Alois P. Heinz, Jan 29 2024
  • Mathematica
    Table[Max[CoefficientList[Product[(1 + x^k)^k, {k, 1, n}], x]], {n, 0, 16}]
  • PARI
    a(n) = vecmax(Vec(prod(k=1, n, (1+x^k)^k))); \\ Michel Marcus, Jan 30 2024

A350287 Number of solutions to +-1 +- 3 +- 6 +- 10 +- ... +- n*(n + 1)/2 = 0 or 1.

Original entry on oeis.org

1, 1, 0, 0, 2, 1, 2, 2, 4, 7, 12, 16, 26, 42, 66, 104, 210, 318, 620, 970, 1748, 3281, 5948, 10480, 18976, 34233, 60836, 111430, 209460, 378529, 704934, 1284836, 2387758, 4466874, 8331820, 15525814, 28987902, 54162165, 101242982, 190267598, 358969426, 674845081
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 19 2022

Keywords

Examples

			a(4) = 2: -1 - 3 - 6 + 10 = +1 + 3 + 6 - 10 = 0.
		

Crossrefs

Programs

  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def b(n, i):
        if n > i*(i+1)*(i+2)//6: return 0
        if i == 0: return 1
        return b(n+i*(i+1)//2, i-1) + b(abs(n-i*(i+1)//2), i-1)
    def a(n): return b(0, n) + b(1, n)
    print([a(n) for n in range(41)]) # Michael S. Branicky, Jan 19 2022

A350504 Maximal coefficient of (1 + x) * (1 + x^3) * (1 + x^5) * ... * (1 + x^(2*n-1)).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 5, 8, 13, 22, 38, 68, 118, 211, 380, 692, 1262, 2316, 4277, 7930, 14745, 27517, 51541, 96792, 182182, 343711, 650095, 1231932, 2338706, 4447510, 8472697, 16164914, 30884150, 59086618, 113189168, 217091832, 416839177, 801247614, 1541726967, 2969432270
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 28 2022

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1,
          expand((1+x^(2*n-1))*b(n-1)))
        end:
    a:= n-> max(coeffs(b(n))):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jan 28 2022
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, Expand[(1 + x^(2*n - 1))*b[n - 1]]];
    a[n_] := Max[CoefficientList[b[n], x]];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Mar 01 2022, after Alois P. Heinz *)
  • PARI
    a(n) = vecmax(Vec(prod(k=1, n, 1+x^(2*k-1)))); \\ Seiichi Manyama, Jan 28 2021

Formula

a(n) ~ sqrt(3) * 2^(n - 1/2) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Feb 04 2022
Previous Showing 31-40 of 51 results. Next