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

A023539 Convolution of natural numbers with composite numbers.

Original entry on oeis.org

4, 14, 32, 59, 96, 145, 208, 286, 380, 492, 624, 777, 952, 1151, 1375, 1625, 1902, 2207, 2542, 2909, 3309, 3743, 4212, 4717, 5260, 5842, 6464, 7128, 7836, 8589, 9388, 10235, 11131, 12077, 13074, 14123, 15226, 16384, 17598, 18869, 20198
Offset: 1

Views

Author

Keywords

Examples

			a(1) = 1*4 = 4;
a(2) = 1*6 + 2*4 = 14;
a(3) = 1*8 + 2*6 + 3*4 = 32;
		

Crossrefs

Cf. A002808.
First differences are in A053767.

Programs

  • PARI
    lista(nn) = {my(vc = []); forcomposite(n=2, nn, vc = concat(vc, n); print1(sum(k=1, #vc, (#vc-k+1)*vc[k]), ", "););} \\ Michel Marcus, Feb 11 2018

A227249 Number of consecutive composites beginning with the first, to be added to obtain a power.

Original entry on oeis.org

1, 4, 6, 21, 80, 4151, 6982, 269563, 779693, 834365, 16176645, 19770092, 41049539, 228612936, 1950787140, 2404785364, 3095996836, 5236785750
Offset: 1

Views

Author

Robin Garcia, Jul 04 2013

Keywords

Comments

All powers are squares with the exception of 3^3 for a(2) and 6^9 for a(6). I conjecture these are the only nonsquare powers.
a(19) > 10^10. - Zak Seidov, Jul 06 2013

Examples

			Considering 1 not to be prime and not to be composite, first composite is 4 which is 2^2. And the sum of the first four composites is 4 + 6 + 8 + 9 = 27 = 3^3.
		

Crossrefs

Programs

  • Maple
    # see A001597 for isA001597
    for n from 1 do
        if isA001597(A053767(n) ) then
            print(n) ;
        end if;
    end do: # R. J. Mathar, Jul 08 2013
  • PARI
    n=10^7;v=vector(n);i=0;for(a=2,n,if(isprime(a),next,i++;v[i]=a));k=0;for(j=1,i,k=k+v[j];if(ispower(k,,&n),print1([k,n,j]," ")))

Formula

{n: A053767(n) in A001597}. - Zak Seidov, Jul 06 2013

Extensions

a(11) - a(18) from Zak Seidov, Jul 06 2013

A294174 Numbers that can be expressed both as the sum of first primes and as the sum of first composites.

Original entry on oeis.org

0, 10, 1988, 14697, 83292, 1503397, 18859052, 93952013, 89171409882, 9646383703961, 209456854921713, 3950430820867201, 13113506646374409451778
Offset: 1

Views

Author

Max Alekseyev, Feb 10 2018

Keywords

Examples

			From _Jon E. Schoenfield_, Feb 10 2018: (Start)
10 is in the sequence because prime(1) + prime(2) + prime(3) = 2 + 3 + 5 = 10 and composite(1) + composite(2) = 4 + 6 = 10 (where composite(i) is the i-th composite number).
1988 is in the sequence because Sum_{i=1..33} prime(i) = A007504(33) = Sum_{i=1..51} composite(i) = A053767(51) = 1988.
                          a(n) = A007504(j)
   n         j         k       = A053767(k)
  ==  ========  ========  =================
   1         0         0                  0
   2         3         2                 10
   3        33        51               1988
   4        80       147              14697
   5       175       361              83292
   6       660      1582            1503397
   7      2143      5699           18859052
   8      4556     12821           93952013
   9    118785    403341        89171409882
  10   1131142   4229425      9646383703961
  11   5012372  19786181    209456854921713
  12  20840220  86192660   3950430820867201 (End)
		

Crossrefs

Intersection of A007504 and A053767.

Programs

  • Mathematica
    nextComposite[n_] := Block[{k = n + 1}, While[PrimeQ@k, k++]; k]; c = sc = 4; p = sp = 2; lst = {0}; While[p < 1000000000, If[ sc == sp, AppendTo[lst, sc]; c = nextComposite@c; sc += c]; While[ sp < sc, p = NextPrime@ p; sp += p]; While[ sc < sp, c = nextComposite@ c; sc += c]]; lst (* Robert G. Wilson v, Feb 11 2018 *)
    Module[{pr=Accumulate[Prime[Range[5*10^7]]],co=Accumulate[Select[ Range[ 11*10^7], CompositeQ]]},Join[ {0},Intersection[pr,co]]] (* The program generates the first 12 terms of the sequence; to generate the 13th term increase the Range specifications substantially, but the program will take a long time to run. *) (* Harvey P. Dale, Sep 17 2019 *)

A330578 a(n) is the remainder when the sum of the first n composite numbers is divided by the n-th composite number.

Original entry on oeis.org

0, 4, 2, 0, 7, 1, 7, 3, 14, 4, 12, 6, 21, 7, 24, 16, 7, 25, 5, 15, 4, 26, 14, 1, 11, 36, 22, 34, 4, 33, 17, 31, 14, 46, 28, 9, 23, 3, 38, 17, 53, 9, 25, 2, 42, 18, 59, 9, 52, 26, 44, 64, 37, 9, 57, 28, 48, 18, 69, 7, 60, 28, 82, 49, 71, 37, 2, 59, 23, 81, 44
Offset: 1

Views

Author

Rémy Sigrist, Dec 18 2019

Keywords

Examples

			a(3) = (4 + 6 + 8) mod 8 = 2.
		

Crossrefs

Cf. A002808, A053767, A071089 (prime variant), A330579 (positions of zeros).

Programs

  • PARI
    s=0; forcomposite (c=4, 96, s+=c; print1 (s%c", "))

Formula

a(n) = A053767(n) mod A002808(n).

A065022 Composite n such that the sums of the composite numbers up to n, +/- 1, are twin primes.

Original entry on oeis.org

4, 8, 290, 340, 352, 412, 489, 610, 774, 785, 1227, 1295, 1306, 1795, 1853, 1918, 1945, 2014, 2266, 2502, 2885, 3063, 3133, 3178, 3265, 3482, 3486, 3680, 3760, 3843, 3973, 3995, 4124, 4794, 5677, 5769, 5965, 6123, 7555, 7653, 7696, 7765, 7786, 8023
Offset: 1

Views

Author

Robert G. Wilson v, Nov 01 2001

Keywords

Examples

			4+6+8 = 18 and 18 +/-1 are twin primes.
		

Crossrefs

Programs

  • Mathematica
    Composite[n_Integer] := (k = n + PrimePi[n] + 1; While[k - PrimePi[k] - 1 != n, k++ ]; k); s = 0; Do[m = Composite[n]; s = s + m; If[ PrimeQ[s - 1] && PrimeQ[s + 1], Print[m]], {n, 1, 10^4} ]
  • PARI
    is(n)=my(s); if(isprime(n),return(0)); forcomposite(k=4,n,s+=k);isprime(s-1)&&isprime(s+1) \\ Charles R Greathouse IV, Jan 02 2014
    
  • PARI
    s=0;forcomposite(n=4,8023,s+=n;if(isprime(s-1) && isprime(s+1), print1(n", "))) \\ Charles R Greathouse IV, Jan 02 2014

Extensions

New name from Charles R Greathouse IV, Jan 02 2014

A227314 Number of prime factors, with multiplicity, of the sum of the first n composite numbers.

Original entry on oeis.org

2, 2, 3, 3, 1, 2, 3, 3, 2, 5, 4, 3, 3, 1, 6, 4, 1, 2, 2, 1, 6, 3, 2, 2, 2, 3, 2, 4, 4, 2, 2, 3, 8, 3, 1, 1, 1, 3, 2, 2, 2, 2, 1, 2, 3, 2, 1, 1, 3, 3, 4, 2, 1, 1, 3, 7, 7, 3, 2, 4, 4, 2, 1, 1, 2, 4, 2, 1, 3, 4, 4, 3, 1, 1, 1, 2, 5, 2, 3, 6, 2, 2, 3, 6, 5, 1, 5, 3, 2, 3, 2, 6, 7, 2, 2, 2, 6, 3, 2, 3
Offset: 1

Views

Author

Jonathan Vos Post, Jul 06 2013

Keywords

Examples

			a(10) = 5 because A053767(10) = 4 + 6 + 8 + 9 + 10 + 12 + 14 + 15 + 16 + 18 = 112 = 2^4 * 7, which has 5 prime factors, with multiplicity.
		

Crossrefs

Programs

Formula

a(n) = A001222(A053767(n)).

A257392 Number of ways of representing n as the sum of one or more consecutive nonprime numbers (A018252).

Original entry on oeis.org

1, 2, 0, 0, 1, 2, 1, 0, 1, 1, 1, 2, 1, 0, 2, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 2, 3, 3, 1, 1, 2, 1, 2, 2, 1, 2, 1, 4, 2, 1, 2, 1, 1, 1, 4, 2, 0, 1, 4, 3, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 0, 2, 4, 3, 2, 1, 3, 2, 3, 1, 2, 1, 0, 3, 4, 2, 2, 3, 3, 1, 3, 2, 1, 2, 3, 2, 2, 1, 1, 4, 2, 2, 1, 4, 5
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 21 2015

Keywords

Examples

			a(2) = 2 because n = 2 itself is already a nonprime number (sum of 1 term), and 1 can in addition be written as A018252(1) + A018252(2), a sum of 2 consecutive nonprime numbers.
		

Crossrefs

A298270 Triangular numbers that for some k are also the sum of the first k composites.

Original entry on oeis.org

0, 10, 78, 153, 946, 177310, 450775, 13595505, 150988753, 4478601403, 5409300078, 5589152128, 76060335351, 248156250265, 1793751529485, 176149383165876, 187718592284301, 233626949305596, 11362376565228270, 18886935830647605, 1943937379018997076
Offset: 1

Views

Author

Altug Alkan, Feb 15 2018

Keywords

Examples

			10 is a term because 10 = 1 + 2 + 3 + 4 = 4 + 6.
		

Crossrefs

Intersection of A000217 and A053767.

Programs

  • Mathematica
    Join[{0},Select[Accumulate[Select[Range[10^6],CompositeQ]],OddQ[Sqrt[8#+1]]&]] (* The program generates the first 14 terms of the sequence. *) (* Harvey P. Dale, Apr 20 2024 *)
  • PARI
    lista(nn) = {my(s=0); forcomposite(n=0, nn, if(ispolygonal(s, 3), print1(s, ", ")); s += n; ); } \\ after Michel Marcus at A053767

A364879 a(n) is the smallest number k such that (sum of composites <= k) / (sum of primes <= k) >= n.

Original entry on oeis.org

2, 6, 10, 28, 126, 520, 1394, 4440, 11765, 35702, 98202, 271718, 736814, 2012631, 5478367, 14867499, 40448112, 109944053, 298170203, 810416222, 2200884471, 5980529528
Offset: 0

Views

Author

Jon E. Schoenfield, Sep 10 2023

Keywords

Comments

a(n)+1 is a prime for n = 0, 1, 2, 3, 4, 5, and 7 (thus, for n = 1, 2, 3, 4, 5, and 7, a(n) is the last of a run of consecutive composites), but not for n = 6, nor for any n in 8..16.
For n > 0, a(n) is at least the n-th in a run of consecutive composites. a(15) is the 58th in a run of 71 consecutive composites.

Examples

			Let Sp(k) and Sc(k) be the sums of the primes <= k and the composites <= k, respectively. Then the sums and ratios begin as follows:
.
   k | Sp(k) | Sc(k) | Sc(k)/Sp(k)
  ---+-------+-------+------------
   1 |     0 |     0 | (undefined)
   2 |     2 |     0 |  0/2  = 0         so a(0) =  2
   3 |     5 |     0 |  0/5  = 0
   4 |     5 |     4 |  4/5  = 0.8
   5 |    10 |     4 |  4/10 = 0.4
   6 |    10 |    10 | 10/10 = 1         so a(1) =  6
   7 |    17 |    10 | 10/17 = 0.5882...
   8 |    17 |    18 | 18/17 = 1.0588...
   9 |    17 |    27 | 27/17 = 1.5882...
  10 |    17 |    37 | 37/17 = 2.1764... so a(2) = 10
		

Crossrefs

Programs

  • Python
    from itertools import count
    from sympy import isprime
    def A364879(n):
        c, cn, m = 0, 0, n+1<<1
        for k in count(2):
            if isprime(k):
                c += k
                cn += k*m
            if k*(k+1)-1 >= cn:
                return k # Chai Wah Wu, Sep 10 2023

Formula

a(n) = min {k : (Sum_{c<=k, c composite} c)/(Sum_{p<=k, p prime} p) >= n}.
a(n) = min {k>1 : k(k+1)-1>=2*A034387(k)*(n+1)}. - Chai Wah Wu, Sep 10 2023

Extensions

a(17)-a(21) from Chai Wah Wu, Sep 10 2023

A132996 a(n) = gcd(Sum_{k=1..n} c(k), Product_{j=1..n} c(j)), where c(k) is the k-th composite.

Original entry on oeis.org

4, 2, 6, 27, 1, 1, 63, 6, 2, 112, 12, 9, 175, 1, 224, 250, 1, 5, 5, 1, 400, 14, 7, 5, 3, 6, 2, 8, 12, 3, 17, 847, 896, 22, 1, 1, 1, 6, 2, 1, 3, 3, 1, 2, 6, 31, 1, 1, 26, 4, 28, 2, 1, 1, 10, 2368, 2448, 9, 7, 2695, 20, 2, 1, 1, 31, 18, 2, 1, 9, 3596, 52, 10, 1, 1, 1, 5, 4300, 2, 74, 4624
Offset: 1

Views

Author

Leroy Quet, Nov 22 2007

Keywords

Examples

			The first 8 composites are 4,6,8,9,10,12,14,15. 4+6+8+9+10+12+14+15 = 78 = 2*3*13. So a(8) = gcd(2*3*13, 4*6*8*9*10*12*14*15) = 6.
		

Crossrefs

Programs

  • Mathematica
    lim=80;c[n_]:=n-PrimePi[n]-1;i=0;Do[Until[c[i]==m,i++];Cmp[m]=i,{m,lim}];Table[GCD[Sum[Cmp[k],{k,n}],Product[Cmp[j],{j,n}]],{n,lim}] (* James C. McMahon, Mar 09 2025 *)

Extensions

More terms from R. J. Mathar, Jan 13 2008
Previous Showing 11-20 of 22 results. Next