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-5 of 5 results.

A339380 Number of partitions of n into an even number of primes (counting 1 as a prime).

Original entry on oeis.org

1, 0, 1, 1, 3, 2, 5, 4, 9, 7, 14, 11, 22, 18, 33, 27, 48, 40, 69, 58, 97, 82, 134, 114, 183, 157, 246, 212, 327, 284, 431, 376, 562, 493, 728, 640, 934, 825, 1191, 1056, 1508, 1341, 1899, 1694, 2377, 2126, 2960, 2654, 3668, 3297, 4523, 4075, 5554, 5015, 6792, 6145
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 02 2020

Keywords

Examples

			a(6) = 5 because we have [5, 1], [3, 3], [3, 1, 1, 1], [2, 2, 1, 1] and [1, 1, 1, 1, 1, 1].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; (p->
          `if`(n=0, t, `if`(i<0, 0, b(n, i-1, t)+
          `if`(p>n, 0, b(n-p, i, 1-t)))))(`if`(i<1, 1, ithprime(i)))
        end:
    a:= n-> b(n, numtheory[pi](n), 1):
    seq(a(n), n=0..60);  # Alois P. Heinz, Dec 02 2020
  • Mathematica
    nmax = 55; CoefficientList[Series[(1/2) ((1/(1 - x)) Product[1/(1 - x^Prime[k]), {k, 1, nmax}] + (1/(1 + x)) Product[1/(1 + x^Prime[k]), {k, 1, nmax}]), {x, 0, nmax}], x]
    Table[Count[(Boole[PrimeQ/@(IntegerPartitions[n]/.(1->2))]),?(EvenQ[Length[#]] && FreeQ[ #,0]&)],{n,0,60}] (* _Harvey P. Dale, Aug 20 2024 *)

Formula

G.f.: (1/2) * ((1/(1 - x)) * Product_{k>=1} 1 / (1 - x^prime(k)) + (1/(1 + x)) * Product_{k>=1} 1 / (1 + x^prime(k))).
a(n) = (A034891(n) + A338826(n)) / 2.

A339382 Number of partitions of n into an even number of distinct primes (counting 1 as a prime).

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 3, 3, 4, 4, 4, 4, 6, 5, 5, 5, 6, 6, 7, 7, 9, 8, 9, 8, 11, 10, 11, 12, 14, 12, 15, 14, 17, 16, 17, 17, 22, 20, 22, 21, 25, 24, 28, 27, 31, 30, 33, 31, 39, 36, 40, 40, 46, 42, 49, 47, 54, 53, 58, 55, 67, 63, 70, 68
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 02 2020

Keywords

Examples

			a(16) = 3 because we have [13, 3], [11, 5] and [7, 5, 3, 1].
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
          `if`(n<1, n+1, ithprime(n)+s(n-1))
        end:
    b:= proc(n, i, t) option remember; (p-> `if`(n=0, t,
          `if`(n>s(i), 0, b(n, i-1, t)+ `if`(p>n, 0,
           b(n-p, i-1, 1-t)))))(`if`(i<1, 1, ithprime(i)))
        end:
    a:= n-> b(n, numtheory[pi](n), 1):
    seq(a(n), n=0..100);  # Alois P. Heinz, Dec 02 2020
  • Mathematica
    nmax = 75; CoefficientList[Series[(1/2) ((1 + x) Product[(1 + x^Prime[k]), {k, 1, nmax}] + (1 - x) Product[(1 - x^Prime[k]), {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: (1/2) * ((1 + x) * Product_{k>=1} (1 + x^prime(k)) + (1 - x) * Product_{k>=1} (1 - x^prime(k))).
a(n) = (A036497(n) + A298602(n)) / 2.

A339383 Number of partitions of n into an odd number of distinct primes (counting 1 as a prime).

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 6, 6, 5, 7, 6, 8, 7, 8, 9, 10, 9, 12, 11, 12, 11, 14, 14, 16, 15, 17, 17, 20, 17, 21, 22, 24, 22, 27, 25, 30, 28, 31, 31, 36, 33, 40, 39, 42, 40, 47, 46, 53, 49, 55, 54, 63, 58, 68, 67, 73
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 02 2020

Keywords

Examples

			a(21) = 4 because we have [17, 3, 1], [13, 7, 1], [13, 5, 3] and [11, 7, 3].
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
          `if`(n<1, n+1, ithprime(n)+s(n-1))
        end:
    b:= proc(n, i, t) option remember; (p-> `if`(n=0, t,
          `if`(n>s(i), 0, b(n, i-1, t)+ `if`(p>n, 0,
           b(n-p, i-1, 1-t)))))(`if`(i<1, 1, ithprime(i)))
        end:
    a:= n-> b(n, numtheory[pi](n), 0):
    seq(a(n), n=0..100);  # Alois P. Heinz, Dec 02 2020
  • Mathematica
    nmax = 75; CoefficientList[Series[(1/2) ((1 + x) Product[(1 + x^Prime[k]), {k, 1, nmax}] - (1 - x) Product[(1 - x^Prime[k]), {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: (1/2) * ((1 + x) * Product_{k>=1} (1 + x^prime(k)) - (1 - x) * Product_{k>=1} (1 - x^prime(k))).
a(n) = (A036497(n) - A298602(n)) / 2.

A339409 Number of compositions (ordered partitions) of n into an odd number of primes.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 1, 4, 3, 4, 7, 12, 19, 22, 32, 53, 80, 120, 160, 245, 368, 553, 800, 1164, 1736, 2588, 3813, 5598, 8226, 12228, 18060, 26657, 39221, 57945, 85656, 126506, 186584, 275307, 406514, 600488, 886255, 1308088, 1930648, 2850861, 4208743, 6212824, 9170440, 13538025
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 03 2020

Keywords

Examples

			a(8) = 3 because we have [3, 3, 2], [3, 2, 3] and [2, 3, 3].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, t, add(
          b(n-ithprime(j), 1-t), j=1..numtheory[pi](n)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..55);  # Alois P. Heinz, Dec 03 2020
  • Mathematica
    nmax = 47; CoefficientList[Series[(1/2) (1/(1 - Sum[x^Prime[k], {k, 1, nmax}]) - 1/(1 + Sum[x^Prime[k], {k, 1, nmax}])), {x, 0, nmax}], x]

Formula

G.f.: (1/2) * (1 / (1 - Sum_{k>=1} x^prime(k)) - 1 / (1 + Sum_{k>=1} x^prime(k))).

A339396 Number of partitions of n into an odd number of nonprime parts.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 2, 1, 3, 3, 4, 4, 6, 6, 9, 9, 13, 14, 18, 20, 26, 29, 37, 39, 51, 57, 69, 78, 95, 105, 129, 141, 173, 192, 231, 255, 306, 340, 403, 446, 531, 585, 691, 764, 896, 995, 1160, 1279, 1493, 1652, 1911, 2117, 2443, 2700, 3109, 3434, 3941, 4357, 4983, 5496, 6277
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 02 2020

Keywords

Examples

			a(9) = 3 because we have [9], [4, 4, 1] and [1, 1, 1, 1, 1, 1, 1, 1, 1].
		

Crossrefs

Programs

  • Mathematica
    nmax = 60; CoefficientList[Series[(1/2) (Product[(1 - x^Prime[k])/(1 - x^k), {k, 1, nmax}] - Product[(1 + x^Prime[k])/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: (1/2) * (Product_{k>=1} (1 - x^prime(k)) / (1 - x^k) - Product_{k>=1} (1 + x^prime(k)) / (1 + x^k)).
a(n) = (A002095(n) - A302236(n)) / 2.
Showing 1-5 of 5 results.