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

A165659 Numerators of A007504 divided by A033955, starting from the second term of A033955.

Original entry on oeis.org

2, 5, 5, 17, 28, 41, 58, 77, 50, 129, 16, 197, 119, 281, 164, 127, 440, 501, 568, 71, 356, 791, 46, 321, 530, 1161, 1264, 457, 1480, 1593, 344, 1851, 284, 2127, 2276, 809, 2584, 2747, 1457, 441, 1633, 1149, 3638, 3831, 1007, 4227, 4438
Offset: 1

Views

Author

Creighton Dement, Sep 24 2009

Keywords

Comments

Conjecture: with the exception of the second term, 2 <= a(n)/A165660(n) < 3.

Crossrefs

Programs

  • PARI
    a1(n)=sum(i=1, n, prime(i));
    b1(n)=sum(i=1, n, prime(n+1)%prime(i));
    a(n)=if(n<0, 0, numerator(a1(n)/b1(n)));
    for(n=1, 50, print1(a(n) ", "))

Extensions

Typo in definition corrected by Creighton Dement, Oct 09 2009

A165660 Denominators of A007504 divided by A033955, starting from the second term of A033955.

Original entry on oeis.org

1, 3, 2, 8, 13, 18, 27, 29, 23, 56, 7, 74, 44, 98, 67, 49, 171, 200, 217, 28, 137, 309, 17, 116, 209, 448, 471, 174, 571, 629, 137, 739, 111, 793, 853, 318, 997, 1002, 560, 164, 610, 446, 1419, 1466, 385, 1615, 1573, 1633, 1707, 1825, 946, 662, 2221, 781, 1198
Offset: 1

Views

Author

Creighton Dement, Sep 24 2009

Keywords

Comments

Conjecture: with the exception of the second term, 2 <= A165659(n)/a(n) < 3.

Crossrefs

Programs

  • PARI
    a1(n)=sum(i=1, n, prime(i)); b1(n)=sum(i=1, n, prime(n+1)%prime(i)); a(n)=if(n<0, 0, denominator(a1(n)/b1(n))); for(n=1, 50, print1(a(n) ", "))

Extensions

Terms corrected by Creighton Dement, Oct 03 2009
Removed a conjecture - R. J. Mathar, Oct 09 2009
Typo in definition corrected by Creighton Dement, Oct 09 2009

A033956 Add prime(n) to A033955.

Original entry on oeis.org

2, 4, 8, 11, 19, 26, 35, 46, 52, 75, 87, 107, 115, 131, 145, 187, 206, 232, 267, 288, 325, 353, 392, 412, 445, 519, 551, 578, 631, 684, 756, 816, 876, 916, 942, 1004, 1111, 1160, 1169, 1293, 1327, 1401, 1529, 1612, 1663, 1739, 1826, 1796, 1860, 1936, 2058
Offset: 1

Views

Author

N. J. A. Sloane, Armand Turpel armandt(AT)unforgettable.com

Keywords

Extensions

More terms from Erich Friedman.
a(20) onward corrected by Sean A. Irvine, Jul 22 2020

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

Original entry on oeis.org

1, 1, 2, 2, 8, 36, 288, 1920, 2880, 120960, 362880, 6386688, 34836480, 217728000, 3881779200, 275904921600, 1785411403776, 28217548800000, 608662978560000, 3492203839488000, 964122158039040000, 2224367550332928000, 1314079960596480000000, 3758268687305932800000
Offset: 1

Views

Author

Hans Boelens (h.p.m.boelens(AT)pl.hanze.nl), Feb 02 2005

Keywords

Examples

			Prime(6) = 13, 13 mod 2 = 1, 13 mod 3 = 1, 13 mod 5 = 3, 13 mod 7 = 6, 13 mod 11 = 2 so a(6) = 1*1*3*6*2 = 36.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,i;
      p:= ithprime(n);
      mul(p mod ithprime(i),i=1..n-1)
    end proc:
    map(f, [$1..25]); # Robert Israel, Jan 12 2021
  • Mathematica
    f[n_] := Times @@ Mod[ Prime[n], Table[ Prime[i], {i, n - 1}]]; Table[ f[n], {n, 22}] (* Robert G. Wilson v, Feb 04 2005 *)
    Join[{0},Table[Times@@Mod[Prime[n],Prime[Range[n-1]]],{n,2,30}]] (* Harvey P. Dale, May 16 2019 *)
  • PARI
    a(n) = my(pr = 1, pn = prime(n)); forprime (q=1, precprime(pn-1), pr *= (pn % q)); pr; \\ Michel Marcus, Jan 12 2021

