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

A065132 Arithmetic mean of first n terms of A008472 is an integer.

Original entry on oeis.org

2, 13, 134, 167, 2239, 62268, 75255, 135681, 439867, 18139940, 23671044, 40892256, 312083956, 724031017, 1990127567, 2144843867, 2588619526, 7439533243, 15054156002, 54892225873, 69959798320, 79760490898, 282311798922
Offset: 1

Views

Author

Labos Elemer, Oct 15 2001

Keywords

Examples

			Sum of first 13 terms of A008472 gives A024924(13) = 65 which is divisible by n = 13, so 13 is here: 0+2+3+2+5+5+7+2+3+7+11+5+13 = 65 = 13*5 = A024924(13).
		

Crossrefs

Programs

  • Mathematica
    s=0; Do[s=s+sp[n]; If[IntegerQ[n/25000], Print[n]]; If[IntegerQ[s/n], Print[{n, s, s/n}]], {n, 2, 4000000}] where sp[n]=A008472(n).

Formula

Integers n that divide A024924(n)=A008472(1)+A008472(2)+...+A008472(n).
Also, integers n that divide A024934(n).
Prime terms are listed in A143851.

Extensions

a(10)-a(19) from Donovan Johnson, Nov 22 2009
a(20)-a(23) from Donovan Johnson, Aug 31 2010

A101336 Alternating addition and subtraction of the residues of the primes less than the number.

Original entry on oeis.org

0, 0, 0, 1, -1, -1, 1, 2, 0, 3, -4, -4, -2, -1, 4, 2, 0, 0, 2, 3, -4, 6, -7, -7, -5, -9, 3, 7, 13, 14, 10, 10, 9, 2, -16, -13, -11, -10, 7, 23, 16, 16, 25, 26, 13, 11, -14, -14, -12, -4, -10, -23, -11, -10, -9, -25, -20, 2, 29, 29, 26, 27, -6, 4, 2, 10, 0, 0, -18, -37, -36, -35, -34, -34, 2, 1, 19, 16, 31, 32, 25, 28, -15, -15, -6, -27, 15
Offset: 0

Views

Author

Gordon Hamilton, Dec 24 2004

Keywords

Comments

The amplitude and periodicity of fluctuations increase... for example a(813) through a(836) are all positive and a(914) through a(937) all are positive except for a(922).

Examples

			a(10) = -4 because 10 (mod 2) - 10 (mod 3) + 10 (mod 5) - 10 (mod 7) = 0-1+0-3.
		

Crossrefs

Cf. A024934.

