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

A192541 A046676(n) - A000607(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 2, 1, 2, 1, 2, 2, 3, 2, 4, 2, 5, 4, 5, 5, 7, 6, 8, 8, 11, 10, 14, 13, 19, 18, 24, 25, 32, 33, 42, 45, 55, 60, 72, 77, 94, 102, 120, 132, 155, 169, 196, 218, 249, 275, 315, 346, 395, 435, 492, 542, 613, 673, 756, 833, 931, 1024, 1143, 1253, 1397, 1532, 1699, 1864, 2063, 2258, 2496
Offset: 0

Views

Author

N. J. A. Sloane, Jul 03 2011

Keywords

Comments

See A046676 for explanations and further references. - M. F. Hasler, Mar 05 2014

Crossrefs

Programs

A319266 Indices of primes in sequence A000607.

Original entry on oeis.org

5, 6, 7, 8, 10, 12, 17, 18, 19, 27, 34, 36, 46, 48, 64, 65, 72, 73, 76, 86, 103, 106, 118, 125, 133, 153, 156, 159, 178, 201, 259, 263, 266, 270, 284, 295, 306, 307, 318, 352, 388, 406, 513, 515, 528, 542, 548, 620, 653, 669, 673, 743, 747, 770, 795, 823, 839
Offset: 1

Views

Author

Vaclav Kotesovec, Sep 16 2018

Keywords

Examples

			12 is in the sequence because A000607(12) = 7 is prime.
		

Crossrefs

A319265 Numbers k such that A000607(k) is divisible by k.

Original entry on oeis.org

1, 17, 29, 35, 2092, 3227, 3236, 66607
Offset: 1

Views

Author

Vaclav Kotesovec, Sep 16 2018

Keywords

Comments

No other terms below 2000000. - Vaclav Kotesovec, Oct 10 2018

Examples

			29 is in the sequence because A000607(29) = 3 * 29.
2092 is in the sequence because A000607(2092) = 727374912588703256255 * 2092.
		

Crossrefs

A001414 Integer log of n: sum of primes dividing n (with repetition). Also called sopfr(n).

Original entry on oeis.org

0, 2, 3, 4, 5, 5, 7, 6, 6, 7, 11, 7, 13, 9, 8, 8, 17, 8, 19, 9, 10, 13, 23, 9, 10, 15, 9, 11, 29, 10, 31, 10, 14, 19, 12, 10, 37, 21, 16, 11, 41, 12, 43, 15, 11, 25, 47, 11, 14, 12, 20, 17, 53, 11, 16, 13, 22, 31, 59, 12, 61, 33, 13, 12, 18, 16, 67, 21, 26, 14, 71, 12, 73, 39, 13, 23, 18, 18
Offset: 1

Views

Author

Keywords

Comments

MacMahon calls this the potency of n.
Downgrades the operators in a prime decomposition. E.g., 40 factors as 2^3 * 5 and sopfr(40) = 2 * 3 + 5 = 11.
Consider all ways of writing n as a product of zero, one, or more factors; sequence gives smallest sum of terms. - Amarnath Murthy, Jul 07 2001
a(n) <= n for all n, and a(n) = n iff n is 4 or a prime.
Look at the graph of this sequence. At the lower edge of the logarithmic scatterplot there is a set of fuzzy but unmistakable diagonal fringes, sloping toward the southeast. Their spacing gradually increases, and their slopes gradually decrease; they are more distinct toward the lower edge of the range. Is any explanation known? - Allan C. Wechsler, Oct 11 2015
For n >= 2, the glb and lub are: 3 * log(n) / log(3) <= a(n) <= n, where the lub occurs when n = 3^k, k >= 1. (Jakimczuk 2012) - Daniel Forgues, Oct 12 2015
Except for the initial term, row sums of A027746. - M. F. Hasler, Feb 08 2016
Atanassov proves that a(n) <= A065387(n) - n. - Charles R Greathouse IV, Dec 06 2016
From Robert G. Wilson v, Aug 15 2022: (Start)
Differs from A337310 beginning with n at 64, 192, 256, 320, 448, 512, ..., .
The number of terms which equal k is A000607(k).
The first occurrence of k>1 is A056240(k).
The last occurrence of k>1 is A000792(k).
The Amarnath Murthy comment of Jul 07 2001 is a result of the fundamental theorem of arithmetic.
(End)

Examples

			a(24) = 2+2+2+3 = 9.
a(30) = 10: 30 can be written as 30, 15*2, 10*3, 6*5, 5*3*2. The corresponding sums are 30, 17, 13, 11, 10. Among these 10 is the least.
		

References

  • K. Atanassov, New integer functions, related to ψ and σ functions. IV., Bull. Number Theory Related Topics 12 (1988), pp. 31-35.
  • Amarnath Murthy, Generalization of Partition function and introducing Smarandache Factor Partition, Smarandache Notions Journal, Vol. 11, 1-2-3, Spring-2000.
  • Amarnath Murthy and Charles Ashbacher, Generalized Partitions and Some New Ideas on Number Theory and Smarandache Sequences, Hexis, Phoenix; USA 2005. See Section 1.4.
  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 89.
  • 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).