Extensions

More terms from Robert G. Wilson v, Feb 04 2005
a(1) (an empty product, therefore 1 by standard convention) corrected by N. J. A. Sloane, Jan 11 2021

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

A173655 Triangle read by rows: T(n,k) = prime(n) mod prime(k), 0 < k <= n.

Original entry on oeis.org

0, 1, 0, 1, 2, 0, 1, 1, 2, 0, 1, 2, 1, 4, 0, 1, 1, 3, 6, 2, 0, 1, 2, 2, 3, 6, 4, 0, 1, 1, 4, 5, 8, 6, 2, 0, 1, 2, 3, 2, 1, 10, 6, 4, 0, 1, 2, 4, 1, 7, 3, 12, 10, 6, 0, 1, 1, 1, 3, 9, 5, 14, 12, 8, 2, 0, 1, 1, 2, 2, 4, 11, 3, 18, 14, 8, 6, 0, 1, 2, 1, 6, 8, 2, 7, 3, 18, 12, 10, 4, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 24 2010

Keywords

Examples

			Triangle begins as:
  0;
  1, 0;
  1, 2, 0;
  1, 1, 2, 0;
  1, 2, 1, 4, 0;
  1, 1, 3, 6, 2,  0;
  1, 2, 2, 3, 6,  4,  0;
  1, 1, 4, 5, 8,  6,  2,  0;
  1, 2, 3, 2, 1, 10,  6,  4, 0;
  1, 2, 4, 1, 7,  3, 12, 10, 6, 0;
		

Crossrefs