Programs

  • Maple
    a:= n-> add(-irem(n, ithprime(i))*(-1)^i, i=1..numtheory[pi](n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jul 27 2015
  • Mathematica
    Table[Total[Times@@@Partition[Riffle[Mod[n,Prime[Range[PrimePi[n]]]],{1,-1},{2,-1,2}],2]],{n,0,90}] (* Harvey P. Dale, Jun 03 2017 *)

Extensions

a(0)=0 prepended by Alois P. Heinz, Jul 27 2015

A233131 Sum of remainders of n modulo all smaller composite numbers.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 4, 2, 5, 9, 14, 9, 15, 21, 28, 24, 33, 27, 37, 33, 44, 56, 69, 52, 66, 81, 88, 87, 105, 92, 111, 102, 122, 143, 165, 139, 163, 187, 212, 196, 223, 209, 237, 239, 244, 274, 305, 266, 298, 296, 330, 335, 371, 347, 384, 368, 407, 447, 488, 432, 474, 516, 529, 513, 558, 543, 590, 599, 647, 637, 687, 620
Offset: 0

Views

Author

Max Alekseyev, Dec 07 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Total[Mod[n,Select[Range[n-1],CompositeQ]]],{n,0,80}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 01 2018 *)

Formula

a(n) = A004125(n) - A024934(n).

A383752 Product of nonzero remainders n mod p, over all primes p < n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 6, 8, 3, 8, 10, 36, 24, 8, 30, 288, 420, 1920, 2268, 640, 270, 2880, 9240, 13824, 7560, 19200, 17820, 120960, 64064, 362880, 5054400, 1881600, 475200, 165888, 464100, 6386688, 4082400, 1228800, 2120580, 34836480, 23474880, 217728000
Offset: 1

Views

Author

DarĂ­o Clavijo, May 28 2025

Keywords

Crossrefs

Programs

  • Mathematica
    A383752[n_] := Times @@ DeleteCases[Mod[n, Prime[Range[PrimePi[n - 2]]]], 0];
    Array[A383752, 50] (* Paolo Xausa, Jun 05 2025 *)
  • PARI
    a(n) = vecprod(select(x->(x!=0), apply(lift, apply(x->Mod(n, x), primes([2,n-1]))))); \\ Michel Marcus, May 28 2025
  • Python
    from sympy import primerange
    def a(n):
        s = 1
        for p in primerange(0, n):
            if p > (n >> 1): s *= (n-p)
            elif (x:= n % p) > 0: s*= x
        return s
    print([a(n) for n in range(1,41)])
    

Formula

a(p) = A102647(p) if p prime.

A024925 Sum of remainders of n mod prime(k), for k = 1,2,3,...,n.

Original entry on oeis.org

1, 2, 4, 9, 13, 19, 25, 38, 52, 64, 74, 92, 104, 122, 143, 172, 188, 218, 236, 268, 299, 329, 351, 393, 437, 473, 523, 569, 597, 646, 676, 737, 788, 836, 893, 959, 995, 1049, 1110, 1182, 1222, 1293, 1335, 1409, 1490, 1556, 1602, 1692, 1782, 1874, 1955, 2043, 2095, 2197, 2290
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [&+[n mod NthPrime(k): k in [1..n]]:n in [1..55]]; // Marius A. Burtea, Jul 16 2019
    
  • PARI
    a(n) = sum(k=1, n, n % prime(k)); \\ Michel Marcus, Jul 18 2019
    
  • PARI
    a(n) = my(s=0); forprime(p=2, prime(n), s += n%p); s; \\ Michel Marcus, Jul 18 2019

Formula

G.f.: x * (1 + x)/(1 - x)^3 - (1/(1 - x)) * Sum_{k>=1} prime(k) * x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jul 16 2019

A302867 a(n) is the sum of remainders n mod p, over primes p for which n falls between p and p+p^2.

Original entry on oeis.org

0, 0, 1, 1, 3, 1, 3, 6, 6, 4, 7, 8, 11, 8, 7, 11, 15, 20, 25, 26, 25, 20, 26, 33, 35, 29, 36, 36, 43, 46, 53, 61, 58, 49, 50, 58, 66, 56, 52, 61, 70, 73, 83, 83, 94, 82, 93, 105, 110, 122, 117, 116, 128, 141, 143, 149, 142, 125, 137, 150, 163, 146, 160, 174
Offset: 1

Views

Author

Meir-Simchah Panzer, May 06 2018

Keywords

Comments

"Jubilees". Motivation: 7 years are counted 7 times and capped off with a 50th year, the Jubilee (Leviticus 25:8); similarly, 7 days are counted 7 times and capped off with "Chag ha-Atzeret" (The Festival of Stopping) in the Omer-counting cycle (ibid 23:15); and these iterative cycles overlay other iterative cycles, like the lunar cycle nested not-quite-evenly within the solar year. This sequence idealizes the overlaying of multiple cycles. Each prime p generates a "swell" of p waves each with max amplitude = p-1, a kind of wavelet that is added into the total signal that is the sequence (e.g., the swell generated by 3 is (3^2)+1 terms in length, running for n=3,...,12 and has values n mod 3 = 0,1,2,0,1,2,0,1,2,0).

Examples

			For n = 12, we sum over primes 3, 5, 7, 11: a(12) = 12 mod 3 + 12 mod 5 + 12 mod 7 + 12 mod 11 = 0 + 2 + 5 + 1 = 8. In contrast with A024934, the sum does not include 12 mod 2 since 12 > 2+2^2.
		

Crossrefs

Similar to A024934, but waves generated by primes are wavelets.

Programs

  • PARI
    a(n) = sum(k=1, n, (n % k)*isprime(k)*(n <= (k^2+k))); \\ Michel Marcus, May 14 2018

Formula

a(n) = Sum_{primes p, sqrt(n) - 1/2 < p <= n} (n mod p).

A384310 Numbers k such that A383844(k) and A383844(k+1) are nonzero.

Original entry on oeis.org

0, 3, 6, 7, 12, 20, 26, 27, 28, 53, 56, 61, 74, 88, 145, 146, 252, 289, 299, 308, 320, 323, 340, 471, 577, 578, 739, 1240, 1517, 1568, 1579, 1857, 2638, 3042, 3043, 3133, 3455, 3565, 4910, 8683, 8684, 8857, 8858, 9291, 14549, 17913, 18117, 20005, 21989, 32552, 37902, 42514, 44869, 47877, 49942
Offset: 1

Views

Author

Miles Englezou, Jun 04 2025

Keywords

Comments

a(n) is the lesser term of a pair of consecutive nonzero terms in A383844.
Triplets of consecutive nonzero terms can also be found in A383844 and are represented here as pairs. Up to n = 83354 there are 8 such triplets, the least terms of each being 6, 26, 27, 145, 577, 3042, 8683, 8857.

Examples

			26 is a term since A383844(26) and A383844(27) are nonzero.
27 is a term since A383844(27) and A383844(28) are nonzero.
252 is a term since A383844(252) and A383844(253) are nonzero.
61890 is a term since A383844(61890) and A383844(61891) are nonzero.
		

Crossrefs

Programs

  • PARI
    isok(n) = (count(n) = my(f, S=[], b);(f(m)=my(r=0); forprime(p=2, m, r+=m%p); return(r)); if(n<=21, b=26); if(n>21, b=n); if(n>=250, b=n^0.8); if(n>=6000, b=n^0.7); if(n>=21000, b=n^0.68); if(n>=43000, b=n^0.67); for(k=0, b, if(f(k)==n, S=concat(S,k))); return(S)); if(n==0 || (n>1 && count(n)<>[] && count(n+1)<>[]), return(1), return(0))

A384584 Numbers k such that A383844(k) = 2.

Original entry on oeis.org

4, 46, 62, 119, 145, 180, 200, 247, 305, 522, 707, 900, 1235, 1504, 1532, 1540, 2396, 3140, 4181, 4231, 6419, 9066, 9885, 14292, 17914, 22696, 33924, 35933, 38951, 80602
Offset: 1

Views

Author

Miles Englezou, Jun 04 2025

Keywords

Comments

Numbers k such that there are exactly two m such that Sum_{i=1..t} m mod prime(i) for prime(t) <= m < prime(t+1) is equal to k (see A024934).
A383844(s) <= 3 for s <= 82000, with A383844(s) = 3 only for s = 0, 1, 8, 37, 781.

Examples

			4 is a term since 7 and 10 are the only numbers r such that A024934(r) = 4.
46 is a term since 29 and 30 are the only numbers r such that A024934(r) = 46.
9066 is a term since 552 and 566 are the only numbers r such that A024934(r) = 9066.
		

Crossrefs

Programs

  • PARI
    isok(n) = (count(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)); if(count(n)==2, return(1), return(0))
Previous Showing 11-18 of 18 results.