Crossrefs

A000607(n) gives the number of values of k for which A001414(k) = n.
Cf. A036349 (indices of even terms), A356163 (their char. function), A335657 (indices of odd terms), A289142 (of multiples of 3), A373371 (their char. function).
For sum of squares of prime factors see A067666, for cubes see A224787.
Other completely additive sequences with primes p mapped to a function of p include: A001222 (with a(p)=1), A056239 (with a(p)=primepi(p)), A059975 (with a(p)=p-1), A064097 (with a(p)=1+a(p-1)), A113177 (with a(p)=Fib(p)), A276085 (with a(p)=p#/p), A341885 (with a(p)=p*(p+1)/2), A373149 (with a(p)=prevprime(p)), A373158 (with a(p)=p#).
For other completely additive sequences see the cross-references in A104244.

Programs

  • Haskell
    a001414 1 = 0
    a001414 n = sum $ a027746_row n
    -- Reinhard Zumkeller, Feb 27 2012, Nov 20 2011
    
  • Magma
    [n eq 1 select 0 else (&+[j[1]*j[2]: j in Factorization(n)]): n in [1..100]]; // G. C. Greubel, Jan 10 2019
  • Maple
    A001414 := proc(n) add( op(1,i)*op(2,i),i=ifactors(n)[2]) ; end proc:
    seq(A001414(n), n=1..100); # Peter Luschny, Jan 17 2011
  • Mathematica
    a[n_] := Plus @@ Times @@@ FactorInteger@ n; a[1] = 0; Array[a, 78] (* Ray Chandler, Nov 12 2005 *)
  • PARI
    a(n)=local(f); if(n<1,0,f=factor(n); sum(k=1,matsize(f)[1],f[k,1]*f[k,2]))
    
  • PARI
    A001414(n) = (n=factor(n))[,1]~*n[,2] \\ M. F. Hasler, Feb 07 2009
    
  • Python
    from sympy import factorint
    def A001414(n):
        return sum(p*e for p,e in factorint(n).items()) # Chai Wah Wu, Jan 08 2016
    
  • Sage
    [sum(factor(n)[j][0]*factor(n)[j][1] for j in range(0,len(factor(n)))) for n in range(1,79)] # Giuseppe Coppoletta, Jan 19 2015
    

Formula

If n = Product p_j^k_j then a(n) = Sum p_j * k_j.
Dirichlet g.f. f(s)*zeta(s), where f(s) = Sum_{p prime} p/(p^s-1) = Sum_{k>0} primezeta(k*s-1) is the Dirichlet g.f. for A120007. Totally additive with a(p^e) = p*e. - Franklin T. Adams-Watters, Jun 02 2006
For n > 1: a(n) = Sum_{k=1..A001222(n)} A027746(n,k). - Reinhard Zumkeller, Aug 27 2011
Sum_{n>=1} (-1)^a(n)/n^s = ((2^s + 1)/(2^s - 1))*zeta(2*s)/zeta(s), if Re(s)>1 and 0 if s=1 (Alladi and Erdős, 1977). - Amiram Eldar, Nov 02 2020
a(n) >= k*log(n), where k = 3/log(3). This bound is sharp. - Charles R Greathouse IV, Jul 28 2025

A007504 Sum of the first n primes.

Original entry on oeis.org

0, 2, 5, 10, 17, 28, 41, 58, 77, 100, 129, 160, 197, 238, 281, 328, 381, 440, 501, 568, 639, 712, 791, 874, 963, 1060, 1161, 1264, 1371, 1480, 1593, 1720, 1851, 1988, 2127, 2276, 2427, 2584, 2747, 2914, 3087, 3266, 3447, 3638, 3831, 4028, 4227, 4438, 4661, 4888
Offset: 0

Views

Author

Keywords

Comments

It appears that a(n)^2 - a(n-1)^2 = A034960(n). - Gary Detlefs, Dec 20 2011
This is true. Proof: By definition we have A034960(n) = Sum_{k = (a(n-1)+1)..a(n)} (2*k-1). Since Sum_{k = 1..n} (2*k-1) = n^2, it follows A034960(n) = a(n)^2 - a(n-1)^2, for n > 1. - Hieronymus Fischer, Sep 27 2012 [formulas above adjusted to changed offset of A034960 - Hieronymus Fischer, Oct 14 2012]
Row sums of the triangle in A037126. - Reinhard Zumkeller, Oct 01 2012
Ramanujan noticed the apparent identity between the prime parts partition numbers A000607 and the expansion of Sum_{k >= 0} x^a(k)/((1-x)...(1-x^k)), cf. A046676. See A192541 for the difference between the two. - M. F. Hasler, Mar 05 2014
For n > 0: row 1 in A254858. - Reinhard Zumkeller, Feb 08 2015
a(n) is the smallest number that can be partitioned into n distinct primes. - Alonso del Arte, May 30 2017
For a(n) < m < a(n+1), n > 0, at least one m is a perfect square.
Proof: For n = 1, 2, ..., 6, the proposition is clear. For n > 6, a(n) < ((prime(n) - 1)/2)^2, set (k - 1)^2 <= a(n) < k^2 < ((prime(n) + 1)/2)^2, then k^2 < (k - 1)^2 + prime(n) <= a(n) + prime(n) = a(n+1), so m = k^2 is this perfect square. - Jinyuan Wang, Oct 04 2018
For n >= 5 we have a(n) < ((prime(n)+1)/2)^2. This can be shown by noting that ((prime(n)+1)/2)^2 - ((prime(n-1)+1)/2)^2 - prime(n) = (prime(n)+prime(n-1))*(prime(n)-prime(n-1)-2)/4 >= 0. - Jianing Song, Nov 13 2022
Washington gives an oscillation formula for |a(n) - pi(n^2)|, see links. - Charles R Greathouse IV, Dec 07 2022

References

  • E. Bach and J. Shallit, §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms, MIT Press, Cambridge, MA, 1996.
  • H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A122989 for the value of Sum_{n >= 1} 1/a(n).

Programs

  • GAP
    P:=Filtered([1..250],IsPrime);;
    a:=Concatenation([0],List([1..Length(P)],i->Sum([1..i],k->P[k]))); # Muniru A Asiru, Oct 07 2018
    
  • Haskell
    a007504 n = a007504_list !! n
    a007504_list = scanl (+) 0 a000040_list
    -- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
    
  • Magma
    [0] cat [&+[ NthPrime(k): k in [1..n]]: n in [1..50]]; // Bruno Berselli, Apr 11 2011 (adapted by Vincenzo Librandi, Nov 27 2015 after Hasler's change on Mar 05 2014)
    
  • Maple
    s1:=[2]; for n from 2 to 1000 do s1:=[op(s1),s1[n-1]+ithprime(n)]; od: s1;
    A007504 := proc(n)
        add(ithprime(i), i=1..n) ;
    end proc: # R. J. Mathar, Sep 20 2015
  • Mathematica
    Accumulate[Prime[Range[100]]] (* Zak Seidov, Apr 10 2011 *)
    primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* Zak Seidov, Apr 16 2011 *)
  • PARI
    A007504(n) = sum(k=1,n,prime(k)) \\ Michael B. Porter, Feb 26 2010
    
  • PARI
    a(n) = vecsum(primes(n)); \\ Michel Marcus, Feb 06 2021
    
  • Python
    from itertools import accumulate, count, islice
    from sympy import prime
    def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0))
    A007504_list = list(islice(A007504_gen(),20)) # Chai Wah Wu, Feb 23 2022

