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 21 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

A073610 Number of primes of the form n-p where p is a prime.

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 2, 2, 2, 3, 0, 2, 2, 3, 2, 4, 0, 4, 2, 4, 2, 5, 0, 6, 2, 5, 0, 4, 0, 6, 2, 4, 2, 7, 0, 8, 0, 3, 2, 6, 0, 8, 2, 6, 2, 7, 0, 10, 2, 8, 0, 6, 0, 10, 2, 6, 0, 7, 0, 12, 2, 5, 2, 10, 0, 12, 0, 4, 2, 10, 0, 12, 2, 9, 2, 10, 0, 14, 0, 8, 2, 9, 0, 16, 2, 9, 0, 8, 0, 18, 2, 8, 0, 9, 0, 14, 0, 6
Offset: 1

Views

Author

Amarnath Murthy, Aug 05 2002

Keywords

Comments

a(p) = 2 if p-2 is a prime else a(p) = 0. If n = 2p, p is a prime then a(n) is odd else a(n) is even. As p is counted only once and if q and n-q both are prime then the count is increased by 2. ( Analogous to the fact that perfect squares have odd number of divisors).
a(2k+1) = 2 if (2k-1) is prime, else a(2k+1)=0 (for any k). This sequence can be used to re-describe a couple of conjectures: the Goldbach conjecture == a(2n) > 0 for all n>=2; twin primes conjecture == for any n, there is a prime p>n s.t. a(p)>0.
Number of ordered ways of writing n as the sum of two primes.

Examples

			a(16) = 4 as there are 4 primes 3,5,11 and 13 such that 16-3,16-5,16-11and 16-13 are primes.
		

Crossrefs

Programs

  • Maple
    for i from 1 to 500 do a[i] := 0:j := 1:while(ithprime(j)
    				
  • Mathematica
    nn=20;a[x]:=Sum[x^i,{i,Table[Prime[n],{n,1,nn}]}];Drop[CoefficientList[a[x]^2,x],1]  (* Geoffrey Critzer, Nov 22 2012 *)
  • PARI
    Vec(sum(i=1,100,x^prime(i),O(x^prime(101)))^2) \\ Charles R Greathouse IV, Jan 21 2015

Formula

G.f.: (Sum_{k>0} x^prime(k))^2. - Vladeta Jovovic, Mar 12 2005
Self-convolution of characteristic function of primes (A010051). - Graeme McRae, Jul 18 2006

Extensions

Corrected and extended by Vladeta Jovovic and Sascha Kurz, Aug 06 2002

A121303 Triangle read by rows: T(n,k) is the number of compositions of n into k primes (i.e., ordered sequences of k primes having sum n; n>=2, k>=1).

Original entry on oeis.org

1, 1, 0, 1, 1, 2, 0, 1, 1, 1, 2, 3, 0, 2, 3, 1, 0, 2, 4, 4, 0, 3, 6, 6, 1, 1, 0, 6, 8, 5, 0, 2, 9, 13, 10, 1, 1, 2, 6, 16, 15, 6, 0, 3, 6, 22, 25, 15, 1, 0, 2, 10, 24, 36, 26, 7, 0, 4, 9, 22, 50, 45, 21, 1, 1, 0, 12, 32, 65, 72, 42, 8, 0, 4, 12, 34, 70, 106, 77, 28, 1, 1, 2, 12, 40, 90, 150
Offset: 2

Views

Author

Emeric Deutsch, Aug 06 2006

Keywords

Comments

Row n has floor(n/2) terms.
Sum of terms in row n = A023360(n).
T(n,1) = A010051(n) (characteristic function of primes); T(n,2) = A073610(n); T(n,3) = A098238(n).
Sum_{k=1..floor(n/2)} k*T(n,k) = A121304(n).

Examples

			T(9,3) = 4 because we have [2,2,5], [2,5,2], [5,2,2] and [3,3,3].
Triangle starts:
  1;
  1;
  0, 1;
  1, 2;
  0, 1, 1;
  1, 2, 3;
  0, 2, 3, 1;
  0, 2, 4, 4;
  ...
		

Crossrefs

Programs

  • Maple
    G:=1/(1-t*sum(z^ithprime(i),i=1..30))-1: Gser:=simplify(series(G,z=0,25)): for n from 2 to 21 do P[n]:=sort(coeff(Gser,z,n)) od: for n from 2 to 21 do seq(coeff(P[n],t,j),j=1..floor(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    with(numtheory):
    b:= proc(n) option remember; local j; if n=0 then [1]
          else []; for j to pi(n) do zip((x, y)->x+y, %,
          [0, b(n-ithprime(j))[]], 0) od; % fi
        end:
    T:= n-> subsop(1=NULL, b(n))[]:
    seq(T(n), n=2..20);  # Alois P. Heinz, May 23 2013
  • Mathematica
    nn=20;a[x_]:=Sum[x^Prime[n],{n,1,nn}];CoefficientList[Series[1/(1-y a[x]),{x,0,nn}],{x,y}]//Grid (* Geoffrey Critzer, Nov 08 2013 *)

Formula

G.f.: 1/(1 - t*Sum_{i>=1} z^prime(i)).

A282064 Expansion of (x + Sum_{p prime, k>=1} x^(p^k))^3.

Original entry on oeis.org

0, 0, 0, 1, 3, 6, 10, 15, 18, 22, 27, 33, 37, 45, 48, 52, 54, 60, 60, 69, 69, 79, 81, 87, 79, 93, 87, 97, 99, 114, 99, 120, 111, 130, 126, 150, 135, 168, 141, 160, 147, 177, 144, 189, 156, 183, 162, 201, 157, 213, 171, 214, 189, 231, 168, 237, 189, 244, 201, 261, 177, 270, 201, 261, 210, 282, 192, 297, 216, 283, 228
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 05 2017

Keywords

Comments

Number of ways to write n as an ordered sum of three prime powers (1 included).

Examples

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

Crossrefs

Programs

  • Mathematica
    nmax = 70; CoefficientList[Series[(x + Sum[Floor[1/PrimeNu[k]] x^k, {k, 2, nmax}])^3, {x, 0, nmax}], x]

Formula

G.f.: (x + Sum_{p prime, k>=1} x^(p^k))^3.

A340960 Number of ways to write n as an ordered sum of 4 primes.

Original entry on oeis.org

1, 4, 6, 8, 13, 16, 22, 24, 22, 32, 34, 40, 47, 48, 56, 68, 70, 76, 90, 84, 111, 112, 126, 120, 144, 120, 176, 140, 184, 148, 226, 168, 264, 184, 262, 196, 313, 192, 352, 208, 366, 256, 418, 240, 473, 260, 496, 324, 536, 300, 616, 308, 634, 348, 670, 348, 772, 364, 786, 412
Offset: 8

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;
          if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else
          while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi
        end:
    a:= n-> b(n, 4):
    seq(a(n), n=8..67);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 67; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^4, {x, 0, nmax}], x] // Drop[#, 8] &

Formula

G.f.: (Sum_{k>=1} x^prime(k))^4.

A340961 Number of ways to write n as an ordered sum of 5 primes.

Original entry on oeis.org

1, 5, 10, 15, 25, 36, 50, 65, 70, 90, 110, 125, 155, 170, 200, 241, 270, 300, 350, 375, 435, 500, 530, 600, 640, 696, 760, 850, 840, 985, 990, 1170, 1160, 1370, 1250, 1570, 1445, 1760, 1600, 2000, 1710, 2340, 1950, 2555, 2165, 2876, 2320, 3340, 2560, 3595, 2880, 3985, 3050
Offset: 10

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;
          if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else
          while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi
        end:
    a:= n-> b(n, 5):
    seq(a(n), n=10..62);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 62; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^5, {x, 0, nmax}], x] // Drop[#, 10] &

