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

A014612 Numbers that are the product of exactly three (not necessarily distinct) primes.

Original entry on oeis.org

8, 12, 18, 20, 27, 28, 30, 42, 44, 45, 50, 52, 63, 66, 68, 70, 75, 76, 78, 92, 98, 99, 102, 105, 110, 114, 116, 117, 124, 125, 130, 138, 147, 148, 153, 154, 164, 165, 170, 171, 172, 174, 175, 182, 186, 188, 190, 195, 207, 212, 222, 230, 231, 236, 238, 242, 244
Offset: 1

Views

Author

Keywords

Comments

Sometimes called "triprimes" or "3-almost primes".
See also A001358 for product of two primes (sometimes called semiprimes).
If you graph a(n)/n for n up to 10000 (and probably quite a bit higher), it appears to be converging to something near 3.9. In fact the limit is infinite. - Franklin T. Adams-Watters, Sep 20 2006
Meng shows that for any sufficiently large odd integer n, the equation n = a + b + c has solutions where each of a, b, c is 3-almost prime. The number of such solutions is (log log n)^6/(16 (log n)^3)*n^2*s(n)*(1 + O(1/log log n)), where s(n) = Sum_{q >= 1} Sum_{a = 1..q, (a, q) = 1} exp(i*2*Pi*n*a/q)*mu(n)/phi(n)^3 > 1/2. - Jonathan Vos Post, Sep 16 2005, corrected & rewritten by M. F. Hasler, Apr 24 2019
Also, a(n) are the numbers such that exactly half of their divisors are composite. For the numbers in which exactly half of the divisors are prime, see A167171. - Ivan Neretin, Jan 12 2016

Examples

			From _Gus Wiseman_, Nov 04 2020: (Start)
Also Heinz numbers of integer partitions into three parts, counted by A001399(n-3) = A069905(n) with ordered version A000217, where the Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). The sequence of terms together with their prime indices begins:
      8: {1,1,1}     70: {1,3,4}     130: {1,3,6}
     12: {1,1,2}     75: {2,3,3}     138: {1,2,9}
     18: {1,2,2}     76: {1,1,8}     147: {2,4,4}
     20: {1,1,3}     78: {1,2,6}     148: {1,1,12}
     27: {2,2,2}     92: {1,1,9}     153: {2,2,7}
     28: {1,1,4}     98: {1,4,4}     154: {1,4,5}
     30: {1,2,3}     99: {2,2,5}     164: {1,1,13}
     42: {1,2,4}    102: {1,2,7}     165: {2,3,5}
     44: {1,1,5}    105: {2,3,4}     170: {1,3,7}
     45: {2,2,3}    110: {1,3,5}     171: {2,2,8}
     50: {1,3,3}    114: {1,2,8}     172: {1,1,14}
     52: {1,1,6}    116: {1,1,10}    174: {1,2,10}
     63: {2,2,4}    117: {2,2,6}     175: {3,3,4}
     66: {1,2,5}    124: {1,1,11}    182: {1,4,6}
     68: {1,1,7}    125: {3,3,3}     186: {1,2,11}
(End)
		

References

  • Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Vol. 1, Teubner, Leipzig; third edition : Chelsea, New York (1974). See p. 211.

Crossrefs

Cf. A000040, A001358 (biprimes), A014613 (quadruprimes), A033942, A086062, A098238, A123072, A123073, A101605 (characteristic function).
Cf. A109251 (number of 3-almost primes <= 10^n).
Subsequence of A145784. - Reinhard Zumkeller, Oct 19 2008
Cf. A007304 is the squarefree case.
Sequences listing r-almost primes, that is, the n such that A001222(n) = r: A000040 (r = 1), A001358 (r = 2), this sequence (r = 3), A014613 (r = 4), A014614 (r = 5), A046306 (r = 6), A046308 (r = 7), A046310 (r = 8), A046312 (r = 9), A046314 (r = 10), A069272 (r = 11), A069273 (r = 12), A069274 (r = 13), A069275 (r = 14), A069276 (r = 15), A069277 (r = 16), A069278 (r = 17), A069279 (r = 18), A069280 (r = 19), A069281 (r = 20). - Jason Kimberley, Oct 02 2011
Cf. A253721 (final digits).
A014311 is a different ranking of ordered triples, with strict case A337453.
A046316 is the restriction to odds, with strict case A307534.
A075818 is the restriction to evens, with strict case A075819.
A285508 is the nonsquarefree case.
A001399(n-3) = A069905(n) = A211540(n+2) counts 3-part partitions.

