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

A056240 Smallest number whose prime divisors (taken with multiplicity) add to n.

Original entry on oeis.org

2, 3, 4, 5, 8, 7, 15, 14, 21, 11, 35, 13, 33, 26, 39, 17, 65, 19, 51, 38, 57, 23, 95, 46, 69, 92, 115, 29, 161, 31, 87, 62, 93, 124, 155, 37, 217, 74, 111, 41, 185, 43, 123, 86, 129, 47, 215, 94, 141, 188, 235, 53, 329, 106, 159, 212, 265, 59, 371, 61, 177, 122
Offset: 2

Views

Author

Adam Kertesz, Aug 19 2000

Keywords

Comments

a(n) is the index of first occurrence of n in A001414.
From David James Sycamore and Michel Marcus, Jun 16 2017, Jun 28 2017: (Start)
Recursive calculation of a(n):
For prime p, a(p) = p.
For even composite n, let P_n denote the largest prime < n-1 such that n-P_n is prime (except if n = 6).
For odd composite n, let P_n denote the largest prime < n-1 such that n-3-P_n is prime.
Conjecture: a(n) = min { q*a(n-q); q prime, P_n <= q < n-1 }.
Examples:
For n = 9998, P_9998 = 9967 and a(9998) = min { 9973*a(25), 9967*a(31) } = 9967*31 = 308977.
For n = 875, P_875 = 859 and a(875) = min { 863*a(12), 859*a(16) } = 863*35 = 30205.
Note: A000040 and A288313 are both subsequences of this sequence. (End)

Examples

			a(8) = 15 = 3*5 because 15 is the smallest number whose prime divisors sum to 8.
a(10000) = 586519: Let pp(n) be the largest prime < n and the candidate being the current value that might be a(10000). Then we see that pp(10000 - 1) = 9973, giving a candidate 9973 * a(10000 - 9973) = 9973 * 92. pp(9973) = 9967, giving a candidate 9967 * a(10000 - 9967) = 9967 * 62. pp(9967) = 9949, giving the candidate 9949 * a(10000 - 9949) = 9962 * 188. This is larger than our candidate so we keep 9967 * 62 as our candidate. pp(9949) = 9941, giving a candidate 9941 * pp(10000 - 9941) = 9941 * 59. We see that (n - p) * a(p) >= (n - p) * p > candidate = 9941 * 59 for p > 59 so we stop iterating to conclude a(10000) = 9941 * 59 = 586519. - _David A. Corneth_, Mar 23 2018, edited by _M. F. Hasler_, Jan 19 2019
		

Crossrefs

First column of array A064364, n>=2.
See A000792 for the maximal numbers whose prime factors sums up to n.

