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

A143851 Primes p that divide the sum of their residues modulo all smaller primes (=A024934(p)).

Original entry on oeis.org

2, 13, 167, 2239, 439867, 724031017, 1990127567, 54892225873
Offset: 1

Views

Author

Neil Fernandez, Sep 03 2008

Keywords

Comments

Also, primes p such that p divides A024924(p). The prime terms of A065132.

Examples

			13 is congruent to 1,1,3,6 and 2, modulo 2,3,5,7 and 11 respectively. 1+1+3+6+2=13, which is a multiple of the original number, 13. So the original number, is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    For[n = 1, n < 1000001, n++, p = Prime[n]; m = Mod[Sum[Mod[p, Prime[i]], {i, 1, n - 1}], p]; If[m == 0, Print[p]]]

Extensions

a(6)-a(8) from Max Alekseyev, Feb 10 2012

A383844 a(n) is the number of occurences of n in A024934.

Original entry on oeis.org

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

Views

Author

Miles Englezou, May 12 2025

Keywords

Comments

Every k in A024934 is the sum of a tuple (x_1, ..., x_t) for prime(t) <= k < prime(t+1), where x_i = k mod prime(i). The tuples can be seen combinatorially as sets of t counters where the i-th counter cycles through 0 to prime(i)-1.
Since A024934(n) > n for n > 21, the set of numbers k for which A024934(k) = n is bounded above by n for those n, though smaller bounds are possible.
It is interesting to compare A024934 to A049802 (and likewise the current sequence with A383327). Every m in A049802 is also the sum of a tuple of congruences except the moduli are ascending powers of 2. Ordered by divisibility, the set of moduli in A049802 therefore form a chain (i.e., they are totally ordered) whilst the set of moduli in A024934 form an antichain (no one modulus divides any other). These opposed orders mean the two sequences behave quite differently.
Comparison of A049802 and A383327 vs. A024934 and {a(n)}:
- 0 appears infinitely many times in A049802, for every m = 2^n. Therefore 0 is not a term of A383327.
- A049802(2^n+1) = n. Therefore every n appears at least once in A049802.
- It is likely that every n appears at least once in A383327, however this is currently conjectural.
- If A049802(k) = m for 2^r-2^(r-2) <= k < 2^r, and if the rightmost summand in the tuple of m is x, then for s >= 0, A049802(k+2^((r-1)+s)) = m + x*(s+1).
A024934 and {a(n)}:
- 0 appears 3 times in A024934, for n = 0, 1, 2. Therefore a(0) = 3.
- It is not true that every n appears at least once in A024934 (e.g., 2 and 5 are not terms), and this is likely to be the case for infinitely many n, meaning it is likely that a(n) = 0 for infinitely many n.
- It appears to be unlikely that a(k) = n for every n: for 0 < n < 3500, a(n) <= 3 (and a(n) = 3 only for n = 0, 1, 8, 37, 781).

Examples

			 n | a(n) | k such that A024934(k) = n
---+------+---------------------------
 0 |  3   | {0, 1, 2}
 1 |  3   | {3, 4, 6}
 2 |  0   | {}
 3 |  1   | {5}
 4 |  2   | {7, 10}
 5 |  0   | {}
 6 |  1   | {8}
 7 |  1   | {9}
 8 |  3   | {11, 12, 15}
 9 |  0   | {}
10 |  1   | {14}
11 |  0   | {}
12 |  1   | {16}
13 |  1   | {13}
14 |  0   | {}
15 |  0   | {}
16 |  0   | {}
17 |  0   | {}
18 |  1   | {17}
19 |  0   | {}
20 |  1   | {18}
--------------------------------------
Illustration of some tuples
 n | A024934(n) |     tuple of n
---+------------+---------------------
 0 |     0      | ()
 1 |     0      | ()
 2 |     0      | (0)
 3 |     1      | (1 0)
 4 |     1      | (0 1)
 5 |     3      | (1 2 0)
 6 |     1      | (0 0 1)
 7 |     4      | (1 1 2 0)
 8 |     6      | (0 2 3 1)
 9 |     7      | (1 0 4 2)
10 |     4      | (0 1 0 3)
11 |     8      | (1 2 1 4 0)
12 |     9      | (0 0 2 5 1)
13 |    13      | (1 1 3 6 2 0)
14 |    10      | (0 2 4 0 3 1)
15 |     8      | (1 0 0 1 4 2)
16 |    12      | (0 1 1 2 5 3)
17 |    18      | (1 2 2 3 6 4 0)
18 |    20      | (0 0 3 4 7 5 1)
19 |    27      | (1 1 4 5 8 6 2 0)
20 |    28      | (0 2 0 6 9 7 3 1)
		