Formula

G.f.: (Sum_{k>=1} x^prime(k))^5.

A340962 Number of ways to write n as an ordered sum of 6 primes.

Original entry on oeis.org

1, 6, 15, 26, 45, 72, 106, 150, 186, 236, 306, 366, 455, 540, 636, 782, 912, 1056, 1236, 1410, 1617, 1896, 2106, 2400, 2696, 2976, 3348, 3716, 4026, 4446, 4917, 5340, 5982, 6380, 7017, 7476, 8377, 8640, 9765, 9936, 11202, 11496, 13132, 12930, 15117, 14672, 17178, 16800, 19696
Offset: 12

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;
          if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else
          while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi
        end:
    a:= n-> b(n, 6):
    seq(a(n), n=12..60);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 60; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^6, {x, 0, nmax}], x] // Drop[#, 12] &

Formula

G.f.: (Sum_{k>=1} x^prime(k))^6.

A340963 Number of ways to write n as an ordered sum of 7 primes.

Original entry on oeis.org

1, 7, 21, 42, 77, 133, 210, 316, 434, 574, 770, 980, 1239, 1547, 1876, 2331, 2828, 3367, 4032, 4746, 5565, 6574, 7602, 8757, 10136, 11480, 13132, 14882, 16646, 18662, 20951, 23268, 26082, 28861, 31787, 35218, 38745, 42532, 46403, 50883, 54810, 60613, 65016, 71302, 76069
Offset: 14

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;
          if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else
          while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi
        end:
    a:= n-> b(n, 7):
    seq(a(n), n=14..58);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 58; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^7, {x, 0, nmax}], x] // Drop[#, 14] &

Formula

G.f.: (Sum_{k>=1} x^prime(k))^7.

A340964 Number of ways to write n as an ordered sum of 8 primes.

Original entry on oeis.org

1, 8, 28, 64, 126, 232, 392, 624, 925, 1296, 1800, 2416, 3158, 4088, 5152, 6504, 8142, 9976, 12216, 14784, 17738, 21296, 25272, 29736, 35023, 40768, 47328, 54832, 62728, 71744, 81796, 92736, 105078, 118664, 132924, 149424, 167002, 186144, 206852, 229272, 253023
Offset: 16

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;
          if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else
          while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi
        end:
    a:= n-> b(n, 8):
    seq(a(n), n=16..56);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 56; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^8, {x, 0, nmax}], x] // Drop[#, 16] &

Formula

G.f.: (Sum_{k>=1} x^prime(k))^8.

A340965 Number of ways to write n as an ordered sum of 9 primes.

Original entry on oeis.org

1, 9, 36, 93, 198, 387, 696, 1170, 1845, 2740, 3960, 5562, 7566, 10125, 13248, 17133, 22014, 27774, 34776, 43173, 53010, 64869, 78696, 94617, 113415, 134946, 159552, 188164, 219960, 256041, 297180, 342846, 394614, 452595, 516276, 587997, 667938, 755109, 852444
Offset: 18

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, k) option remember; local r, p; r, p:= 0, 2;
          if n=0 then `if`(k=0, 1, 0) elif k<1 then 0 else
          while p<=n do r:= r+b(n-p, k-1); p:= nextprime(p) od; r fi
        end:
    a:= n-> b(n, 9):
    seq(a(n), n=18..56);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 56; CoefficientList[Series[Sum[x^Prime[k], {k, 1, nmax}]^9, {x, 0, nmax}], x] // Drop[#, 18] &

Formula

G.f.: (Sum_{k>=1} x^prime(k))^9.
Showing 1-10 of 21 results. Next