Programs

  • Haskell
    a056240 = (+ 1) . fromJust . (`elemIndex` a001414_list)
    -- Reinhard Zumkeller, Jun 14 2012
    
  • Maple
    A056240 := proc(n)
        local k ;
        for k from 1 do
            if A001414(k) = n then
                return k ;
            end if;
        end do:
    end proc:
    seq(A056240(n),n=2..80) ; # R. J. Mathar, Apr 15 2024
  • Mathematica
    a = Table[0, {75}]; Do[b = Plus @@ Flatten[ Table[ #1, {#2}] & @@@ FactorInteger[n]]; If[b < 76 && a[[b]] == 0, a[[b]] = n], {n, 2, 1000}]; a (* Robert G. Wilson v, May 04 2002 *)
    b[n_] := b[n] = Total[Times @@@ FactorInteger[n]];
    a[n_] := For[k = 2, True, k++, If[b[k] == n, Return[k]]];
    Table[a[n], {n, 2, 63}] (* Jean-François Alcover, Jul 03 2017 *)
  • PARI
    isok(k, n) = my(f=factor(k)); sum(j=1, #f~, f[j,1]*f[j,2]) == n;
    a(n) = my(k=2); while(!isok(k, n), k++); k; \\ Michel Marcus, Jun 21 2017
    
  • PARI
    a(n) = {if(n < 7, return(n + 2*(n==6))); my(p = precprime(n), res); if(p == n, return(p), p = precprime(n - 2); res = p * a(n - p); while(res > (n - p) * p && p > 2, p = precprime(p - 1); res = min(res, a(n - p) * p)); res)} \\ David A. Corneth, Mar 23 2018
    
  • PARI
    A056240(n, p=n-1, m=oo)=if(n<6 || isprime(n), n, n==6, 8, until(p<3 || (n-p=precprime(p-1))*p >= m=min(m,A056240(n-p)*p),); m) \\ M. F. Hasler, Jan 19 2019

Formula

Trivial but essential: a(n) >= n. - David A. Corneth, Mar 23 2018
a(n) >= n with equality iff n = 4 or n is prime. - M. F. Hasler, Jan 19 2019

Extensions

More terms from James Sellers, Aug 25 2000

A288814 a(n) is the smallest composite number whose prime divisors (with multiplicity) sum to n.

Original entry on oeis.org

4, 6, 8, 10, 15, 14, 21, 28, 35, 22, 33, 26, 39, 52, 65, 34, 51, 38, 57, 76, 95, 46, 69, 92, 115, 184, 161, 58, 87, 62, 93, 124, 155, 248, 217, 74, 111, 148, 185, 82, 123, 86, 129, 172, 215, 94, 141, 188, 235, 376, 329, 106, 159, 212, 265, 424, 371, 118, 177, 122, 183, 244, 305, 488, 427, 134, 201, 268, 335, 142
Offset: 4

Views

Author

David James Sycamore, Jun 16 2017

Keywords

Comments

Agrees with A056240(n) if n is composite (but not if n is prime).
For n prime, let P_n = greatest prime < n such that A056240(n-P_n) = A288313(m) for some m; then a(n) = Min{q*a(n-q): q prime, n-1 > q >= P_n}.
In most cases q is the greatest prime < p, but there are exceptions; e.g., p=211 is the smallest prime for which q (=197) is the second prime removed from 211, not the first. 541 is the next prime with this property (q=521). The same applies to p=16183, for which q=16139, the second prime removed from p. These examples all arise with q being the lesser of a prime pair.
For p prime, a(p) = q*a(p-q) for some prime q < p as described above. Then a(p-q) = 2,4,8 or 3*r for some prime r.
The subsequence of terms (4, 6, 8, 10, 14, 21, 22, 26, 34, ...), where for all m > n, a(m) > a(n) is the same as sequence A088686, and the sequence of its indices (4, 5, 6, 7, 9, 10, 13, 19, ...) is the same as A088685. - David James Sycamore, Jun 30 2017
Records are in A088685. - Robert G. Wilson v, Feb 26 2018
Number of terms less than 10^k, k=1,2,3,...: 3, 32, 246, 2046, 17053, 147488, ..., . - Robert G. Wilson v, Feb 26 2018

Examples

			a(5) = 6 = 2*3 is the smallest composite number whose prime divisors add to 5.
a(7) = 10 = 2*5 is the smallest composite number whose prime divisors add to 7.
12 = 2 * 2 * 3 is not in the sequence, since the sum of its prime divisors is 7, a value already obtained by the lesser 10. - _David A. Corneth_, Jun 22 2017
		

Crossrefs

Programs

A295185 a(n) is the smallest composite number whose prime divisors (with multiplicity) sum to prime(n); n >= 3.

Original entry on oeis.org

6, 10, 28, 22, 52, 34, 76, 184, 58, 248, 148, 82, 172, 376, 424, 118, 488, 268, 142, 584, 316, 664, 1335, 388, 202, 412, 214, 436, 3729, 508, 1048, 274, 2919, 298, 1208, 1256, 652, 1336, 1384, 358, 3801, 382, 772, 394, 6501, 7385, 892, 454, 916, 1864, 478, 5061, 2008, 2056, 2104, 538, 2168, 1108, 562, 5943, 9669
Offset: 3

Views

Author

David James Sycamore, Nov 16 2017

Keywords

Comments

Sequence is undefined for n=1,2 since no composites exist whose prime divisors sum to 2, 3. For n >= 3, a(n) = A288814(prime(n)) = prime(n-k)*B(prime(n) - prime(n-k)) where B=A056240, and k >= 1 is the "type" of prime(n), indicated as prime(n)~k(g1,g2,...,gk) where gi = prime(n-(i-1)) - prime(n-i); 1 <= i <= k. Thus: 5~1(2), 211~2(12,2), 4327~3(30,8,6) etc. The sequence relates to gaps between odd primes, and in particular to the sequence of k prime gaps below prime(n). The even-indexed terms of B are relevant, as are those of subsequences:
C=A288313, 2,4 plus terms B(n) where n-3 is prime (A298252),
D=A297150, terms B(n) where n-5 is prime and n-3 is composite (A297925) and
E=A298615, terms B(n) where both n-3 and n-5 are composite (A298366).
The above sequences of indices 2m form a partition of the even numbers and the corresponding terms B(2m) form a partition of the even-indexed terms of A056240. The union of D and E is the sequence A292081 = B-C.
Let g(n,t) = prime(n) - prime(n-t), t < n, and h(n,t) = g(n,t) - g(n,1), 1 < t < n. If g1=g(n,1) is a term in A298252 (g1-3 is prime), then B(g1) is a term in C, so k=1. If g1 belongs to A297925 or A298366 then B(g1) is a term in D or E and the value of k depends on subsequent gaps below prime(n), within a range dependent on g1.
Let range R1(g1) = u - g(n,1) where u is the index in B of the greatest term in C such that C(u) < B(g1). Let range R2(g1) = v-g(n,1) where v is the index in B of the greatest term in D such that D(v) <= B(g1). For all n, R2 < R1, and if g1 is a term in D then R2(g1)=0. Examples: R1(12)=2, R2(12)=0, R1(30)=26, R2(30)=6.
k >= 1 is the smallest integer such that B(g(n,k)) <= B(g(n,t)) for all t satisfying g1 <= g(n,t) <= g1 + R1(g1). For g1-3 prime, k=1. If g1-3 is composite, let z be least integer > 1 such that g(n,z)-3 is prime, and let w be least integer >= 1 such that g(n,w)-5 is prime. Then z "complies" if h(n,z) <= R1, and w "complies" if h(n,w) <= R2. If g1-5 is prime then R2=w=0 and only z is relevant.
B(g1) must belong to C,D or E. If in C (g1-3 is prime) then k=1. If in D (g1-5 is prime), k=z if z complies, otherwise k=1. If B(g1) is in E and z complies but not w then k=z, or if w complies but not z then k=w. If B(g1) is in E and z,w both comply then k=z if 3*(g(n,z)-3) < 5*(g(n,w)-5), otherwise k=w. If neither z nor w comply, then k=1.
Conjecture: For all n >= 3, a(n) >= A288189(n).

Examples

			5=prime(3), g(3,1)=5-3=2, a term in C; k=1, and a(3)=3*B(5-3)=3*2=6; 5~1(2).
17=prime(7), g(7,1)=17-13=4, a term in C; k=1, a(7)=13*B(17-13)=13*4=52; 17~1(4).
211=prime(47); g(47,1)=12, a term in D, R1=2, R2=0, k=z=2, a(47)=197*b(211-197)=197*33=6501; 211~2(12,2), and 211 is first prime of type k=2.
8923=prime(1109); g(1109,1)=30, a term in E. R1=26, R2=6, z=3 and w=2 both comply  but 3*(g(n,3)-3)=159 > 5*(g(n,2)-5)=155, so k=w=2. Therefore a(1109)=8887*b(8923-8887)=8887*b(36)=8887*155=1377485; 8923~2(30,6).
40343=prime(4232); g(4232,1)=54, a term in E. R1=58, R2=12,z=6 and w=3, both comply, 3*(g(n,z)-3)=309 and 5*(g(n,w)-5)=305 therefore k=w=3 and a(4232) = 40277*b(40343-40277)=40277*b(66)=40277*305=12284485; 40343~3(54,6,6).
81611=prime(7981); g(81611,1)=42, a term in D, R1=22, R2=0; z complies, k=z=6, a(7981)=81547*b(81611-81547)=81546*b(64)=81546*183=14923101; 81611~6(42,6,4,6,2,4) and is the first prime of type k=6.
If p is the greater of twin/cousin primes then p~1(2), p~1(4), respectively.
		

Crossrefs

Programs

  • Mathematica
    b[n_] := b[n] = Total[Times @@@ FactorInteger[n]];
    a[n_] := For[k = 2, True, k++, If[CompositeQ[k], If[b[k] == Prime[n], Return[k]]]];
    Table[a[n], {n, 3, 63}] (* Jean-François Alcover, Feb 23 2018 *)
  • PARI
    a(n) = { my(p=prime(n)); forcomposite(x=6, , my(f=factor(x)); if(f[, 1]~*f[, 2]==p, return(x))); } \\ Iain Fox, Dec 08 2017

Formula

a(n) = A288814(prime(n)) = prime(n-k)*A056240(prime(n) - prime(n-k)) for some k >= 1 and prime(n-k) = gpf(A288814(prime(n)).
a(n) >= A288189(n).

A292081 Let b(k) be A056240(k); this sequence lists numbers b(2n) such that for some m > n, b(2m) < b(2n).

Original entry on oeis.org

35, 65, 95, 115, 161, 155, 217, 185, 215, 235, 329, 265, 371, 305, 427, 335, 365, 511, 395, 415, 581, 445, 623, 1246, 485, 515, 545, 565, 791, 1417, 1243, 1469, 2071, 635, 655, 917, 695, 973, 1507, 1529, 755, 1057, 785, 1099, 815, 835, 1169, 865, 1211, 905, 1267
Offset: 1

Views

Author

David James Sycamore, Sep 12 2017

Keywords

Comments

Subsequence of even argument terms b(2n) of A056240 (listed in order), which do not appear in A288313. - David James Sycamore, Sep 13 2017

Examples

			b(12) = 35 is included since b(14) = 33 < 35.
b(28) = 115 is in since b(32) = 87, b(34) = 93, and b(40) = 111 are all less than 115.
		

Crossrefs

Programs

  • Mathematica
    a056240=Cases[Import["https://oeis.org/A056240/b056240.txt","Table"],{,}][[All,2]]; even=Take[a056240,{1,Length[a056240],2}];leven=Length[even]; a292081= Select[even,#>Min[Part[even,1;;Position[even,#][[1,1]]]]&&#>Min[Part[even,Position[even,#][[1,1]];;leven]]&] (* Ivan N. Ianakiev, Nov 02 2023 *)

A298252 Even integers n such that n-3 is prime.

Original entry on oeis.org

6, 8, 10, 14, 16, 20, 22, 26, 32, 34, 40, 44, 46, 50, 56, 62, 64, 70, 74, 76, 82, 86, 92, 100, 104, 106, 110, 112, 116, 130, 134, 140, 142, 152, 154, 160, 166, 170, 176, 182, 184, 194, 196, 200, 202, 214, 226, 230, 232, 236, 242, 244, 254, 260, 266, 272, 274, 280
Offset: 1

Views

Author

David James Sycamore, Jan 15 2018

Keywords

Comments

Subsequence of A005843, same as A113935 with first term (5) excluded, since it is odd, not even. Index in A056240 of terms in A288313 (except for first two terms 2,4 of latter).
The terms in this sequence, combined with those in A297925 and A298366 form a partition of A005843(n); n>=3 (nonnegative numbers>=6). This is because any even integer n>=6 satisfies either(i) n-3 is prime, (ii) n-5 prime but n-3 composite, or (iii) n-5 and n-3 both composite.
a(n) is the smallest even number e > prime(n+1) such that e has a Goldbach partition containing prime(n+1). - Felix Fröhlich, Aug 18 2019

Examples

			a(1)=6 because 6-3=3; prime, and no smaller even number has this property; also a(1)=A113935(2)=6.  a(2)=8 because 8-3=5 is prime; also A113935(3)=8.
12 is not in the sequence because 12-3 = 9, composite.
		

Crossrefs

Programs

  • GAP
    Filtered([1..300],n->IsEvenInt(n) and IsPrime(n-3)); # Muniru A Asiru, Mar 23 2018
    
  • Magma
    [NthPrime(n+1) +3: n in [1..70]]; // G. C. Greubel, May 21 2019
    
  • Maple
    N:=200
      for n from 6 to N by 2 do
    if isprime(n-3) then print(n);
    end if
    end do
  • Mathematica
    Select[2 Range@125, PrimeQ[# - 3] &] (* Robert G. Wilson v, Jan 15 2018 *)
    Select[Prime[Range[100]]+3,EvenQ] (* Harvey P. Dale, Mar 07 2022 *)
  • PARI
    a(n) = prime(n + 1) + 3 \\ David A. Corneth, Mar 23 2018
    
  • Sage
    [nth_prime(n+1) +3 for n in (1..70)] # G. C. Greubel, May 21 2019

Formula

a(n) = A113935(n+1), n>=1.
A056240(a(n)) = A288313(n+2).
a(n) = prime(n + 1) + 3 = A113935(n + 1). - David A. Corneth, Mar 23 2018

A289993 Primes p such that gpf(A288814(p)) < q, where q is greatest prime < p.

Original entry on oeis.org

211, 541, 631, 673, 1693, 1801, 2879, 3181, 3271, 3299, 3343, 3571, 3943, 4177, 4327, 4441, 4547, 4561, 4751, 4783, 4813, 4861, 5147, 5261, 5381, 5431, 5501, 5779, 6029, 6197, 6421, 6469, 6521, 6599, 6673, 6883, 6947, 7103, 7283, 7321, 7369, 7477, 7573, 7603, 7789, 7901, 7963, 7993, 8419, 8443
Offset: 1

Views

Author

David James Sycamore, Sep 13 2017

Keywords

Comments

For prime p in this sequence, b(p) = r*b(p-r) where b(m) = A288814(m), and r = gpf(b(p)) is some prime < q. We can say that prime p_n (n > 2) is of type k if gpf(b(p_n)) = p_(n-k).
Prime gap p-q, and pattern of gaps p-r determines if p is in the sequence or not. Prime p is of type k > 2 only if p-q is one of the even indices of A056240 on which A292081 is defined (12,18,24,28,30,36,...), and if there is a prime r < q < p such that b(p-r) < b(p-q).

Examples

			p=211 is a candidate for inclusion because p-q = 211-199 = 12, and b(12)=35 is a term in A292081. Since r=197 is the next prime below q, p-r = 14 and b(14) = 33 < 35, 211 is in the sequence, of type 2.
Conversely, p=809, which also has gap p-q = 12, is not in the sequence because the only number n > 12 for which b(n) < b(12)=35 is n=14, and p-14 = 795 is not prime. Therefore b(809) = 797*b(12) = 27895, and 809 is of type 1.
		

Crossrefs

Programs

  • Maple
    N:= 10^7: # to get terms before the first prime p>3 such that A288814(p) > N
    Res:= NULL:
    for x from 4 to N do
      if isprime(x) then next fi;
      F:= ifactors(x)[2];
      p:= add(t[1]*t[2],t=F);
      if not isprime(p) then next fi;
      if not assigned(A288814[p]) then
        A288814[p]:= x;
        w:= max(seq(t[1],t=F));
        if w < prevprime(p) then
          Res:= Res, p
        fi
      fi
    od:
    pmax:= Res[-1]:
    Primes:= select(isprime, [seq(i,i=5..pmax,2)]):
    B:= remove(p -> assigned(A288814[p]), Primes):
    sort(select(`<`,[Res], min(B))); # Robert Israel, Oct 19 2017
  • PARI
    \\ See PARI link. - David A. Corneth, Mar 23 2018

Extensions

a(30)-a(50) from Robert Israel, Oct 02 2017
Edited by Michel Marcus, Nov 15 2023

A297150 Let b(k) denote A292081(k); the sequence lists numbers b(2n) where for all m > n, b(2m) > b(2n).

Original entry on oeis.org

35, 65, 95, 115, 155, 185, 215, 235, 265, 305, 335, 365, 395, 415, 445, 485, 515, 545, 565, 635, 655, 695, 755, 785, 815, 835, 865, 905, 965, 995, 1055, 1115, 1145, 1165, 1205, 1255, 1285, 1315, 1355, 1385, 1415, 1465, 1535, 1565, 1585, 1655, 1685, 1745, 1765, 1795, 1835, 1865, 1895, 1915, 1945, 1985
Offset: 1

Views

Author

David James Sycamore, Dec 26 2017

Keywords

Comments

This is also an ascending subsequence of the even-indexed terms of A056240(2n) (of which A292081 is a subsequence). For n >= 1, a(n) is a semiprime of the form a(n)=5*A049591(n), and the index m in A056240 of any term in this sequence belongs to the sequence of even numbers m such that m-5 is prime and m-3 is not prime (A297925). See A297925 for explanation.

Examples

			a(1)=5*A049591(1)=5*7=35. Also A056240(A297925(1))=A056240(12)=35.
a(17)=5*A049591(17)=5*103=515. Also A056240(A297925(17))=A056240(108)=515.
		

Crossrefs

Programs

  • Magma
    [5*p: p in PrimesInInterval(3, 500) | not IsPrime(p + 2)]; // Vincenzo Librandi, Nov 12 2018
  • Mathematica
    5 Select[Prime[Range[3, 100]], ! PrimeQ[(# + 2)] &] (* Vincenzo Librandi, Nov 12 2018 *)

Formula

a(n) = 5*A049591(n) = A056240(A297925(n)).

A298615 Let b(k) be A056240(k); this sequence lists numbers b(2n) such that there is at least one m > n for which b(2m) < b(2n) belongs to A297150.

Original entry on oeis.org

161, 217, 329, 371, 427, 511, 581, 623, 1246, 791, 1417, 1243, 1469, 2071, 917, 973, 1507, 1529, 1057, 1099, 1169, 1211, 1267, 1969, 1991, 1393, 2167, 2189, 2587, 1477, 2954, 2321, 2743, 1631, 1687, 2629, 2651, 1757, 1799, 1841, 1897, 1981, 3091, 3113, 2051, 4102
Offset: 1

Views

Author

David James Sycamore, Jan 26 2018

Keywords

Comments

For even number n, if n-5 and n-3 are both composite then A056240(n) belongs to this sequence. The union of terms in this sequence together with those in A288313 and A297150 combine to make A056240(2n), for n >= 3. A288313(n) = A056240(A298252(n)), A297150(n) = A056240(A297925(n)), and the terms of this sequence correspond to A056240(A298366). Distinct sequences A298252, A297925 and A298366 form a partition of the nonnegative even integers (A005843) >= 6. These partitions holds because any even integer n >= 6 is such that, either n-3 is prime (A298252), or n-5 is prime but n-3 is composite (A297925), or both n-5 and n-3 are composite (A298366).

Examples

			n=1, a(1) = A056240(A298366(1)) = A056240(30) = 161;
n=24, a(24) = A056240(A298366(24)) = A056240(190) = 1969.
		

Crossrefs

Programs

  • PARI
    A056240(n, p=n-1, m=oo)=if(n<6 || isprime(n), n, n==6, 8, until(p<3 || (n-p=precprime(p-1))*p >= m=min(m, A056240(n-p)*p), ); m);
    is_A298366(n)= !isprime(n-5) && !isprime(n-3) && !(n%2) && (n>5);
    lista(nn) = {for (n=0, nn, if (is_A298366(n), print1(A056240(n), ", ")););} \\ Michel Marcus, Apr 03 2020

Formula

a(n) = A056240(A298366(n)).
Showing 1-8 of 8 results.