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 41-50 of 54 results. Next

A140235 Partial sum of non-semiprimes A100959.

Original entry on oeis.org

1, 3, 6, 11, 18, 26, 37, 49, 62, 78, 95, 113, 132, 152, 175, 199, 226, 254, 283, 313, 344, 376, 412, 449, 489, 530, 572, 615, 659, 704, 751, 799, 849, 901, 954, 1008, 1064, 1123, 1183, 1244, 1307, 1371, 1437, 1504, 1572, 1642, 1713, 1785, 1858, 1933, 2009
Offset: 1

Views

Author

Jonathan Vos Post, May 13 2008

Keywords

Comments

This is to semiprimes A001358 as A051352 is to primes A000040. Equivalently, this is to non-semiprimes A100959 as A051349 is to nonprimes A018252.

Examples

			a(5) = 18 = 1 + 2 + 3 + 5 + 7.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Select[Range[100],PrimeOmega[#]!=2&]] (* Harvey P. Dale, Aug 22 2021 *)

Formula

a(n) = Sum{k=1..n} A100959(k).

Extensions

Corrected and edited by Giovanni Resta, Jun 20 2016

A228357 Numbers n such that sum of all primes <=n is not prime.

Original entry on oeis.org

1, 5, 6, 11, 12, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 41, 42, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85
Offset: 1

Views

Author

Vincenzo Librandi, Aug 21 2013

Keywords

Examples

			6 is in the sequence since 2+3+5=10 is not prime.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..120] | not IsPrime(s) where s is &+PrimesUpTo(n)];
  • Mathematica
    t = {}; s = 0; Do[If [PrimeQ[n], s+ = n]; If[!PrimeQ[s], AppendTo[t, n]], {n, 120}]; t
    Position[Accumulate[Table[If[PrimeQ[n],n,0],{n,100}]],?(!PrimeQ[ #]&)]// Flatten//Rest (* _Harvey P. Dale, Jul 02 2018 *)

A276355 Sum of primes between 100*n and 100*n + 99.

Original entry on oeis.org

1060, 3167, 4048, 5612, 7649, 7760, 10316, 10466, 12719, 13330, 16826, 13780, 18775, 14759, 24773, 18666, 24679, 21022, 22230, 25413, 28750, 21398, 33781, 35381, 24452, 28057, 39905, 38474, 34168, 32407, 36560, 31544, 35669, 50157, 38009, 49688, 47439, 44994
Offset: 0

Views

Author

Bhushan Bade, Aug 31 2016

Keywords

Comments

The first occurrence of 0 in this sequence is as a(16718). - Robert Israel, Dec 28 2022

Examples

			Sum of primes in first interval of one hundred numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 is equal to first term i.e 1060.
		

Crossrefs

Programs

  • Maple
    R:= NULL: m:= 0: p:= 0: s:= 0:
    while m <= 100 do
      p:= nextprime(p);
      r:= floor(p/100);
      if r = m then
        s:= s + p;
      else
        R:= R, s;
        if m < r-1 then R:= R, 0$(r-1-m) fi;
        s:= p;
        m:= r;
      fi
    od:
    R;
  • Mathematica
    Table[Total@ Select[Range[#, # + 99] &[100 n], PrimeQ], {n, 0, 37}] (* Michael De Vlieger, Sep 01 2016 *)

Formula

a(n) = A034387(100*(n+1)) - A034387(100*n). - Robert Israel, Aug 31 2016

Extensions

Definition by Omar E. Pol, Aug 31 2016

A334122 a(n) is the sum of all primes <= n, mod n.

Original entry on oeis.org

0, 0, 2, 1, 0, 4, 3, 1, 8, 7, 6, 4, 2, 13, 11, 9, 7, 4, 1, 17, 14, 11, 8, 4, 0, 22, 19, 16, 13, 9, 5, 0, 28, 24, 20, 16, 12, 7, 2, 37, 33, 28, 23, 17, 11, 5, 46, 40, 34, 28, 22, 16, 10, 3, 51, 45, 39, 33, 27, 20, 13, 5, 60, 53, 46, 39, 32, 24, 16, 8, 0, 63, 55
Offset: 1

Views

Author

Christoph Schreier, Apr 15 2020

Keywords

Examples

			a(7) = (2+3+5+7) mod 7 = 17 mod 7 = 3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) b(n):= `if`(n<2, 0, b(n-1)+`if`(isprime(n), n, 0)) end:
    a:= n-> irem(b(n), n):
    seq(a(n), n=1..80);  # Alois P. Heinz, Apr 15 2020
  • Mathematica
    Mod[Accumulate[(# * Boole @ PrimeQ[#]) & /@ (r = Range[100])], r] (* Amiram Eldar, Apr 15 2020 *)
  • PARI
    a(n) = my(np=primepi(n)); vecsum(primes(np)) % n; \\ Michel Marcus, Apr 16 2020
  • Python
    from sympy import primerange
    a = lambda n: sum(primerange(n + 1)) % n # David Radcliffe, May 10 2025
    

Formula

a(n) = A034387(n) mod n.

A349214 a(n) = Sum_{k=1..n} k^c(k), where c is the prime characteristic (A010051).

Original entry on oeis.org

1, 3, 6, 7, 12, 13, 20, 21, 22, 23, 34, 35, 48, 49, 50, 51, 68, 69, 88, 89, 90, 91, 114, 115, 116, 117, 118, 119, 148, 149, 180, 181, 182, 183, 184, 185, 222, 223, 224, 225, 266, 267, 310, 311, 312, 313, 360, 361, 362, 363, 364, 365, 418, 419, 420, 421, 422, 423, 482, 483, 544
Offset: 1

Views

Author

Wesley Ivan Hurt, Nov 10 2021

Keywords

Comments

For k in 1 <= k <= n, add k if k is prime, otherwise add 1. For example a(6) = 1 + 2 + 3 + 1 + 5 + 1 = 13.

Crossrefs

Partial sums of A089026.

Programs

  • Mathematica
    a[n_] := Sum[k^Boole[PrimeQ[k]], {k, 1, n}]; Array[a, 60] (* Amiram Eldar, Nov 11 2021 *)
  • PARI
    a(n) = sum(k=1, n, if (isprime(k), k, 1)); \\ Michel Marcus, Nov 11 2021
    
  • Python
    from sympy import primerange
    def A349214(n):
        p = list(primerange(2,n+1))
        return n-len(p)+sum(p) # Chai Wah Wu, Nov 11 2021

Formula

a(n) = A034387(n) + A062298(n). - Wesley Ivan Hurt, Nov 23 2021

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

A383641 a(n) is the difference between the sum of even composites and the sum of the odd composites in the first n positive integers.

Original entry on oeis.org

0, 0, 0, 4, 4, 10, 10, 18, 9, 19, 19, 31, 31, 45, 30, 46, 46, 64, 64, 84, 63, 85, 85, 109, 84, 110, 83, 111, 111, 141, 141, 173, 140, 174, 139, 175, 175, 213, 174, 214, 214, 256, 256, 300, 255, 301, 301, 349, 300, 350, 299, 351, 351, 405, 350, 406, 349, 407, 407
Offset: 1

Views

Author

Felix Huber, May 08 2025

Keywords

Examples

			Of the first 9 positive integers, 4, 6, and 8 are even composites and 9 is an odd composite, so a(9) = 4 + 6 + 8 - 9 = 9.
		

Crossrefs

Programs

  • Maple
    A383641:=n->`if`(n=1,0,floor((n-2)/2)-n*(n mod 2)+add(ithprime(i),i=2..NumberTheory:-pi(n)));seq(A383641(n),n=1..59);
  • Mathematica
    lim=59;cn=Select[Range[lim],CompositeQ];a[n_]:=Total[Select[cn,EvenQ[#]&&#<=n&]]-Total[Select[cn,OddQ[#]&&#<=n&]];Array[a,lim] (* James C. McMahon, May 14 2025 *)

Formula

a(n) = floor((n-2)/2) - n*(n mod 2) + Sum_{i=2..pi(n)} prime(i) for n > 1.
a(n) = A004526(n) - A193356(n) - A010701(n) + A034387(A000720(n)) for n > 1.
a(n) = Sum_{i=1..n} ((-1)^i*i*A066247(i)).

A073700 a(1) = 1, a(n) = Floor[(Sum of composite numbers up to n)/(Sum of primes up to n)].

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Amarnath Murthy, Aug 12 2002

Keywords

Comments

Though the sequence is not monotonically increasing the average value increases and a derived sequence could be the smallest value of k for which a(k) = n.
Note 1 is neither composite nor prime.

Examples

			a(10) = floor((4+6+8+9+10)/(2+3+5+7)) = floor(37/17) = 2.
		

Crossrefs

Programs

  • Maple
    a := 0:b := 0:for i from 2 to 300 do if isprime(i) then a := a+i: else b := b+i:fi: c[i] := floor(b/a):od:c[1] := 1:seq(c[j],j=1..300);
  • Mathematica
    Module[{nn=110,pr,comp},pr=Prime[Range[PrimePi[nn]]];comp=Complement[Range[ 2,nn], pr]; Join[{1}, Table[Floor[Total[Select[comp,#<=n&]]/Total[Select[pr,#<=n&]]],{n,2,nn}]]] (* Harvey P. Dale, Feb 22 2013 *)
    Join[{1}, Table[t1 = Select[x = Range[n], PrimeQ]; Floor[Divide @@ Plus @@@ {Rest[Complement[x, t1]], t1}], {n, 2, 105}]] (* Jayanta Basu, Jul 07 2013 *)

Formula

a(n) = floor(A101256(n)/A034387(n)). - Jason Yuen, Aug 20 2024

Extensions

More terms from Sascha Kurz, Aug 15 2002

A082089 a(n)-th prime is the fixed point if function A008472[=sum of prime factors with no repetition] is iterated when started at factorial of n-th prime.

Original entry on oeis.org

1, 3, 4, 7, 2, 13, 11, 3, 4, 3, 4, 45, 1, 60, 14, 4, 3, 3, 21, 1, 4, 4, 6, 3, 4, 3, 2, 4, 6, 2, 4, 4, 4, 4, 105, 4, 4, 3, 4, 4, 3, 4, 3, 4, 1, 4, 8, 2, 2, 19, 3, 1, 20, 14, 4, 20, 52, 4, 4, 977, 1, 3, 65, 1108, 1, 2, 46, 3, 3, 1, 3, 1, 2, 4, 829, 2, 25, 3, 8, 25, 4, 378, 3, 3, 29, 3, 6, 8, 1, 1, 28
Offset: 2

Views

Author

Labos Elemer, Apr 09 2003

Keywords

Comments

a(n) < n holds usually, except few large values arising unexpectedly.

Examples

			n=100, p(100)=541, starts at factorial of 100th prime and ends in 24133, the 2687th prime, so a(100)=2687;
n=99, initial value=523!, fixed point is 19, the 8th prime, a(99)=8.
		

Crossrefs

Programs

  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]] lf[x_] := Length[FactorInteger[x]] ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}] sopf[x_] := Apply[Plus, ba[x]] Table[PrimePi[FixedPoint[sopf, Prime[w]! ]], {w, 2, 100}]

Formula

a(n) = A000720(A082087(A000142(A000040(n)))) = pi(A082087(p(n)!)).

A115333 Sum of primes that do not divide n and are less than the largest prime dividing n.

Original entry on oeis.org

0, 0, 2, 0, 5, 0, 10, 0, 2, 3, 17, 0, 28, 8, 2, 0, 41, 0, 58, 3, 7, 15, 77, 0, 5, 26, 2, 8, 100, 0, 129, 0, 14, 39, 5, 0, 160, 56, 25, 3, 197, 5, 238, 15, 2, 75, 281, 0, 10, 3, 38, 26, 328, 0, 12, 8, 55, 98, 381, 0, 440, 127, 7, 0, 23, 12, 501, 39, 74, 3, 568, 0, 639, 158, 2, 56, 10
Offset: 1

Views

Author

Leroy Quet, Mar 05 2006

Keywords

Comments

When n is prime, n = largest prime dividing n; hence a(n) is the sum of all primes less than n = A034387(n)-n. a(n) = SUM{p such that p is in A000040 AND NOT(p|n) AND p < A006530(n)}. - Jonathan Vos Post, Mar 08 2006
The zeros give A055932: All prime divisors are consecutive primes starting at 2. - Robert G. Wilson v, May 01 2006

Examples

			The primes < 7 and coprime to 7 are 2, 3 and 5. So a(7) = 2+3+5 = 10.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Plus @@ Complement[Prime@ Range@ PrimePi[ Max[First /@ FactorInteger@n] - 1], First /@ FactorInteger@n]; Array[f, 77] (* Hans Havermann, Mar 06 2006 *)

Extensions

More terms from Hans Havermann, Mar 06 2006
Previous Showing 41-50 of 54 results. Next