Formula

a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996)
a(n) = A014284(n+1) - 1. - Jaroslav Krizek, Aug 19 2009
a(n+1) - a(n) = A000040(n+1). - Jaroslav Krizek, Aug 19 2009
a(A051838(n)) = A002110(A051838(n)) / A116536(n). - Reinhard Zumkeller, Oct 03 2011
a(n) = min(A068873(n), A073619(n)) for n > 1. - Jonathan Sondow, Jul 10 2012
a(n) = A033286(n) - A152535(n). - Omar E. Pol, Aug 09 2012
For n >= 3, a(n) >= (n-1)^2 * (log(n-1) - 1/2)/2 and a(n) <= n*(n+1)*(log(n) + log(log(n))+ 1)/2. Thus a(n) = n^2 * log(n) / 2 + O(n^2*log(log(n))). It is more precise than in Fares's comment. - Vladimir Shevelev, Aug 01 2013
a(n) = (n^2/2)*(log n + log log n - 3/2 + (log log n - 3)/log n + (2 (log log n)^2 - 14 log log n + 27)/(4 log^2 n) + O((log log n/log n)^3)) [Sinha]. - Charles R Greathouse IV, Jun 11 2015
G.f: (x*b(x))/(1-x), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 10 2016
a(n) = A008472(A002110(n)), for n > 0. - Michel Marcus, Jul 16 2020

