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 51-60 of 64 results. Next

A347664 Number of partitions of n into at most 6 nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 2, 4, 5, 6, 6, 9, 9, 12, 12, 17, 17, 23, 23, 31, 31, 40, 39, 53, 54, 68, 68, 88, 87, 111, 110, 138, 140, 174, 172, 216, 216, 262, 264, 324, 321, 391, 392, 470, 475, 567, 563, 676, 679, 798, 806, 949, 949, 1116, 1120, 1300, 1316, 1523
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 10 2021

Keywords

Crossrefs

A355158 Number of partitions of n that contain more nonprime parts than prime parts.

Original entry on oeis.org

0, 1, 1, 1, 3, 4, 5, 8, 12, 16, 24, 29, 42, 57, 74, 97, 132, 165, 217, 279, 355, 453, 576, 717, 908, 1135, 1408, 1751, 2169, 2664, 3283, 4022, 4909, 5990, 7282, 8814, 10681, 12885, 15506, 18643, 22362, 26739, 31970, 38100, 45340, 53878, 63908, 75639, 89476, 105580, 124445
Offset: 0

Views

Author

Omar E. Pol, Jun 24 2022

Keywords

Examples

			For n = 8 the partitions of 8 that contain more nonprime parts than prime parts are [8], [4, 4], [4, 3, 1], [6, 1, 1], [4, 2, 1, 1], [5, 1, 1, 1], [3, 2, 1, 1, 1], [4, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1], [3, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]. There are 12 of these partitions so a(8) = 12.
		

Crossrefs