Cf. A001223 (2nd diagonal), A033955 (row sums), A102647 (row products excluding 0's), A031131 (3rd diagonal after first 3 terms).

Programs

  • Magma
    A173655:= func< n,k | NthPrime(n) mod NthPrime(k) >;
    [A173655(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 10 2024
    
  • Maple
    A173655 := proc(n,k) ithprime(n) mod ithprime(k) ;end proc:
    seq(seq(A173655(n,k),k=1..n),n=1..20) ; # R. J. Mathar, Nov 24 2010
  • Mathematica
    Flatten[Table[Mod[Prime[n], Prime[Range[n]]], {n, 15}]]
  • PARI
    forprime(p=2,40,forprime(q=2,p,print1(p%q", "))) \\ Charles R Greathouse IV, Dec 21 2011
    
  • SageMath
    def A173655(n,k): return nth_prime(n)%nth_prime(k)
    flatten([[A173655(n,k) for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Apr 10 2024

A207409 Triangular array: T(n,k) = prime(n) mod prime(k), 1 <= k < n.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 2, 1, 4, 1, 1, 3, 6, 2, 1, 2, 2, 3, 6, 4, 1, 1, 4, 5, 8, 6, 2, 1, 2, 3, 2, 1, 10, 6, 4, 1, 2, 4, 1, 7, 3, 12, 10, 6, 1, 1, 1, 3, 9, 5, 14, 12, 8, 2, 1, 1, 2, 2, 4, 11, 3, 18, 14, 8, 6, 1, 2, 1, 6, 8, 2, 7, 3, 18, 12, 10, 4, 1, 1, 3, 1, 10, 4, 9, 5, 20, 14, 12, 6, 2, 1
Offset: 2

Views

Author

Clark Kimberling, Feb 17 2012

Keywords

Comments

Conjecture: For each row in the triangle, the maximum value occurs only once, and for n>2 it is never the first entry and the value previous to it in the row is always odd. - Mike Jones, Jul 12 2024

Examples

			Top 7 rows:
  n=2:  1............. 3 mod 2
  n=3:  1 2............5 mod 2, 5 mod 3
  n=4:  1 1 2..........7 mod 2, 7 mod 3, 7 mod 5
  n=5:  1 2 1 4
  n=6:  1 1 3 6 2
  n=7:  1 2 2 3 6 4
  n=8:  1 1 4 5 8 6 2
		

Crossrefs

Cf. A000040.
Cf. A001223 (right diagonal), A033955 (row sums), A039731 (row maxs).

Programs

  • Maple
    P := select(isprime, [$1..100]):
    seq(seq(P[n] mod P[k],k=1..n-1),n=1..nops(P)); # Robert Israel, May 01 2017
  • Mathematica
    t = Table[Mod[Prime[n + 1], Prime[k]], {n, 1, 15}, {k, 1, n }];
    Flatten[t]   (* this sequence *)
    TableForm[t] (* this sequence as a triangle *)
  • PARI
    row(n) = my(p=prime(n)); vector(n-1, k, p % prime(k)); \\ Michel Marcus, Jul 13 2024

A342173 a(n) = Sum_{j=1..n-1} floor(prime(n)/prime(j)).

Original entry on oeis.org

0, 1, 3, 6, 11, 14, 20, 23, 30, 39, 43, 53, 60, 64, 71, 81, 92, 96, 107, 115, 118, 130, 136, 148, 164, 171, 175, 183, 186, 194, 222, 229, 241, 245, 265, 269, 282, 293, 301, 313, 325, 329, 351, 354, 362, 366, 392, 417, 424, 428, 437, 450, 454, 473, 485, 498, 511
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Mar 03 2021

Keywords

Comments

a(n) is the sum of the quotients in integer division of prime(n) by all smaller primes.

Examples

			a(4) = floor(7/2) + floor(7/3) + floor(7/5) = 6.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,i,s;
      t:= ithprime(n);
      add(floor(t/ ithprime(i)),i=1..n-1)
    end proc:
    map(f, [$1..100]);
  • Mathematica
    Table[Sum[Floor[Prime[n]/Prime[j]],{j,n-1}],{n,64}] (* Stefano Spezia, Mar 04 2021 *)
  • PARI
    a(n) = sum(j=1, n-1, prime(n)\prime(j)); \\ Michel Marcus, Mar 04 2021

Formula

a(n) = A308495(n) - 2. - Hugo Pfoertner, Mar 04 2021
a(n) = A013939(A006093(n)). - Flávio V. Fernandes, Jan 03 2025

A143801 Primes with sum of remainders modulo all smaller primes which is smaller than this sum for the preceding prime.

Original entry on oeis.org

223, 359, 383, 449, 503, 547, 701, 797, 881, 1049, 1097, 1229, 1307, 1439, 1627, 1733, 1759, 1987, 1997, 2027, 2221, 2287, 2309, 2437, 2477, 2579, 2617, 2647, 2801, 2861, 2903, 2999, 3023, 3067, 3167, 3191, 3329, 3467, 3581, 3697, 3761, 3911, 3947, 4057
Offset: 1

Views

Author

Neil Fernandez, Sep 01 2008

Keywords

Comments

These are the k-th primes, where A033955(k) < A033955(k-1)

Examples

			When divided by 2,3,5,7,11,...., the number 211 gives remainders 1,1,1,1,2, etc., which sum to 1615 and the number 223 gives remainders 1,1,3,6,3, etc., which sum to 1573. 1573 is smaller than 1615, so 223 is in the sequence.
		

Programs

  • Mathematica
    Prime[#]&/@(Flatten[Position[Differences[Table[Total[Mod[p,Prime[Range[PrimePi[p]]]]],{p,Prime[Range[600]]}]],?(#<0&)]]+1) (* _Harvey P. Dale, Jul 18 2025 *)

A340541 Primes p such that the product of (p mod q) for primes q < p is a multiple of the sum of (p mod q) for primes q < p.

Original entry on oeis.org

3, 11, 17, 31, 59, 67, 73, 101, 103, 173, 179, 193, 199, 211, 223, 349, 401, 463, 491, 499, 557, 563, 569, 571, 577, 587, 607, 613, 619, 631, 673, 709, 751, 757, 769, 797, 809, 857, 859, 877, 911, 919, 929, 967, 1009, 1033, 1039, 1049, 1151, 1153, 1193, 1201, 1237, 1249, 1259, 1289, 1297, 1303
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 11 2021

Keywords

Comments

Primes prime(n) such that A102647(n) is divisible by A033955(n).

Examples

			a(3) = 17 is a term since (17 mod q) for primes q=2,3,5,7,11,13 are 1,2,2,3,6,4, and 1*2*2*3*6*4 = 288 is divisible by 1+2+2+3+6+4 = 18.
		

Crossrefs

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..1000)]:
    filter:= proc(n) local L,k;
      L:= [seq(P[n] mod P[k],k=1..n-1)];
      convert(L,`*`) mod convert(L,`+`) = 0
    end proc:
    S:=select(filter, [$2..1000]):
    map(t -> P[t], S);
  • PARI
    isok(p) = {if (isprime(p) && (p>2), my(s=0, t=1); forprime(q=2, p-1, my(x= p%q); s += x; t *= x;); !(t % s););} \\ Michel Marcus, Jan 11 2021
Showing 1-10 of 11 results. Next