Programs

  • Haskell
    a014612 n = a014612_list !! (n-1)
    a014612_list = filter ((== 3) . a001222) [1..] -- Reinhard Zumkeller, Apr 02 2012
    
  • Maple
    with(numtheory); A014612:=n->`if`(bigomega(n)=3, n, NULL); seq(A014612(n), n=1..250) # Wesley Ivan Hurt, Feb 05 2014
  • Mathematica
    threeAlmostPrimeQ[n_] := Plus @@ Last /@ FactorInteger@n == 3; Select[ Range@244, threeAlmostPrimeQ[ # ] &] (* Robert G. Wilson v, Jan 04 2006 *)
    NextkAlmostPrime[n_, k_: 2, m_: 1] := Block[{c = 0, sgn = Sign[m]}, kap = n + sgn; While[c < Abs[m], While[ PrimeOmega[kap] != k, If[sgn < 0, kap--, kap++]]; If[ sgn < 0, kap--, kap++]; c++]; kap + If[sgn < 0, 1, -1]]; NestList[NextkAlmostPrime[#, 3] &, 2^3, 56] (* Robert G. Wilson v, Jan 27 2013 *)
    Select[Range[244], PrimeOmega[#] == 3 &] (* Jayanta Basu, Jul 01 2013 *)
  • PARI
    isA014612(n)=bigomega(n)==3 \\ Charles R Greathouse IV, May 07 2011
    
  • PARI
    list(lim)=my(v=List(),t);forprime(p=2,lim\4, forprime(q=2,min(lim\(2*p),p), t=p*q; forprime(r=2,min(lim\t,q),listput(v,t*r)))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jan 04 2013
    
  • Python
    from sympy import factorint
    def ok(n): f = factorint(n); return sum(f[p] for p in f) == 3
    print(list(filter(ok, range(245)))) # Michael S. Branicky, Aug 12 2021
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A014612(n):
        def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a,k in enumerate(primerange(integer_nthroot(x,3)[0]+1)) for b,m in enumerate(primerange(k,isqrt(x//k)+1),a)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Aug 17 2024
  • Scala
    def primeFactors(number: Int, list: List[Int] = List())
                                                          : List[Int] = {
      for (n <- 2 to number if (number % n == 0)) {
        return primeFactors(number / n, list :+ n)
      }
      list
    }
    (1 to 250).filter(primeFactors().size == 3) // _Alonso del Arte, Nov 04 2020, based on algorithm by Victor Farcic (vfarcic)
    

Formula

Product p_i^e_i with Sum e_i = 3.
a(n) ~ 2n log n / (log log n)^2 as n -> infinity [Landau, p. 211].
Tau(a(n)) = 2 * (omega(a(n)) + 1) = 2*A083399(a(n)), where tau = A000005 and omega = A001221. - Wesley Ivan Hurt, Jun 28 2013
a(n) = A078840(3,n). - R. J. Mathar, Jan 30 2019

Extensions

More terms from Patrick De Geest, Jun 15 1998

A007997 a(n) = ceiling((n-3)(n-4)/6).

Original entry on oeis.org

0, 0, 1, 1, 2, 4, 5, 7, 10, 12, 15, 19, 22, 26, 31, 35, 40, 46, 51, 57, 64, 70, 77, 85, 92, 100, 109, 117, 126, 136, 145, 155, 166, 176, 187, 199, 210, 222, 235, 247, 260, 274, 287, 301, 316, 330, 345, 361, 376, 392, 409, 425, 442, 460, 477, 495, 514, 532, 551, 571, 590, 610
Offset: 3

Views

Author

Keywords

Comments

Number of solutions to x+y+z=0 (mod m) with 0<=x<=y<=z
Nonorientable genus of complete graph on n nodes.
Also (with different offset) Molien series for alternating group A_3.
(1+x^3 ) / ((1-x)*(1-x^2)*(1-x^3)) is the Poincaré series [or Poincare series] (or Molien series) for H^*(S_6, F_2).
a(n+5) is the number of necklaces with 3 black beads and n white beads.
The g.f./x^5 is Z(C_3,x), the 3-variate cycle index polynomial for the cyclic group C_3, with substitution x[i]->1/(1-x^i), i=1,2,3. Therefore by Polya enumeration a(n+5) is the number of cyclically inequivalent 3-necklaces whose 3 beads are labeled with nonnegative integers such that the sum of labels is n, for n=0,1,2,... . See A102190 for Z(C_3,x). - Wolfdieter Lang, Feb 15 2005
a(n+1) is the number of pairs (x,y) with x and y in {0,...,n}, x = (y mod 3), and x+y < n. - Clark Kimberling, Jul 02 2012
From Gus Wiseman, Oct 17 2020: (Start)
Also the number of 3-part integer compositions of n - 2 that are either weakly increasing or strictly decreasing. For example, the a(5) = 1 through a(13) = 15 compositions are:
(111) (112) (113) (114) (115) (116) (117) (118) (119)
(122) (123) (124) (125) (126) (127) (128)
(222) (133) (134) (135) (136) (137)
(321) (223) (224) (144) (145) (146)
(421) (233) (225) (226) (155)
(431) (234) (235) (227)
(521) (333) (244) (236)
(432) (334) (245)
(531) (532) (335)
(621) (541) (344)
(631) (542)
(721) (632)
(641)
(731)
(821)
(End)

Examples

			For m=7 (n=12), the 12 solutions are xyz = 000 610 520 511 430 421 331 322 662 653 644 554.
		

References

  • A. Adem and R. J. Milgram, Cohomology of Finite Groups, Springer-Verlag, 2nd. ed., 2004, p. 204.
  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 105.
  • J. L. Gross and T. W. Tucker, Topological Graph Theory, Wiley, 1987; see \bar{I}(n) p. 221.
  • J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 740.
  • E. V. McLaughlin, Numbers of factorizations in non-unique factorial domains, Senior Thesis, Allegeny College, Meadville, PA, 2004.

Crossrefs

Apart from initial term, same as A058212.
A001399(n-6)*2 = A069905(n-3)*2 = A211540(n-1)*2 counts the strict case.
A014311 intersected with A225620 U A333256 ranks these compositions.
A218004 counts these compositions of any length.
A000009 counts strictly decreasing compositions.
A000041 counts weakly increasing compositions.
A001523 counts unimodal compositions, with complement counted by A115981.
A007318 and A097805 count compositions by length.
A032020 counts strict compositions, ranked by A233564.
A333149 counts neither increasing nor decreasing strict compositions.

Programs

  • Haskell
    a007997 n = ceiling $ (fromIntegral $ (n - 3) * (n - 4)) / 6
    a007997_list = 0 : 0 : 1 : zipWith (+) a007997_list [1..]
    -- Reinhard Zumkeller, Dec 18 2013
    
  • Maple
    x^5*(1+x^3)/((1-x)*(1-x^2)*(1-x^3));
    seq(ceil(binomial(n,2)/3), n=0..63); # Zerinvary Lajos, Jan 12 2009
    a := n -> (n*(n-7)-2*([1,1,-1][n mod 3 +1]-7))/6;
    seq(a(n), n=3..64); # Peter Luschny, Jan 13 2015
  • Mathematica
    k = 3; Table[Apply[Plus, Map[EulerPhi[ # ]Binomial[n/#, k/# ] &, Divisors[GCD[n, k]]]]/n, {n, k, 30}] (* Robert A. Russell, Sep 27 2004 *)
    Table[Ceiling[((n-3)(n-4))/6],{n,3,100}] (* or *) LinearRecurrence[ {2,-1,1,-2,1},{0,0,1,1,2},100] (* Harvey P. Dale, Jan 21 2014 *)
  • PARI
    a(n)=(n^2-7*n+16)\6 \\ Charles R Greathouse IV, Sep 24 2015

Formula

a(n) = a(n-3) + n - 2, a(0)=0, a(1)=0, a(2)=1 [Offset 0]. - Paul Barry, Jul 14 2004
G.f.: x^5*(1+x^3)/((1-x)*(1-x^2)*(1-x^3)) = x^5*(1-x+x^2)/((1-x)^2*(1-x^3)).
a(n+5) = Sum_{k=0..floor(n/2)} C(n-k,L(k/3)), where L(j/p) is the Legendre symbol of j and p. - Paul Barry, Mar 16 2006
a(3)=0, a(4)=0, a(5)=1, a(6)=1, a(7)=2, a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5). - Harvey P. Dale, Jan 21 2014
a(n) = (n^2 - 7*n + 14 - 2*(-1)^(2^(n + 1 - 3*floor((n+1)/3))))/6. - Luce ETIENNE, Dec 27 2014
a(n) = A001399(n-3) + A001399(n-6). Compare to A140106(n) = A001399(n-3) - A001399(n-6). - Gus Wiseman, Oct 17 2020
a(n) = (40 + 3*(n - 7)*n - 4*cos(2*n*Pi/3) - 4*sqrt(3)*sin(2*n*Pi/3))/18. - Stefano Spezia, Dec 14 2021
Sum_{n>=5} 1/a(n) = 6 - 2*Pi/sqrt(3) + 2*Pi*tanh(sqrt(5/3)*Pi/2)/sqrt(15). - Amiram Eldar, Oct 01 2022

A338900 Difference between the two prime indices of the n-th squarefree semiprime.

Original entry on oeis.org

1, 2, 3, 1, 2, 4, 5, 3, 6, 1, 7, 4, 8, 5, 2, 6, 9, 10, 3, 7, 11, 1, 12, 4, 13, 8, 2, 9, 14, 5, 15, 10, 6, 16, 3, 17, 11, 12, 4, 18, 13, 19, 1, 7, 20, 8, 21, 14, 5, 22, 15, 23, 16, 9, 2, 24, 17, 25, 6, 10, 26, 3, 18, 27, 11, 7, 28, 19, 1, 29, 12, 20, 2, 21, 4
Offset: 1

Author

Gus Wiseman, Nov 16 2020

Keywords

Comments

A squarefree semiprime is a product of any two distinct prime numbers. A prime index of n is a number m such that the m-th prime number divides n. The multiset of prime indices of n is row n of A112798.
Is this sequence an anti-run, i.e., are there no adjacent equal parts? I have verified this conjecture up to n = 10^6. - Gus Wiseman, Nov 18 2020

Crossrefs

A176506 is the not necessarily squarefree version.
A338899 has row-differences equal to this sequence.
A338901 gives positions of first appearances.
A001221 counts distinct prime indices.
A001222 counts prime indices.
A001358 lists semiprimes.
A002100 and A338903 count partitions using squarefree semiprimes.
A004526 counts 2-part partitions, with strict case A140106 (shifted left).
A005117 lists squarefree numbers.
A006881 lists squarefree semiprimes, with odds A046388 and evens A100484.
A065516 gives first differences of semiprimes.
A166237 gives first differences of squarefree semiprimes.
A270650 and A270652 give the prime indices of squarefree semiprimes.
A338912 and A338913 give the prime indices of semiprimes.

Programs

  • Mathematica
    -Subtract@@PrimePi/@First/@FactorInteger[#]&/@Select[Range[100],SquareFreeQ[#]&&PrimeOmega[#]==2&]

Formula

If the n-th squarefree semiprime is prime(x) * prime(y) with x < y, then a(n) = y - x.
a(n) = A270652(n) - A270650(n).

A238628 Number of partitions p of n such that n - max(p) is a part of p.

Original entry on oeis.org

0, 1, 1, 3, 2, 5, 3, 8, 4, 11, 5, 16, 6, 21, 7, 29, 8, 38, 9, 51, 10, 66, 11, 88, 12, 113, 13, 148, 14, 190, 15, 246, 16, 313, 17, 402, 18, 508, 19, 646, 20, 812, 21, 1023, 22, 1277, 23, 1598, 24, 1982, 25, 2461, 26, 3036, 27, 3745, 28, 4593, 29, 5633
Offset: 1

Author

Clark Kimberling, Mar 02 2014

Keywords

Comments

Also the number of integer partitions of n that are of length 2 or contain n/2. The first condition alone is A004526, complement A058984. The second condition alone is A035363, complement A086543, ranks A344415. - Gus Wiseman, Oct 07 2023

Examples

			a(6) counts these partitions:  51, 42, 33, 321, 3111.
		

Crossrefs

Cf. A238479.
The strict case is A365659, complement A365826.
The complement is counted by A365825.
These partitions are ranked by A366318.
A000041 counts integer partitions, strict A000009.
A140106 counts strict partitions of length 2, complement A365827.
A182616 counts partitions of 2n that do not contain n, strict A365828.

Programs

  • Mathematica
    Table[Count[IntegerPartitions[n], p_ /; MemberQ[p, n - Max[p]]], {n, 50}]
  • PARI
    a(n) = my(res = floor(n/2)); if(!bitand(n, 1), res+=(numbpart(n/2)-1)); res
  • Python
    from sympy.utilities.iterables import partitions
    def A238628(n): return sum(1 for p in partitions(n) if n-max(p,default=0) in p) # Chai Wah Wu, Sep 21 2023
    

A055684 Number of different n-pointed stars.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 2, 1, 4, 1, 5, 2, 3, 3, 7, 2, 8, 3, 5, 4, 10, 3, 9, 5, 8, 5, 13, 3, 14, 7, 9, 7, 11, 5, 17, 8, 11, 7, 19, 5, 20, 9, 11, 10, 22, 7, 20, 9, 15, 11, 25, 8, 19, 11, 17, 13, 28, 7, 29, 14, 17, 15, 23, 9, 32, 15, 21, 11, 34, 11, 35, 17, 19, 17, 29, 11
Offset: 3

Author

Robert G. Wilson v, Jun 09 2000

Keywords

Comments

Does not count rotations or reflections.
This is also the distinct ways of writing a number as the sum of two positive integers greater than one that are coprimes. - Lei Zhou, Mar 19 2014
Equivalently, a(n) is the number of relatively prime 2-part partitions of n without 1's. The Heinz numbers of these partitions are the intersection of A001358 (pairs), A005408 (no 1's), and A000837 (relatively prime) or A302696 (pairwise coprime). - Gus Wiseman, Oct 28 2020

Examples

			The first star has five points and is unique. The next is the seven pointed star and it comes in two varieties.
From _Gus Wiseman_, Oct 28 2020: (Start)
The a(5) = 1 through a(17) = 7 irreducible pairs > 1 (shown as fractions, empty column indicated by dot):
  2/3  .  2/5  3/5  2/7  3/7  2/9  5/7  2/11  3/11  2/13  3/13  2/15
          3/4       4/5       3/8       3/10  5/9   4/11  5/11  3/14
                              4/7       4/9         7/8   7/9   4/13
                              5/6       5/8                     5/12
                                        6/7                     6/11
                                                                7/10
                                                                8/9
(End)
		

References

  • Mark A. Herkommer, "Number Theory, A Programmer's Guide," McGraw-Hill, New York, 1999, page 58.

Crossrefs

Cf. A023022.
Cf. A053669 smallest skip increment, A102302 skip increment of densest star polygon.
A055684*2 is the ordered version.
A082023 counts the complement (reducible pairs > 1).
A220377, A337563, and A338332 count triples instead of pairs.
A000837 counts relatively prime partitions, with strict case A078374.
A002865 counts partitions with no 1's, with strict case A025147.
A007359 and A337485 count pairwise coprime partitions with no 1's.
A302698 counts relatively prime partitions with no 1's, with strict case A337452.
A327516 counts pairwise coprime partitions, with strict case A305713.
A337450 counts relatively prime compositions with no 1's, with strict case A337451.

Programs

  • Maple
    with(numtheory): A055684 := n->(phi(n)-2)/2; seq(A055684(n), n=3..100);
  • Mathematica
    Table[(EulerPhi[n]-2)/2, {n, 3, 50}]
    Table[Length[Select[IntegerPartitions[n,{2}],!MemberQ[#,1]&&CoprimeQ@@#&]],{n,0,30}] (* Gus Wiseman, Oct 28 2020 *)

Formula

a(n) = A023022(n) - 1.
a(n) + A082023(n) = A140106(n). - Gus Wiseman, Oct 28 2020

A338901 Position of the first appearance of prime(n) as a factor in the list of squarefree semiprimes.

Original entry on oeis.org

1, 1, 2, 3, 6, 7, 9, 11, 13, 17, 18, 21, 23, 25, 29, 31, 34, 36, 40, 42, 45, 47, 50, 52, 56, 58, 61, 64, 67, 70, 76, 78, 81, 82, 86, 89, 93, 97, 100, 104, 106, 107, 112, 113, 116, 118, 125, 129, 133, 134, 135, 139, 141, 147, 150, 154, 159, 160, 165, 167, 169
Offset: 1

Author

Gus Wiseman, Nov 16 2020

Keywords

Comments

The a(n)-th squarefree semiprime is the first divisible by prime(n).
After a(1) = 1, these are the positions of even terms in the list of all squarefree semiprimes A006881.

Crossrefs

A001358 lists semiprimes, with odds A046315 and evens A100484.
A004526 counts 2-part partitions, with strict case A140106 (shifted left).
A005117 lists squarefree numbers.
A006881 lists squarefree semiprimes, with odds A046388 and evens A100484.
A115392 is the not necessarily squarefree version.
A166237 gives the first differences of squarefree semiprimes.
A270650 and A270652 give the prime indices of squarefree semiprimes.
A320656 counts factorizations into squarefree semiprimes.
A338898 gives prime indices of semiprimes, with differences A176506.
A338899 gives prime indices of squarefree semiprimes, differences A338900.
A338912 and A338913 give the prime indices of semiprimes.

Programs

  • Mathematica
    rs=First/@FactorInteger[#]&/@Select[Range[100],SquareFreeQ[#]&&PrimeOmega[#]==2&];
    Table[Position[rs,i][[1,1]],{i,Union@@rs}]

Formula

A006881(a(n)) = A100484(n).

A365544 Number of subsets of {1..n} containing two distinct elements summing to n.

Original entry on oeis.org

0, 0, 0, 2, 4, 14, 28, 74, 148, 350, 700, 1562, 3124, 6734, 13468, 28394, 56788, 117950, 235900, 484922, 969844, 1979054, 3958108, 8034314, 16068628, 32491550, 64983100, 131029082, 262058164, 527304974, 1054609948, 2118785834, 4237571668, 8503841150, 17007682300
Offset: 0

Author

Gus Wiseman, Sep 20 2023

Keywords

Examples

			The a(1) = 0 through a(5) = 14 subsets:
  .  .  {1,2}    {1,3}      {1,4}
        {1,2,3}  {1,2,3}    {2,3}
                 {1,3,4}    {1,2,3}
                 {1,2,3,4}  {1,2,4}
                            {1,3,4}
                            {1,4,5}
                            {2,3,4}
                            {2,3,5}
                            {1,2,3,4}
                            {1,2,3,5}
                            {1,2,4,5}
                            {1,3,4,5}
                            {2,3,4,5}
                            {1,2,3,4,5}
		

Crossrefs

For strict partitions we have A140106 shifted left.
The version for partitions is A004526.
The complement is counted by A068911.
For all subsets of elements we have A365376.
Main diagonal k = n of A365541.
A000009 counts subsets summing to n.
A007865/A085489/A151897 count certain types of sum-free subsets.
A093971/A088809/A364534 count certain types of sum-full subsets.
A365381 counts subsets with a subset summing to k.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#,{2}],n]&]],{n,0,10}]
  • Python
    def A365544(n): return (1<>1)<<1 if n&1 else 3**(n-1>>1)<<2) if n else 0 # Chai Wah Wu, Aug 30 2024

Formula

a(n) = 2^n - A068911(n).
From Alois P. Heinz, Aug 30 2024: (Start)
G.f.: 2*x^3/((2*x-1)*(3*x^2-1)).
a(n) = 2 * A167762(n-1) for n>=1. (End)

A337484 Number of ordered triples of positive integers summing to n that are neither strictly increasing nor strictly decreasing.

Original entry on oeis.org

0, 0, 0, 1, 3, 6, 8, 13, 17, 22, 28, 35, 41, 50, 58, 67, 77, 88, 98, 111, 123, 136, 150, 165, 179, 196, 212, 229, 247, 266, 284, 305, 325, 346, 368, 391, 413, 438, 462, 487, 513, 540, 566, 595, 623, 652, 682, 713, 743, 776, 808, 841, 875, 910, 944, 981, 1017
Offset: 0

Author

Gus Wiseman, Sep 11 2020

Keywords

Examples

			The a(3) = 1 through a(7) = 13 triples:
  (1,1,1)  (1,1,2)  (1,1,3)  (1,1,4)  (1,1,5)
           (1,2,1)  (1,2,2)  (1,3,2)  (1,3,3)
           (2,1,1)  (1,3,1)  (1,4,1)  (1,4,2)
                    (2,1,2)  (2,1,3)  (1,5,1)
                    (2,2,1)  (2,2,2)  (2,1,4)
                    (3,1,1)  (2,3,1)  (2,2,3)
                             (3,1,2)  (2,3,2)
                             (4,1,1)  (2,4,1)
                                      (3,1,3)
                                      (3,2,2)
                                      (3,3,1)
                                      (4,1,2)
                                      (5,1,1)
		

Crossrefs

A140106 is the unordered case.
A242771 allows strictly increasing but not strictly decreasing triples.
A337481 counts these compositions of any length.
A001399(n - 6) counts unordered strict triples.
A001523 counts unimodal compositions, with complement A115981.
A007318 and A097805 count compositions by length.
A069905 counts unordered triples.
A218004 counts strictly increasing or weakly decreasing compositions.
A332745 counts partitions with weakly increasing or weakly decreasing run-lengths.
A332835 counts compositions with weakly increasing or weakly decreasing run-lengths.
A337483 counts triples either weakly increasing or weakly decreasing.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],!Less@@#&&!Greater@@#&]],{n,0,15}]

Formula

a(n) = 2*A242771(n - 1) - A000217(n - 1), n > 0.
2*A001399(n - 6) = 2*A069905(n - 3) = 2*A211540(n - 1) is the complement.
4*A001399(n - 6) = 4*A069905(n - 3) = 4*A211540(n - 1) is the strict case.
Conjectures from Colin Barker, Sep 13 2020: (Start)
G.f.: x^3*(1 + 2*x + 2*x^2 - x^3) / ((1 - x)^3*(1 + x)*(1 + x + x^2)).
a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6) for n>6.
(End)

A239473 Triangle read by rows: signed version of A059260: coefficients for expansion of partial sums of sequences a(n,x) in terms of their binomial transforms (1+a(.,x))^n ; Laguerre polynomial expansion of the truncated exponential.

Original entry on oeis.org

1, 0, 1, 1, -1, 1, 0, 2, -2, 1, 1, -2, 4, -3, 1, 0, 3, -6, 7, -4, 1, 1, -3, 9, -13, 11, -5, 1, 0, 4, -12, 22, -24, 16, -6, 1, 1, -4, 16, -34, 46, -40, 22, -7, 1, 0, 5, -20, 50, -80, 86, -62, 29, -8, 1, 1, -5, 25, -70, 130, -166, 148, -91, 37, -9, 1, 0, 6, -30, 95, -200, 296, -314, 239, -128, 46, -10, 1
Offset: 0

Author

Tom Copeland, Mar 19 2014

Keywords

Comments

With T the lower triangular array above and the Laguerre polynomials L(k,x) = Sum_{j=0..k} (-1)^j binomial(k, j) x^j/j!, the following identities hold:
(A) Sum_{k=0..n} (-1)^k L(k,x) = Sum_{k=0..n} T(n,k) x^k/k!;
(B) Sum_{k=0..n} x^k/k! = Sum_{k=0..n} T(n,k) L(k,-x);
(C) Sum_{k=0..n} x^k = Sum_{k=0..n} T(n,k) (1+x)^k = (1-x^(n+1))/(1-x).
More generally, for polynomial sequences,
(D) Sum_{k=0..n} P(k,x) = Sum_{k=0..n} T(n,k) (1+P(.,x))^k,
where, e.g., for an Appell sequence, such as the Bernoulli polynomials, umbrally, (1+ Ber(.,x))^k = Ber(k,x+1).
Identity B follows from A through umbral substitution of j!L(j,-x) for x^j in A. Identity C, related to the cyclotomic polynomials for prime index, follows from B through the Laplace transform.
Integrating C gives Sum_{k=0..n} T(n,k) (2^(k+1)-1)/(k+1) = H(n+1), the harmonic numbers.
Identity A >= 0 for x >= 0 (see MathOverflow link for evaluation in terms of Hermite polynomials).
From identity C, W(m,n) = (-1)^n Sum_{k=0..n} T(n,k) (2-m)^k = number of walks of length n+1 between any two distinct vertices of the complete graph K_m for m > 2.
Equals A112468 with the first column of ones removed. - Georg Fischer, Jul 26 2023

Examples

			Triangle begins:
   1
   0    1
   1   -1    1
   0    2   -2    1
   1   -2    4   -3    1
   0    3   -6    7   -4    1
   1   -3    9  -13   11   -5    1
   0    4  -12   22  -24   16   -6    1
   1   -4   16  -34   46  -40   22   -7    1
   0    5  -20   50  -80   86  -62   29   -8    1
   1   -5   25  -70  130 -166  148  -91   37   -9    1
		

Crossrefs

For column 2: A001057, A004526, A008619, A140106.
Column 3: A002620, A087811.
Column 4: A002623, A173196.
Column 5: A001752.
Column 6: A001753.
Cf. Bottomley's cross-references in A059260.
Embedded in alternating antidiagonals of T are the reversals of arrays A071921 (A225010) and A210220.

Programs

  • Magma
    [[(&+[(-1)^(j+k)*Binomial(j,k): j in [0..n]]): k in [0..n]]: n in [0..10]]; // G. C. Greubel, Feb 06 2018
    
  • Maple
    A239473 := proc(n,k)
        add(binomial(j,k)*(-1)^(j+k),j=k..n) ;
    end proc; # R. J. Mathar, Jul 21 2016
  • Mathematica
    Table[Sum[(-1)^(j+k)*Binomial[j,k], {j,0,n}], {n,0,10}, {k,0,n}]//Flatten (* G. C. Greubel, Feb 06 2018 *)
  • PARI
    for(n=0,10, for(k=0,n, print1(sum(j=0,n, (-1)^(j+k)*binomial(j, k)), ", "))) \\ G. C. Greubel, Feb 06 2018
    
  • Sage
    Trow = lambda n: sum((x-1)^j for j in (0..n)).list()
    for n in (0..10): print(Trow(n)) # Peter Luschny, Jul 09 2019

Formula

T(n, k) = Sum_{j=0..n} (-1)^(j+k) * binomial(j, k).
E.g.f: (exp(t) - (x-1)*exp((x-1)*t))/(2-x).
O.g.f. (n-th row): (1-(x-1)^(n+1))/(2-x).
Associated operator identities:
With D=d/dx, :xD:^n=x^n*D^n, and :Dx:^n=D^n*x^n, then bin(xD,n)= binomial(xD,n)=:xD:^n/n! and L(n,-:xD:)=:Dx:^n/n!=bin(xD+n,n)=(-1)^n bin(-xD-1,n),
A-o) Sum_{k=0..n} (-1)^k L(k,-:xD:) = Sum_{k=0..n} :-Dx:^k/k!
= Sum_{k=0..n} T(n,k) :-xD:^k/k! = Sum_{k=0..n} (-1)^k T(n,k)bin(xD,k)
B-o) Sum_{k=0..n} :xD:^k/k! = Sum_{k=0..n}, T(n,k) L(k,-:xD:)
= Sum_{k=0..n} T(n,k) :Dx:^k/k! = Sum_{k=0..n}, bin(xD,k).
Associated binomial identities:
A-b) Sum_{k=0..n} (-1)^k bin(s+k,k) = Sum_{k=0..n} (-1)^k T(n,k) bin(s,k)
= Sum_{k=0..n} bin(-s-1,k) = Sum{k=0..n} T(n,k) bin(-s-1+k,k)
B-b) Sum_{k=0..n} bin(s,k) = Sum_{k=0..n} T(n,k) bin(s+k,k)
= Sum_{k=0..n} (-1)^k bin(-s-1+k,k)
= Sum_{k=0..n} (-1)^k T(n,k) bin(-s-1,k).
In particular, from B-b with s=n, Sum_{k=0..n} T(n,k) bin(n+k,k) = 2^n. From B-b with s=0, row sums are all 1.
From identity C with x=-2, the unsigned row sums are the Jacobsthal sequence, i.e., Sum_{k=0..n} T(n,k) (1+(-2))^k = (-1)^n A001045(n+1); for x=2, the Mersenne numbers A000225; for x=-3, A014983 or signed A015518; for x=3, A003462; for x=-4, A014985 or signed A015521; for x=4, A002450; for x=-5, A014986 or signed A015531; and for x=5, A003463; for x=-6, A014987 or signed A015540; and for x=6, A003464.
With -s-1 = m = 0,1,2,..., B-b gives finite differences (recursions):
Sum_{k=0..n} (-1)^k T(n,k) bin(m,k) = Sum_{k=0..n} (-1)^k bin(m+k,k) = T(n+m,m), i.e., finite differences of the columns of T generate shifted columns of T. The columns of T are signed, shifted versions of sequences listed in the cross-references. Since the finite difference is an involution, T(n,k) = Sum_{j=0..k} (-1)^j T(n+j,j) bin(k,j)}. Gauss-Newton interpolation can be applied to give a generalized T(n,s) for s noninteger.
From identity C, S(n,m) = Sum_{k=0..n} T(n,k) bin(k,m) = 1 for m < n+1 and 0 otherwise, i.e., S = T*P, where S = A000012, as a lower triangular matrix and P = Pascal = A007318, so T = S*P^(-1), where P^(-1) = A130595, the signed Pascal array (see A132440), the inverse of P, and T^(-1) = P*S^(-1) = P*A167374 = A156644.
U(n,cos(x)) = e^(-n*i*x)*Sum_{k=0..n} T(n,k)*(1+e^(2*i*x))^k = sin((n+1)x)/sin(x), where U is the Chebyschev polynomial of the second kind A053117 and i^2 = -1. - Tom Copeland, Oct 18 2014
From Tom Copeland, Dec 26 2015: (Start)
With a(n,x) = e^(nx), the partial sums are 1+e^x+...+e^(nx) = Sum_{k=0..n} T(n,k) (1+e^x)^k = [ x / (e^x-1) ] [ e^((n+1)x) -1 ] / x = [ (x / (e^x-1)) e^((n+1)x) - (x / (e^x-1)) ] / x = Sum_{k>=0} [ (Ber(k+1,n+1) - Ber(k+1,0)) / (k+1) ] * x^k/k!, where Ber(n,x) are the Bernoulli polynomials (cf. Adams p. 140). Evaluating (d/dx)^m at x=0 of these expressions gives relations among the partial sums of the m-th powers of the integers, their binomial transforms, and the Bernoulli polynomials.
With a(n,x) = (-1)^n e^(nx), the partial sums are 1-e^x+...+(-1)^n e^(nx) = Sum_{k=0..n} T(n,k) (1-e^x)^k = [ (-1)^n e^((n+1)x) + 1 ] / (e^x+1) = [ (-1)^n (2 / (e^x+1)) e^((n+1)x) + (2 / (e^x+1)) ] / 2 = (1/2) Sum_{k>=0} [ (-1)^n Eul(k,n+1) + Eul(k,0) ] * x^k/k!, where Eul(n,x) are the Euler polynomials. Evaluating (d/dx)^m at x=0 of these expressions gives relations among the partial sums of signed m-th powers of the integers; their binomial transforms, related to the Stirling numbers of the second kind and face numbers of the permutahedra; and the Euler polynomials. (End)
As in A059260, a generator in terms of bivariate polynomials with the coefficients of this entry is given by (1/(1-y))*1/(1 + (y/(1-y))*x - (1/(1-y))*x^2) = 1 + y + (x^2 - x*y + y^2) + (2*x^2*y - 2*x*y^2 + y^3) + (x^4 - 2*x^3*y + 4*x^2*y^2 - 3*x*y^3 + y^4) + ... . This is of the form -h2 * 1 / (1 + h1*x + h2*x^2), related to the bivariate generator of A049310 with h1 = y/(1-y) and h2 = -1/(1-y) = -(1+h1). - Tom Copeland, Feb 16 2016
From Tom Copeland, Sep 05 2016: (Start)
Letting P(k,x) = x in D gives Sum_{k=0..n} T(n,k)*Sum_{j=0..k} binomial(k,j) = Sum_{k=0..n} T(n,k) 2^k = n + 1.
The quantum integers [n+1]q = (q^(n+1) - q^(-n-1)) / (q - q^(-1)) = q^(-n)*(1 - q^(2*(n+1))) / (1 - q^2) = q^(-n)*Sum{k=0..n} q^(2k) = q^(-n)*Sum_{k=0..n} T(n,k)*(1 + q^2)^k. (End)
T(n, k) = [x^k] Sum_{j=0..n} (x-1)^j. - Peter Luschny, Jul 09 2019
a(n) = -n + Sum_{k=0..n} A341091(k). - Thomas Scheuerle, Jun 17 2022

Extensions

Inverse array added by Tom Copeland, Mar 26 2014
Formula re Euler polynomials corrected by Tom Copeland, Mar 08 2024

A338909 Numbers of the form prime(x) * prime(y) where x and y have a common divisor > 1.

Original entry on oeis.org

9, 21, 25, 39, 49, 57, 65, 87, 91, 111, 115, 121, 129, 133, 159, 169, 183, 185, 203, 213, 235, 237, 247, 259, 267, 289, 299, 301, 303, 305, 319, 321, 339, 361, 365, 371, 377, 393, 417, 427, 445, 453, 481, 489, 497, 515, 517, 519, 529, 543, 551, 553, 559, 565
Offset: 1

Author

Gus Wiseman, Nov 20 2020

Keywords

Examples

			The sequence of terms together with their prime indices begins:
      9: {2,2}     169: {6,6}     319: {5,10}
     21: {2,4}     183: {2,18}    321: {2,28}
     25: {3,3}     185: {3,12}    339: {2,30}
     39: {2,6}     203: {4,10}    361: {8,8}
     49: {4,4}     213: {2,20}    365: {3,21}
     57: {2,8}     235: {3,15}    371: {4,16}
     65: {3,6}     237: {2,22}    377: {6,10}
     87: {2,10}    247: {6,8}     393: {2,32}
     91: {4,6}     259: {4,12}    417: {2,34}
    111: {2,12}    267: {2,24}    427: {4,18}
    115: {3,9}     289: {7,7}     445: {3,24}
    121: {5,5}     299: {6,9}     453: {2,36}
    129: {2,14}    301: {4,14}    481: {6,12}
    133: {4,8}     303: {2,26}    489: {2,38}
    159: {2,16}    305: {3,18}    497: {4,20}
		

Crossrefs

A082023 counts partitions with these as Heinz numbers, complement A023022.
A300912 is the complement in A001358.
A339002 is the squarefree case.
A001221 counts distinct prime indices.
A001222 counts prime indices.
A001358 lists semiprimes, with odds A046315 and evens A100484.
A004526 counts 2-part partitions, with strict case A140106 (shifted left).
A006881 lists squarefree semiprimes, with odds A046388 and evens A100484.
A176504/A176506/A087794 give sum/difference/product of semiprime indices.
A318990 lists semiprimes with divisible indices.
A320655 counts factorizations into semiprimes.
A338898, A338912, and A338913 give semiprime indices.
A338899, A270650, and A270652 give squarefree semiprime indices.
A338910 lists semiprimes with odd indices.
A338911 lists semiprimes with even indices.

Programs

  • Mathematica
    Select[Range[100],PrimeOmega[#]==2&&GCD@@PrimePi/@First/@FactorInteger[#]>1&]

Formula

Equals A001358 \ A300912.
Equals A339002 \/ (A001248 \ {4}).
Showing 1-10 of 22 results. Next