Extensions

More terms from Stefan Steinerberger, Apr 11 2006
a(0) = 0 prepended by M. F. Hasler, Mar 05 2014

A316524 Signed sum over the prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 05 2018

Keywords

Comments

If n = prime(x_1) * prime(x_2) * prime(x_3) * ... * prime(x_k) then a(n) = x_1 - x_2 + x_3 - ... + (-1)^(k-1) x_k, where the x_i are weakly increasing positive integers.
The value of a(n) depends only on the squarefree part of n, A007913(n). - Antti Karttunen, May 06 2022

Crossrefs

Cf. A027746, A112798, A119899 (positions of negative terms).
Cf. A344616 (absolute values), A344617 (signs).

Programs

  • Mathematica
    Table[Sum[Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]][[k]]*(-1)^(k-1),{k,PrimeOmega[n]}],{n,100}]
  • PARI
    a(n) = {my(f = factor(n), vp = []); for (k=1, #f~, for( j=1, f[k,2], vp = concat (vp, primepi(f[k,1])));); sum(k=1, #vp, vp[k]*(-1)^(k+1));} \\ Michel Marcus, Jul 06 2018
    
  • Python
    from sympy import factorint, primepi
    def A316524(n):
        fs = [primepi(p) for p in factorint(n,multiple=True)]
        return sum(fs[::2])-sum(fs[1::2]) # Chai Wah Wu, Aug 23 2021

Formula

a(n) = A344616(n) * A344617(n) = a(A007913(n)). - Antti Karttunen, May 06 2022

Extensions

More terms from Antti Karttunen, May 06 2022

A000586 Number of partitions of n into distinct primes.

Original entry on oeis.org

1, 0, 1, 1, 0, 2, 0, 2, 1, 1, 2, 1, 2, 2, 2, 2, 3, 2, 4, 3, 4, 4, 4, 5, 5, 5, 6, 5, 6, 7, 6, 9, 7, 9, 9, 9, 11, 11, 11, 13, 12, 14, 15, 15, 17, 16, 18, 19, 20, 21, 23, 22, 25, 26, 27, 30, 29, 32, 32, 35, 37, 39, 40, 42, 44, 45, 50, 50, 53, 55, 57, 61, 64, 67, 70, 71, 76, 78, 83, 87, 89, 93, 96
Offset: 0

Views

Author

Keywords

Examples

			n=16 has a(16) = 3 partitions into distinct prime parts: 16 = 2+3+11 = 3+13 = 5+11.
		

References

  • H. Gupta, Certain averages connected with partitions. Res. Bull. Panjab Univ. no. 124 1957 427-430.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence in two entries, N0004 and N0039).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000041, A070215, A000607 (parts may repeat), A112022, A000009, A046675, A319264, A319267.

Programs

  • Haskell
    a000586 = p a000040_list where
       p _  0 = 1
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
    -- Reinhard Zumkeller, Aug 05 2012
    
  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1)+`if`(ithprime(i)>n, 0, b(n-ithprime(i), i-1))))
        end:
    a:= n-> b(n, numtheory[pi](n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Nov 15 2012
  • Mathematica
    CoefficientList[Series[Product[(1+x^Prime[k]), {k, 24}], {x, 0, Prime[24]}], x]
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i-1] + If[Prime[i] > n, 0, b[n - Prime[i], i-1]]]]; a[n_] := b[n, PrimePi[n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *)
    nmax = 100; pmax = PrimePi[nmax]; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 0; poly[[3]] = 1; Do[p = Prime[k]; Do[poly[[j]] += poly[[j - p]], {j, nmax + 1, p + 1, -1}];, {k, 2, pmax}]; poly (* Vaclav Kotesovec, Sep 20 2018 *)
  • PARI
    a(n,k=n)=if(n<1, !n, my(s);forprime(p=2,k,s+=a(n-p,p-1));s) \\ Charles R Greathouse IV, Nov 20 2012
    
  • Python
    from sympy import isprime, primerange
    from functools import cache
    @cache
    def a(n, k=None):
        if k == None: k = n
        if n < 1: return int(n == 0)
        return sum(a(n-p, p-1) for p in primerange(1, k+1))
    print([a(n) for n in range(83)]) # Michael S. Branicky, Sep 03 2021 after Charles R Greathouse IV

Formula

G.f.: Product_{k>=1} (1+x^prime(k)).
a(n) = A184171(n) + A184172(n). - R. J. Mathar, Jan 10 2011
a(n) = Sum_{k=0..A024936(n)} A219180(n,k). - Alois P. Heinz, Nov 13 2012
log(a(n)) ~ Pi*sqrt(2*n/(3*log(n))) [Roth and Szekeres, 1954]. - Vaclav Kotesovec, Sep 13 2018

Extensions

Entry revised by N. J. A. Sloane, Jun 10 2012

A002095 Number of partitions of n into nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 5, 6, 8, 8, 12, 13, 17, 19, 26, 28, 37, 40, 52, 58, 73, 79, 102, 113, 139, 154, 191, 210, 258, 284, 345, 384, 462, 509, 614, 679, 805, 893, 1060, 1171, 1382, 1528, 1792, 1988, 2319, 2560, 2986, 3304, 3823, 4231, 4888, 5399, 6219, 6870
Offset: 0

Views

Author

Keywords

Comments

Partial sums of A023895. - Emeric Deutsch, Apr 19 2006
Column k=0 of A222656. - Alois P. Heinz, May 29 2013

Examples

			a(6) = 3 from the partitions 6 = 1+1+1+1+1+1 = 4+1+1.
		

References

  • L. M. Chawla and S. A. Shad, On a trio-set of partition functions and their tables, J. Natural Sciences and Mathematics, 9 (1969), 87-96.
  • A. Murthy, Some new Smarandache sequences, functions and partitions, Smarandache Notions Journal Vol. 11 N. 1-2-3 Spring 2000 (but beware errors).
  • Amarnath Murthy and Charles Ashbacher, Generalized Partitions and Some New Ideas on Number Theory and Smarandache Sequences, Hexis, Phoenix; USA 2005. See Section 2.6.
  • 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).