Crossrefs

Programs

  • PARI
    a(n) = my(f, S=[], b); (f(m) = my(r=0); forprime(p=2, m, r+=m%p); return(r)); if(n<=21, b=26, b=n); for(k=0, b, if(f(k)==n, S=concat(S, k))); return(#S)

A072267 Duplicate of A024934.

Original entry on oeis.org

0, 0, 1, 1, 3, 1, 4, 6, 7, 4, 8, 8, 13, 10, 8, 12, 18, 20, 27, 28, 26, 21, 29, 33, 37, 31, 37, 37
Offset: 2

Views

Author

Keywords

A024924 a(n) = Sum_{k=1..n} prime(k)*floor(n/prime(k)).

Original entry on oeis.org

0, 0, 2, 5, 7, 12, 17, 24, 26, 29, 36, 47, 52, 65, 74, 82, 84, 101, 106, 125, 132, 142, 155, 178, 183, 188, 203, 206, 215, 244, 254, 285, 287, 301, 320, 332, 337, 374, 395, 411, 418, 459, 471, 514, 527, 535, 560, 607, 612, 619, 626, 646, 661, 714, 719, 735, 744, 766, 797, 856
Offset: 0

Views

Author

Keywords

Comments

For n > 2, sum of all distinct prime factors composing numbers from 2 to n.

References

  • M. Kalecki, On certain sums extended over primes or prime factors (in Polish), Prace Mat., Vol. 8 (1963/64), pp. 121-129.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Chapter IV, p. 144.

Crossrefs

Partial sums of A008472.

Programs

  • Magma
    [0] cat [ &+[ NthPrime(k)*Floor(n/NthPrime(k)): k in [1..n]]: n in [1..60]]; // Vincenzo Librandi, Jul 28 2019
    
  • Mathematica
    Join[{0}, Table[Sum[Prime[k] Floor[n / Prime[k]], {k, 1, n}], {n, 1, 60}]] (* Vincenzo Librandi, Jul 28 2019 *)
    Join[{0}, Accumulate[Table[Sum[p, {p, Select[Divisors[n], PrimeQ]}], {n, 1, 100}]]] (* Vaclav Kotesovec, May 20 2020 *)
  • PARI
    a(n) = sum(k=1, n, prime(k)*(n\prime(k))); \\ Michel Marcus, Mar 01 2015
    
  • PARI
    a(n)=my(s); forprime(p=2,n, s+=n\p*p); s \\ Charles R Greathouse IV, Jun 26 2020
    
  • Python
    from sympy import prime
    def A024924(n): return sum((p:=prime(k))*(n//p) for k in range(1,n+1)) # Chai Wah Wu, Sep 18 2023

Formula

a(n) = n*A000720(n) - A024934(n). - Max Alekseyev, Feb 10 2012
a(n) = A034387([n/1]) + A034387([n/2]) + ... + A034387([n/n]). Terms can be computed efficiently with the following formula: a(n) = A034387([n/1]) + ... + A034387([n/m]) - m*A034387([n/m]) + Sum_{prime p<=n/m} p*[n/p], where m = [sqrt(n)]. - Max Alekseyev, Feb 10 2012
G.f.: Sum_{k >=1} (prime(k)*x^prime(k)/(1-x^prime(k)))/(1-x). - Vladeta Jovovic, Aug 11 2004
a(n) ~ ((Pi^2 + o(1))/12) * n^2/log(n) (Kalecki, 1963/64). - Amiram Eldar, Mar 04 2021

Extensions

a(0)=0 prepended by Max Alekseyev, Feb 10 2012

A033955 a(n) = sum of the remainders when the n-th prime is divided by primes up to the (n-1)-th prime.

Original entry on oeis.org

0, 1, 3, 4, 8, 13, 18, 27, 29, 46, 56, 70, 74, 88, 98, 134, 147, 171, 200, 217, 252, 274, 309, 323, 348, 418, 448, 471, 522, 571, 629, 685, 739, 777, 793, 853, 954, 997, 1002, 1120, 1148, 1220, 1338, 1419, 1466, 1540, 1615, 1573, 1633, 1707, 1825, 1892, 1986
Offset: 1

Views

Author

Armand Turpel (armandt(AT)unforgettable.com)

Keywords

Comments

Row sums of A207409. - Bob Selcoe, Apr 14 2014

Examples

			a(5) = 8. The remainders when the fifth prime 11 is divided by 2, 3, 5, 7 are 1, 2, 1, 4, respectively and their sum = 8.
		

Crossrefs

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..200)]:
    f:= proc(n) local j;  add(P[n] mod P[j],j=1..n-1) end proc:
    map(f, [$1..200]); # Robert Israel, Dec 29 2020
  • Mathematica
    a[n_] := Sum[Mod[Prime[n], Prime[i]], {i, 1, n-1}]
    Table[Total[Mod[Prime[n],Prime[Range[n-1]]]],{n,60}] (* Harvey P. Dale, Mar 07 2018 *)
  • PARI
    {for(n=1, 200, print1(sum(k=1, n, prime(n)%prime(k)), ", "))}
    
  • Python
    from sympy import prime; {print(sum(prime(n)%prime(k) for k in range(1,n)), end =', ') for n in range(1,54)} # Ya-Ping Lu, May 05 2024

Formula

a(n) = Sum_{k=1..n-1} ( prime(n) mod prime(k) ).

Extensions

Edited by Dean Hickerson, Mar 02 2002

A067439 a(n) = sum of all the remainders when n is divided by positive integers less than and coprime to n.

Original entry on oeis.org

0, 0, 1, 1, 4, 1, 8, 6, 9, 5, 22, 8, 28, 15, 19, 20, 51, 20, 64, 30, 39, 33, 98, 33, 83, 56, 89, 55, 151, 46, 167, 95, 107, 95, 150, 71, 233, 120, 172, 106, 297, 92, 325, 163, 186, 162, 403, 144, 358, 189, 279, 217, 505, 173, 375, 230, 342, 276, 635, 165, 645, 338
Offset: 1

Views

Author

Amarnath Murthy, Jan 29 2002

Keywords

Examples

			a(8) = 6. The remainders when 8 is divided by the coprime numbers 1, 3, 5 and 7 are 0, 2, 3 and 1, whose sum = 6.
		

Crossrefs

Programs

  • Maple
    a := n -> add(ifelse(igcd(n, i) = 1, irem(n, i), 0), i = 1..n-1):
    seq(a(n), n = 1..62);  # Peter Luschny, May 14 2025
  • Mathematica
    a[n_] := Sum[If[GCD[i, n]>1, 0, Mod[n, i]], {i, 1, n-1}]
    Table[Total[Mod[n,#]&/@Select[Range[n-1],CoprimeQ[#,n]&]],{n,70}] (* Harvey P. Dale, May 22 2012 *)
  • PARI
    a(n)=sum(i=1,n-1,if(gcd(n,i)==1,n%i)) \\ Charles R Greathouse IV, Jul 17 2012

Formula

From Ridouane Oudra, May 14 2025: (Start)
a(n) = A004125(n) - A072514(n).
a(n) = Sum_{d|n} d*mu(d)*A004125(n/d).
a(n) = Sum_{d|n} mu(d)*f(n,d), where f(n,d) = Sum_{i=1..n/d} (n mod d*i).
a(p) = A004125(p), for p prime.
a(p^k) = A004125(p^k) - p*A004125(p^(k-1)), for p prime and k >= 0.
a(p^k) = A072514(p^(k+1))/p - A072514(p^k), for p prime and k >= 0. (End)

Extensions

Edited by Dean Hickerson, Feb 15 2002

A136021 Sum of the proper prime divisors of all numbers up to 10^n.

Original entry on oeis.org

0, 19, 1047, 64373, 4481640, 340900331, 27436000061, 2292176360707, 196818634871899, 17246903703574357, 1534951275195670059, 138293592048140425181, 12583738258227621100170, 1154435823206834353336284, 106638384745041347295504523
Offset: 0

Views

Author

Enoch Haga, Dec 10 2007

Keywords

Comments

The sum of the distinct prime factors less than k for all 1 <= k <= 10^n, as tabulated for the individual k in A105221.

Examples

			a(1)=19 because 10^1=10 and the factors to be summed are 2 for 4, added to 2 and 3 for 6, added to 2 for 8, added to 3 for 9, added to 2 and 5 for 10.
		

Crossrefs

Programs

  • Maple
    A105221 := proc(n) local a,pfs,i ; a :=0 ; pfs := ifactors(n)[2] ; for i in pfs do if op(1,i) <> 1 and op(1,i) <> n then a := a+op(1,i) ; fi ; od: RETURN(a) ; end: A136021 := proc(n) add(A105221(i),i=2..10^n) ; end: for n from 1 do print(n,A136021(n)) ; od: # R. J. Mathar, Dec 12 2007
  • Mathematica
    f[n_] := Plus @@ (First@# & /@ FactorInteger@ n); k = 2; s = 0; lst = {}; Do[While[k < 10^n + 1, If[ ! PrimeQ@k, s = s + f@k]; k++ ]; AppendTo[ lst, s]; Print[{n, s}], {n, 8}] (* Robert G. Wilson v, Aug 06 2010 *)
  • UBASIC
    10 'distinct prime factors of composites <=10^n 20 S=0:N=N+1:Z=N\2 30 'print N; 40 for F=1 to Z:Q=N/F: if Q<>int(Q) then 60 50 S=S+F: if F=prmdiv(F) and F>1 then C=C+1:G=G+F 60 next F 70 'print C,G 80 if N=10^1 or N=10^2 or N=10^3 or N=10^4 or N=10^5 or N=10^6 or N=10^7 then print G:stop 90 C=0 100 goto 20

Formula

a(n) = Sum_{k=1..10^n} A105221(k). - R. J. Mathar, Dec 12 2007
a(n) = Sum_{prime p<10^n} p*floor((10^n-p)/p) = A006880(n)*10^n - A024934(10^n) - A046731(n). - Max Alekseyev, Jan 30 2012

Extensions

One more term from R. J. Mathar, Dec 12 2007
Edited by R. J. Mathar, Apr 17 2009
a(7) & a(8) from Robert G. Wilson v, Aug 06 2010
a(9)-a(11) from Max Alekseyev, Jan 30 2012
a(12)-a(14) from Hiroaki Yamanouchi, Jun 29 2014

A274422 Numbers m such that there exists a j for which m = Sum_{k=1..j} (m mod k), where k runs through the largest j primes less than m.

Original entry on oeis.org

13, 17, 20, 23, 24, 34, 40, 82, 126, 200, 612, 1154, 1692, 2434, 2806, 3060, 3142, 4052, 4460, 4596, 5020, 5908, 6424, 7304, 7596, 8030, 8040, 9044, 11398, 12254, 12914, 13412, 13716, 16006, 16800, 18560, 22438, 23140, 24424, 24746, 25706, 28318, 29272, 30580
Offset: 1

Views

Author

Paolo P. Lava, Jun 21 2016

Keywords

Examples

			13 mod 11 + 13 mod 7 + 13 mod 5 + 13 mod 3 + 13 mod 2 = 2 + 6 + 3 + 1 + 1 = 13;
40 mod 37 + 40 mod 31 + 40 mod 29 + 40 mod 23 = 3 + 9 + 11 + 17 = 40.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for n from 3 to q do a:=0; b:=prevprime(n);
    while n>a do a:=a+(n mod b); if b>2 then b:=prevprime(b); else break; fi; od;
    if n=a then print(n); fi; od; end: P(10^9);

A274423 Let s(n,j) be Sum_{i=1..j} (prime(primepi(n) + i) mod n). Numbers n such that there exists j with s(n,j) = n.

Original entry on oeis.org

2, 3, 4, 6, 8, 44, 48, 66, 90, 108, 156, 206, 284, 854, 1002, 1188, 1194, 1212, 1320, 2234, 2460, 2792, 3336, 3478, 7096, 7164, 7218, 7236, 7752, 8304, 9164, 10272, 12090, 12594, 13322, 15530, 17038, 17162, 18026, 18212, 20412, 20494, 21966, 23374, 23518, 24664
Offset: 1

Views

Author

Paolo P. Lava, Jun 21 2016

Keywords

Examples

			47 mod 44 + 53 mod 44 + 59 mod 44 + 61 mod 44 = 3 + 9 + 15 + 17 = 44.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for n from 2 to q do a:=0;
    b:=nextprime(n); while n>a do a:=a+(b mod n); b:=nextprime(b); od;
    if n=a then print(n); fi; od; end: P(10^9);

Extensions

Name corrected by David A. Corneth, Jun 22 2016

A274424 Numbers k such that there exists an m for which k = Sum_{j=1..m} (k mod prime(j)).

Original entry on oeis.org

13, 19, 48, 63, 67, 76, 94, 99, 123, 141, 143, 150, 179, 193, 247, 249, 285, 339, 404, 445, 517, 693, 711, 798, 969, 982, 1054, 1138, 1233, 1245, 1257, 1262, 1364, 1524, 1531, 1569, 1613, 1694, 1701, 1743, 1745, 1928, 2018, 2070, 2114, 2224, 2339, 2461, 2770
Offset: 1

Views

Author

Paolo P. Lava, Jun 21 2016

Keywords

Examples

			48 mod 2 + 48 mod 3 + 48 mod 5 + 48 mod 7 + 48 mod 11 + 48 mod 13 + 48 mod 17 + 48 mod 19 + 48 mod 23 = 0 + 0 + 3 + 6 + 4 + 9 + 14 + 10 + 2 = 48, so 48 is a term.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for n from 2 to q do a:=0; b:=2;
    while n>a do a:=a+(n mod b); b:=nextprime(b); od;
    if n=a then  print(n); fi; od; end: P(10^9);
Showing 1-10 of 18 results. Next