Programs

  • PARI
    a(n) = my(nb=0); forpart(p=n, if (#select(x->!isprime(x), Vec(p)) > #p/2, nb++)); nb; \\ Michel Marcus, Jun 25 2022
    
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import partitions
    def c(p): return 2*sum(p[i] for i in p if not isprime(i)) > sum(p.values())
    def a(n): return sum(1 for p in partitions(n) if c(p))
    print([a(n) for n in range(51)]) # Michael S. Branicky, Jun 28 2022

Formula

a(n) = A000041(n) - A155515(n) - A355225(n).
a(n) = A355306(n) - A355225(n).

Extensions

More terms from Michel Marcus, Jun 25 2022

A355225 Number of partitions of n that contain more prime parts than nonprime parts.

Original entry on oeis.org

0, 0, 1, 1, 1, 3, 3, 5, 7, 9, 14, 19, 23, 34, 46, 56, 77, 99, 126, 164, 208, 260, 336, 416, 520, 654, 809, 995, 1237, 1514, 1856, 2274, 2761, 3354, 4078, 4918, 5931, 7153, 8572, 10272, 12298, 14663, 17469, 20787, 24643, 29210, 34568, 40797, 48113, 56664, 66573
Offset: 0

Views

Author

Omar E. Pol, Jun 24 2022

Keywords

Examples

			For n = 8 the partitions of 8 that contain more prime parts than nonprime parts are [5, 3], [3, 3, 2], [4, 2, 2], [2, 2, 2, 2], [5, 2, 1], [3, 2, 2, 1], [2, 2, 2, 1, 1]. There are seven of these partitions so a(8) = 7.
		

Crossrefs

Programs

  • PARI
    a(n) = my(nb=0); forpart(p=n, if (#select(isprime, Vec(p)) > #p/2, nb++)); nb; \\ Michel Marcus, Jun 25 2022
    
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import partitions
    def c(p): return 2*sum(p[i] for i in p if isprime(i)) > sum(p.values())
    def a(n): return sum(1 for p in partitions(n) if c(p))
    print([a(n) for n in range(51)]) # Michael S. Branicky, Jun 28 2022

Formula

a(n) = A000041(n) - A155515(n) - A355158(n).
a(n) = A355306(n) - A355158(n).

Extensions

More terms from Alois P. Heinz, Jun 24 2022

A379313 Positive integers whose prime indices are not all composite.

Original entry on oeis.org

2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82
Offset: 1

Views

Author

Gus Wiseman, Dec 28 2024

Keywords

Comments

Or, positive integers whose prime indices include at least one 1 or prime number.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The terms together with their prime indices begin:
     2: {1}
     3: {2}
     4: {1,1}
     5: {3}
     6: {1,2}
     8: {1,1,1}
     9: {2,2}
    10: {1,3}
    11: {5}
    12: {1,1,2}
    14: {1,4}
    15: {2,3}
    16: {1,1,1,1}
    17: {7}
    18: {1,2,2}
    20: {1,1,3}
    21: {2,4}
    22: {1,5}
    24: {1,1,1,2}
		

Crossrefs

Partitions of this type are counted by A000041 - A023895.
The "old" primes are listed by A008578.
For no composite parts we have A302540, counted by A034891 (strict A036497).
The complement is A320629, counted by A023895 (strict A204389).
For a unique prime we have A331915, counted by A379304 (strict A379305).
Positions of nonzeros in A379311.
For a unique 1 or prime we have A379312, counted by A379314 (strict A379315).
A000040 lists the prime numbers, differences A001223.
A002808 lists the composite numbers, nonprimes A018252, differences A073783 or A065310.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A080339 is the characteristic function for the old prime numbers.
A376682 gives k-th differences of old prime numbers, see A030016, A075526.
A377033 gives k-th differences of composite numbers, see A073445, A377034.
Other counts of prime indices:
- A330944 nonprime, see A002095, A096258, A320628, A330945.
- A379306 squarefree, see A302478, A379308, A379309, A379316.
- A379310 nonsquarefree, see A114374, A256012, A379307.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],!And@@CompositeQ/@prix[#]&]

A280287 Number of partitions of n into distinct odd composite numbers (A071904).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Dec 31 2016

Keywords

Examples

			a(48) = 3 because we have [39, 9], [33, 15] and [27, 21].
		

Crossrefs

Programs

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

Formula

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

A303663 Expansion of (1/(1 - x))*Product_{k>=1} (1 - x^prime(k))/(1 - x^k).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 11, 14, 19, 25, 33, 41, 53, 66, 83, 102, 128, 156, 193, 233, 285, 343, 416, 495, 597, 710, 849, 1003, 1194, 1404, 1662, 1946, 2291, 2675, 3137, 3646, 4260, 4939, 5744, 6637, 7697, 8868, 10250, 11778, 13570, 15558, 17877, 20437, 23423, 26727, 30550, 34781, 39669, 45068, 51287, 58157
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 28 2018

Keywords

Comments

Partial sums of A002095.
Number of partitions of n into nonprime parts if there are two kinds of 1's.

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=1, n+1,
          b(n, i-1)+`if`(isprime(i), 0, b(n-i, min(n-i, i))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..60);  # Alois P. Heinz, Apr 28 2018
  • Mathematica
    nmax = 55; CoefficientList[Series[1/(1 - x) Product[(1 - x^Prime[k])/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x]

A331917 Number of compositions (ordered partitions) of n into distinct nonprime parts.

Original entry on oeis.org

1, 1, 0, 0, 1, 2, 1, 2, 1, 3, 5, 8, 3, 10, 11, 17, 13, 16, 19, 54, 49, 55, 59, 90, 89, 129, 127, 183, 307, 358, 351, 456, 553, 649, 889, 1015, 1143, 1490, 2219, 1913, 3021, 3394, 4241, 4944, 6663, 6859, 9337, 9522, 12123, 14895, 22425, 18849, 28341, 31468, 41533
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 01 2020

Keywords

Examples

			a(10) = 5 because we have [10], [9, 1], [6, 4], [4, 6] and [1, 9].
		

Crossrefs

A339395 Number of partitions of n into an even number of nonprime parts.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 2, 2, 3, 4, 4, 6, 7, 8, 10, 13, 14, 19, 20, 26, 29, 36, 40, 51, 56, 70, 76, 96, 105, 129, 143, 172, 192, 231, 254, 308, 339, 402, 447, 529, 586, 691, 764, 896, 993, 1159, 1281, 1493, 1652, 1912, 2114, 2445, 2699, 3110, 3436, 3939, 4356, 4982, 5497, 6280
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 02 2020

Keywords

Examples

			a(9) = 3 because we have [8, 1], [6, 1, 1, 1] and [4, 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.

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.

A373446 Number of distinct ways of expressing n using only addition, multiplication (with all factors greater than 1), necessary parentheses, and the number 1.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 6, 7, 10, 10, 18, 19, 27, 30, 50, 53, 80, 85, 133, 146, 209, 223, 350, 382, 544, 597, 886, 962, 1385, 1507, 2197, 2426, 3422, 3740, 5413, 5941, 8295, 9159, 12994, 14298, 19947, 21982, 30763, 34111, 47005, 51895, 72202, 79974, 109468, 121545, 167032, 185276, 252534, 280427, 382274, 425703, 575650, 640243, 867942
Offset: 1

Views

Author

Daniel W. Grace, Jun 05 2024

Keywords

Comments

Expressions that are the same after commuting their terms are not considered distinct from one another.
Parentheses are used around a sum which is being multiplied, but not otherwise.

Examples

			a(10)=10, as 10 can be expressed in the following ways:
  1+1+1+1+1+1+1+1+1+1
  (1+1)*(1+1)+1+1+1+1+1+1
  (1+1)*(1+1)+(1+1)*(1+1)+1+1
  (1+1)*(1+1)*(1+1)+1+1
  (1+1)*(1+1+1)+1+1+1+1
  (1+1)*(1+1+1)+(1+1)*(1+1)
  (1+1)*(1+1+1+1)+1+1
  (1+1+1)*(1+1+1)+1
  (1+1)*(1+1+1+1+1)
  (1+1)*((1+1)*(1+1)+1).
		

Crossrefs

Programs

  • Python
    from itertools import count,islice
    from collections import Counter
    from math import comb
    from sympy import divisors
    def euler_transform(x):
        xlist = []
        z = []
        y = []
        for n,x in enumerate(x,1):
            xlist.append(x)
            z.append(sum(d*xlist[d-1] for d in divisors(n)))
            yy = (z[-1]+sum(zz*yy for zz,yy in zip(z,reversed(y))))//n
            yield yy
            y.append(yy)
    def factorizations(n,fmin=2):
        if n == 1:
            yield []
            return
        for d in divisors(n,generator=True):
            if d < fmin: continue
            for f in factorizations(n//d,d):
                yield [d]+f
    def A373446_generator():
        alist = []
        def bgen():
            blist = []
            for n in count(1):
                b = 0
                for p in factorizations(n):
                    if len(p) == 1: continue
                    m = 1
                    for k,c in Counter(p).items():
                        m *= comb(alist[k-1]-blist[k-1]+c-1,c)
                    b += m
                yield b
                blist.append(b)
        for a in euler_transform(bgen()):
            yield a
            alist.append(a)
    print(list(islice(A373446_generator(),60))) # Pontus von Brömssen, Jun 13 2024

Formula

a(n) >= a(n-1) since, if "+1" is appended to each expression used to calculate a(n-1), then each of the resulting expressions equate to n and are distinct from each other. There may or may not be other ways to express n that do not include an isolated "+1", hence the greater-than possibility.
Previous Showing 51-60 of 64 results. Next