Crossrefs

Programs

  • Haskell
    a002095 = p a018252_list where
       p _          0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Jan 15 2012
    
  • Maple
    g:=product((1-x^ithprime(j))/(1-x^j),j=1..60): gser:=series(g,x=0,60): seq(coeff(gser,x,n),n=0..55); # Emeric Deutsch, Apr 19 2006
  • Mathematica
    NonPrime[n_Integer] := FixedPoint[n + PrimePi[ # ] &, n + PrimePi[n]]; CoefficientList[ Series[1/Product[1 - x^NonPrime[i], {i, 1, 50}], {x, 0, 50}], x]
  • PARI
    first(n)=my(x='x+O('x^(n+1)),pr=1); forprime(p=2,n+1, pr *= (1-x^p)); pr/prod(i=1,n+1, 1-x^i) \\ Charles R Greathouse IV, Jun 23 2017

Formula

G.f.: Product_{i>0} (1-x^prime(i))/(1-x^i). - Vladeta Jovovic, Jul 31 2004

Extensions

More terms from James Sellers, Dec 23 1999
Corrected by Robert G. Wilson v, Feb 11 2002

A034891 Number of different products of partitions of n; number of partitions of n into prime parts (1 included); number of distinct orders of Abelian subgroups of symmetric group S_n.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 8, 11, 14, 18, 23, 29, 36, 45, 55, 67, 81, 98, 117, 140, 166, 196, 231, 271, 317, 369, 429, 496, 573, 660, 758, 869, 993, 1133, 1290, 1465, 1662, 1881, 2125, 2397, 2699, 3035, 3407, 3820, 4276, 4780, 5337, 5951, 6628, 7372, 8191, 9090
Offset: 0

Views

Author

Keywords

Comments

a(n) = length of n-th row in A212721. - Reinhard Zumkeller, Jun 14 2012
Number of partitions of n into noncomposite parts. - Omar E. Pol, Jun 23 2022

Crossrefs

Programs

  • Haskell
    a034891 = length . a212721_row  -- Reinhard Zumkeller, Jun 14 2012
    
  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, (p->
          `if`(i<0, 0, b(n, i-1)+ `if`(p>n, 0,
             b(n-p, i))))(`if`(i<1, 1, ithprime(i))))
        end:
    a:= n-> b(n, numtheory[pi](n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Feb 15 2013
  • Mathematica
    Table[ Length[ Union[ Apply[ Times, Partitions[ n], 1]]], {n, 30}]
    CoefficientList[ Series[ (1/(1 - x)) Product[1/(1 - x^Prime[i]), {i, 100}], {x, 0, 50}], x] (* Robert G. Wilson v, Aug 17 2013 *)
    b[n_, i_] := b[n, i] = Module[{p}, p = If[i<1, 1, Prime[i]]; If[n == 0, 1, If[i<0, 0, b[n, i-1] + If[p>n, 0, b[n-p, i]]]]]; a[n_] := b[n, PrimePi[n] ]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 05 2015, after Alois P. Heinz *)
  • Sage
    [Partitions(n, parts_in=(prime_range(n+1)+[1])).cardinality() for n in xsrange(1000)] # Giuseppe Coppoletta, Jul 11 2016

Formula

G.f.: (1/(1-x))*(1/Product_{k>0} (1-x^prime(k))). a(n) = (1/n)*Sum_{k=1..n} A074372(k)*a(n-k). Partial sums of A000607. - Vladeta Jovovic, Sep 19 2002
a(n) = A000041(n) - A353188(n). - Omar E. Pol, Jun 23 2022

Extensions

More terms from Vladeta Jovovic
a(0)=1 from Michael Somos, Feb 05 2011

A344606 Number of alternating permutations of the prime factors of n, counting multiplicity, including twins (x,x).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 0, 1, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 1, 0, 1, 2, 0, 1, 1, 4, 1, 0, 2, 2, 2, 2, 1, 2, 2, 0, 1, 4, 1, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 0, 2, 0, 2, 2, 1, 4, 1, 2, 1, 0, 2, 4, 1, 1, 2, 4, 1, 1, 1, 2, 1, 1, 2, 4, 1, 0, 0, 2, 1, 4, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, May 28 2021

Keywords

Comments

Differs from A335448 in having a(x^2) = 0 and a(270) = 0.
These are permutations of the prime factors of n, counting multiplicity, with no adjacent triples (..., x, y, z, ...) where x <= y <= z or x >= y >= z.
The version without twins (x,x) is A345164, which is identical to this sequence except when n is the square of a prime.

Examples

			The permutations for n = 2, 6, 30, 180, 210, 300, 420, 720, 840:
  2   23   253   23253   2537   25253   23275   2323252   232527
      32   325   32325   2735   25352   25273   2325232   232725
           352   32523   3275   32525   25372   2523232   252327
           523   35232   3527   35252   27253             252723
                 52323   3725   52325   27352             272325
                         5273   52523   32527             272523
                         5372           32725             325272
                         5723           35272             327252
                         7253           37252             523272
                         7352           52327             527232
                                        52723             723252
                                        57232             725232
                                        72325
                                        72523
For example, there are no alternating permutations of the prime factors of 270 because the only anti-runs are {3,2,3,5,3} and {3,5,3,2,3}, neither of which is alternating, so a(270) = 0.
		

Crossrefs

The version for permutations is A001250.
The extension to anti-run permutations is A335452.
The version for compositions is A344604.
The version for patterns is A344605.
Positions of zeros are A344653 (counted by A344654).
Not including twins (x,x) gives A345164.
A008480 counts permutations of prime indices (strict: A335489, rank: A333221).
A056239 adds up prime indices, row sums of A112798.
A071321 and A071322 are signed sums of prime factors.
A316523 is a signed sum of prime multiplicities.
A316524 and A344616 are signed sums of prime indices.
A325534 counts separable partitions (ranked by A335433).
A325535 counts inseparable partitions (ranked by A335448).
A344740 counts partitions with an alternating permutation or twin (x,x).

Programs

  • Mathematica
    Table[Length[Select[Permutations[Flatten[ConstantArray@@@FactorInteger[n]]],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]],{n,100}]
Showing 1-10 of 198 results. Next