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

A024011 Numbers k such that the k-th prime divides the sum of the first k primes.

Original entry on oeis.org

1, 3, 20, 31464, 22096548, 1483892396791177
Offset: 1

Views

Author

Keywords

Comments

a(6) > pi(10^12) = 37607912018. - Jon E. Schoenfield, Sep 11 2008
a(6) > pi(10^14) = 3204941750802. - Giovanni Resta, Jan 09 2014
a(7) > 6.5*10^15. - Paul W. Dyson, Sep 27 2022

Examples

			The third prime, 5, divides 2 + 3 + 5 = 10, so 3 is in the sequence.
2 + 3 + 5 + 7 = 17, which is not divisible by the fourth prime, 7, so 4 is not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    s = 0; For[i = 1, i <= 5 * 10^7, i++, s = s + Prime[i]; If[Mod[s, Prime[i + 1]] == 0, Print[i + 1]]]
    With[{prs = Prime[Range[221000000]]}, PrimePi /@ Transpose[Select[ Thread[ {Accumulate[prs], prs}], Divisible[#[[1]], #[[2]]] &]][[2]]] (* Harvey P. Dale, Jul 23 2013 *)
    nMax = 50000; primeSums = Accumulate[Prime[Range[nMax]]]; Select[Range[nMax], Divisible[primeSums[[#]], Prime[#]] &] (* Alonso del Arte, Nov 11 2019 *)
  • PARI
    s=0; t=0; for(w=2,1000000000,if(isprime(w),s=s+w; t=t+1; if(s%w,print(t)),))

Extensions

a(5) from Kok Seng Chua (chuaks(AT)ihpc.nus.edu.sg), May 14 2000
a(6) from Paul W. Dyson, Apr 16 2022

A071089 Remainder when sum of first n primes is divided by n-th prime.

Original entry on oeis.org

0, 2, 0, 3, 6, 2, 7, 1, 8, 13, 5, 12, 33, 23, 46, 10, 27, 13, 32, 0, 55, 1, 44, 73, 90, 50, 28, 87, 63, 11, 69, 17, 70, 42, 41, 11, 72, 139, 75, 146, 44, 8, 9, 164, 88, 48, 7, 201, 121, 79, 224, 92, 46, 57, 170, 26, 145, 95, 216, 112, 58, 71, 293, 185, 129, 13, 255, 81, 128
Offset: 1

Views

Author

Randy L. Ekl, May 26 2002

Keywords

Comments

Conjecture: Every nonnegative integer can appear in the sequence at most finitely many times. - Thomas Ordowski, Jul 22 2013
I conjecture the opposite. Heuristically a given number should appear log log x times below x. - Charles R Greathouse IV, Jul 22 2013
In the first 10000 terms, one sees a(n) = n for n=2,7,12. Does this ever happen again? - J. M. Bergot, Mar 26 2018
Yes, it happens for n = 83408, too. - Michel Marcus, Mar 27 2018

Examples

			a[5] = 6 because s[5] = 2+3+5+7+11 = 28, p[5]=11 and q[5]= floor(28/11)=2, so a[5] = 28-11*2 = 6.
		

Crossrefs

Programs

  • GAP
    P:=Filtered([1..1000],IsPrime);
    a:=List([1..70],i->Sum(P{[1..i]}) mod P[i]); # Muniru A Asiru, Mar 27 2018
  • Maple
    s:= proc(n) option remember; `if`(n=0, 0, ithprime(n)+s(n-1)) end:
    a:= n-> irem(s(n), ithprime(n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 27 2018
  • Mathematica
    f[n_] := Mod[ Sum[ Prime[i], {i, 1, n - 1}], Prime[n]]; Table[ f[n], {n, 1, 70}] or
    a[1] = 0; a[n_] := Block[{s = Sum[Prime[i], {i, 1, n}]}, s - Prime[n]*Floor[s/Prime[n]]]; Table[ f[n], {n, 1, 70}]
    f[n_] := Mod[Plus @@ Prime@ Range@ n, Prime@ n]; Array[f, 70] (* Robert G. Wilson v, Nov 12 2016 *)
    Module[{nn=70,t},t=Accumulate[Prime[Range[nn]]];Mod[#[[1]],#[[2]]]&/@ Thread[ {t,Prime[Range[nn]]}]] (* Harvey P. Dale, Sep 19 2019 *)
  • PARI
    for(n=1,100,s=sum(i=1,n, prime(i)); print1(s-prime(n)*floor(s/prime(n)),","))
    
  • PARI
    a(n) = vecsum(primes(n)) % prime(n); \\ Michel Marcus, Mar 27 2018
    

Formula

a(n) = s[n] - p[n]*q[n], where s[n] = sum of first n primes, p[n] is n-th prime and q[n] is floor(s[n]/p[n]).
a(A024011(n)) = 0. - Michel Marcus, Jan 22 2015

Extensions

Edited by Robert G. Wilson v and Benoit Cloitre, May 30 2002

A028581 Quotients associated with A024011.

Original entry on oeis.org

1, 2, 9, 15001, 10736033, 731778483019656
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    lst={}; s=0; Do[p=Prime[n]; s=s+p; r=s/p; If[r==IntegerPart[r], AppendTo[lst, r]], {n, 1, 10^6}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)

Extensions

a(5) from Kok Seng Chua (chuaks(AT)ihpc.nus.edu.sg), May 14 2000
a(6) from Paul W. Dyson, Apr 16 2022

A028582 Dividends associated with A024011.

Original entry on oeis.org

2, 10, 639, 5537154119, 4456255064711219, 40753506500253984833129731848456
Offset: 1

Views

Author

Keywords

Crossrefs

Extensions

a(5) from Kok Seng Chua (chuaks(AT)ihpc.nus.edu.sg), May 14 2000
a(6) from Paul W. Dyson, Apr 16 2022

A274649 a(n) is the smallest odd prime that divides n + the sum of all smaller primes, or 0 if no such prime exists.

Original entry on oeis.org

5, 3, 30915397, 11339869, 3, 5, 859, 3, 41, 233, 3, 7, 4175194313, 3, 307, 5, 3, 1459, 7, 3, 5, 9907, 3, 647, 13, 3, 31, 11, 3, 193, 5, 3, 7, 2939, 3, 5, 3167, 3, 11, 7, 3, 1321, 86629, 3, 17, 5, 3
Offset: 0

Views

Author

Neil Fernandez, Nov 10 2016

Keywords

Comments

From David A. Corneth, Nov 12 2016: (Start)
a(n) is the smallest odd prime p such that p|(n + A007504(primepi(p) - 1)) or zero if no such p exists.
If a(n) = p then a(n + p) <= p. (End)
If n is congruent to 1 (mod 3), then a(n)=3.
a(2), a(3) and a(12) were found by Jack Brennen.
From Robert G. Wilson v, Nov 13 2016: (Start)
If n == 1 (mod 3) then a(n) = 3;
If n == 0 (mod 5) then a(n) = 5;
If n == 4 (mod 7) then a(n) = 7;
if n == 5 (mod 11) then a(n) = 11;
if n == 11 (mod 13) then a(n) = 13;
if n == 10 (mod 17) then a(n) = 17;
if n == 18 (mod 19) then a(n) = 19;
if n == 23 (mod 23) then a(n) = 23;
in that order, i.e., from smallest to greatest prime modulus, etc.
First occurrence of p > 2: 1, 0, 11, 27, 24, 44, 56, 84, 161, ..., .
a(47) > 10^11. (End)

Examples

			a(6) = 859 because 859 is the smallest odd prime that divides the sum of 6 + (sum of all primes smaller than itself).
a(8) = 41 because 8+2+3+5+7+11+13+17+19+23+29+31+37+41 = 246 and 246/41 = 6.
		

Crossrefs

Cf. A016777 (n==1 (mod 3))

Programs

  • Mathematica
    f[n_] := Block[{p = 3, s = n +2}, While[ Mod[s, p] != 0, s = s + p; p = NextPrime@ p]; p]; Array[f, 47, 0] (* Robert G. Wilson v, Nov 12 2016 *)
  • Python
    # see link for an alternate that searches in parallel to a limit
    from sympy import nextprime
    def a(n):
      psum, p = 2, 3
      while (n + psum)%p: psum, p = psum + p, nextprime(p)
      return p
    for n in range(12):
      print(a(n), end=", ") # Michael S. Branicky, May 03 2021

A274995 a(n) is the smallest odd prime that divides (-n) + the sum of all smaller primes, or 0 if no such prime exists.

Original entry on oeis.org

5, 19, 3, 7, 82811, 3, 11, 17, 3, 191, 5, 3, 37, 29, 3, 5, 69431799799, 3, 1105589, 28463, 3, 431, 2947308589, 3, 7, 5, 3, 59, 11, 3, 5, 7, 3, 41
Offset: 0

Views

Author

Neil Fernandez, Nov 11 2016

Keywords

Comments

From Robert G. Wilson v, Nov 15 2016: (Start)
If n == 2 (mod 3) then a(n) = 3;
If n == 0 (mod 5) then a(n) = 5;
If n == 3 (mod 7) then a(n) = 7;
If n == 6 (mod 11) then a(n) = 11;
If n == 2 (mod 13) then a(n) = 13;
If n == 7 (mod 17) then a(n) = 17;
If n == 1 (mod 19) then a(n) = 19;
If n == 8 (mod 23) then a(n) = 23;
in that order; i.e., from smaller to greater prime modulus, etc.
First occurrence of p>2: 2, 0, 3, 6, 54, 7, 1, 123, 13, 36, 12, 33, 453, 46, ..., .
(End)
The congruence classes in the above list, modulo the prime bases, namely 2, 0, 3, 6, 2, ..., are given by A071089, in which each term is the remainder when the sum of the first n primes is divided by the n-th prime. - Neil Fernandez, Nov 23 2016

Examples

			a(1) = 19 because 19 is the smallest odd prime that divides the sum of (-1) + (sum of all primes smaller than itself), that is, -1 + 58 = 57.
a(7) = 17 because -7 + 2 + 3 + 5 + 7 + 11 + 13 + 17 = 49 and 49/7 = 7.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 3, s = 2 - n}, While[ Mod[s, p] != 0, s = s + p; p = NextPrime@ p]; p]; Array[f, 16, 0] (* Robert G. Wilson v, Nov 15 2016 *)
  • PARI
    sump(n) = s = 0; forprime(p=2, n-1, s+=p); s;
    a(n) = {my(p=3); while ((sump(p)-n) % p, p = nextprime(p+1)); p;} \\ Michel Marcus, Nov 12 2016
    
  • PARI
    a(n)=my(s=2); forprime(p=3,, if((s-n)%p==0, return(p)); s+=p) \\ Charles R Greathouse IV, Nov 15 2016

Extensions

a(16)-a(33) from Charles R Greathouse IV, Nov 15 2016

A330580 Composite numbers n that divide the sum of all composite numbers <= n.

Original entry on oeis.org

4, 9, 604, 1849, 7123, 29588, 71056, 317238, 945414, 1347895, 3567705, 4624025, 8518502, 1523051853, 4353560959, 7537630621, 24916885136, 41483524658, 513849020166, 1021228997529, 1137756574012, 1185967711155, 1581191501535, 1705826324526
Offset: 1

Views

Author

Rémy Sigrist, Dec 18 2019

Keywords

Crossrefs

Cf. A002808, A007506 (prime variant), A330579.

Programs

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

Formula

a(n) = A002808(A330579(n)).

Extensions

a(15)-a(24) from Giovanni Resta, Dec 20 2019

A350878 Integers m that divide the sum of values d*p < m, where d is a divisor of m, p is a prime, and d*p does not divide m.

Original entry on oeis.org

1, 2, 5, 10, 18, 24, 32, 60, 71, 100, 512, 2990, 9910, 10031, 12618, 32674, 53586, 153878, 223500, 312608, 369119, 386110, 466569, 4491817, 7068356, 8765871, 65311881
Offset: 1

Views

Author

Devansh Singh, Jan 20 2022

Keywords

Comments

Conjecture: The sum of values d*p < m in the definition of the sequence is equal to m for m = 5 only. True for m <= 15000.
A007506 is the subsequence of the prime terms of this sequence. - Amiram Eldar, Jan 20 2022
a(28) > 10^8. - David A. Corneth, Jan 21 2022

Crossrefs

Programs

  • Mathematica
    q[n_] := Module[{ds = Divisors[n], s = 0, r}, Do[r = n/d; ps = Select[Range[2, r], PrimeQ[#] && ! Divisible[n, d*#] &]; s += Total[d*ps], {d, ds}]; Divisible[s, n]]; Select[Range[3000], q] (* Amiram Eldar, Jan 20 2022 *)
  • PARI
    isok(m) = {my(d=divisors(m), s=0); forprime(p=2, m, for(k=1, #d, my(x=d[k]*p); if ((x < m) && (m % x), s+=x););); (s % m) == 0;} \\ Michel Marcus, Jan 21 2022
    
  • PARI
    \\ See Corneth link \\ David A. Corneth, Jan 21 2022
  • Python
    import sympy
    A350878=[]
    for m in range(1,15001):
        sum=0
        primes_lessthan_m_by2 = list(sympy.primerange(2,-(m//-2)))
        primes_between_m_by2_and_m = list(sympy.primerange(m//2+1,m))
        divisors_of_m=sympy.divisors(m,generator=False)
        divisors_of_m.remove(m)
        if m%2==0:
            divisors_of_m.remove(m//2)
        for p in primes_between_m_by2_and_m:
            sum+=p
        for p in primes_lessthan_m_by2:
            for d in divisors_of_m:
                if p< m//d and m%(d*p)!=0:
                    sum+=d*p
        if sum%m==0:
           A350878.append(m)
    print(A350878)
    

Extensions

a(16)-a(20) from Amiram Eldar, Jan 21 2022
a(21)-a(27) from David A. Corneth, Jan 21 2022

A173663 Numbers k that divide the k-th partial sum of all semiprimes.

Original entry on oeis.org

1, 2, 9, 19, 29, 44, 632, 11829, 19262, 25286, 26606, 29824, 247273, 310556, 491240, 1419166, 1601984, 9509238, 113333959, 220531559, 1034662494, 8323088842, 13102043650, 14053673678, 23505911647
Offset: 1

Views

Author

Jonathan Vos Post, Nov 24 2010

Keywords

Comments

a(26) > 3*10^10. - Donovan Johnson, Nov 26 2010

Examples

			a(1) = 1 because 1 divides the first semiprime 4, trivially also the first partial sum of all semiprimes.
a(2) = 2 because A062198(2) = A001358(1) + A001358(2) = 4 + 6 = 10 is divisible by 2.
a(3) = 9 because A062198(9) = 126 = 2 * 3^2 * 7 is divisible by 9.
a(4) = 19 because A062198(19) = 532 = 2^2 * 7 * 19 is divisible by 19.
a(5) = 29 because A062198(29) = 1247 = 29 * 43 is divisible by 29.
a(6) = 44 because A062198(44) = 2904 = 44 * 66.
		

Crossrefs

Programs

  • Mathematica
    SemiprimeQ[n_Integer] := If[Abs[n]<2, False, (2==Plus@@Transpose[FactorInteger[Abs[n]]][[2]])]; nn=10^6; sm=0; cnt=0; Reap[Do[If[SemiprimeQ[n], cnt++; sm=sm+n; If[Divisible[sm, cnt], Sow[cnt]]], {n, nn}]][[2, 1]]
  • PARI
    s=0; p=0; for(n=1, 1e9, until(bigomega(p++)==2,); (s+=p)%n || print1(n", ")) \\ M. F. Hasler, Nov 24 2010

Formula

{k: k | Sum_{i=1..k} A001358(i)}.

Extensions

Extended by T. D. Noe, Nov 24 2010
a(1)-a(17) double-checked and a(18) from M. F. Hasler, Nov 25 2010
a(19) from Ray Chandler, Nov 25 2010
a(20)-a(25) from Donovan Johnson, Nov 26 2010

A234540 Nonprimes k that divide the sum of the nonprimes up to k.

Original entry on oeis.org

1, 22, 25, 118, 414, 2745, 10623, 63201, 1039161, 1693864, 2285297, 52962021, 66998865, 232974402, 315796805, 336125877, 834972771, 1233903294, 1309750075, 1617454215, 2056836133, 5455816485, 8589896196, 9030058217, 10622144467, 12324258770, 33725308558
Offset: 1

Views

Author

Keywords

Comments

Standard heuristics suggest that this sequence is infinite. - Charles R Greathouse IV, Dec 29 2013

Examples

			a(2) = 22 because 1 + 4 + 6 + 8 + 9 + 10 + ... + 22 = 176 and 176/22 = 8.
		

Crossrefs

Cf. A007506.

Programs

  • Mathematica
    s = 0; Do[If[PrimeQ[k], Continue[]]; s += k; If[Mod[s, k] == 0, Print[k]], {k, 10^10}] (* Gomez *)
    Select[Range[10^4], Not[PrimeQ[#]] && Divisible[Sum[Boole[Not[PrimeQ[m]]]m, {m, #}], #] &] (* Alonso del Arte, Dec 29 2013 *)
  • PARI
    v=List([s=1]); forcomposite(n=4,1e9,if(s%n==0, listput(v,n)); s+=n); Vec(v) \\ Charles R Greathouse IV, Dec 29 2013

Extensions

a(14)-a(27) from Donovan Johnson, Dec 30 2013
Showing 1-10 of 11 results. Next