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

A068627 a(0) = 0, a(n) = a(n-1) + n if n does not divide a(n-1). a(n) = a(n-1) - n if n divides a(n-1). a(n) = n if a(n-1) = 0.

Original entry on oeis.org

0, 1, 3, 0, 4, 9, 15, 22, 30, 39, 49, 60, 48, 61, 75, 60, 76, 93, 111, 130, 150, 171, 193, 216, 192, 217, 243, 216, 244, 273, 303, 334, 366, 399, 433, 468, 432, 469, 507, 468, 508, 549, 591, 634, 678, 723, 769, 816, 768, 817, 867, 816, 868, 921, 975, 1030, 1086
Offset: 0

Views

Author

Amarnath Murthy, Feb 26 2002

Keywords

Comments

The sequence is not monotonically increasing but has an increasing trend with some nodes i.e. numbers occurring twice in the sequence like 60 etc. Are there infinitely many nodes in the sequence?

Examples

			Since 12 divides a(11)=60, a(12) = 60 - 12 = 48.
Since 13 does not divide a(12)=48, a(13) = 48 + 13 = 61.
		

Crossrefs

Cf. A068626.

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,Which[a==0,n+1,Divisible[a,n+1],a-(n+1),True,a+n+1]}; NestList[nxt,{0,0},60][[All,2]] (* Harvey P. Dale, Jun 29 2021 *)
  • PARI
    lista(nn) = {preca = 0; for (n=1, nn, print1(preca, ", "); if (preca == 0, nexta = n, if (preca % n, nexta = preca + n, nexta = preca - n);); preca = nexta;);} \\ Michel Marcus, Jan 23 2014

A068629 a(1) = 1. a(n) = n*a(n-1) if gcd(n,a(n-1)) = 1, a(n-1)/n if n divides a(n-1), otherwise a(n) = a(n-1).

Original entry on oeis.org

1, 2, 6, 6, 30, 5, 35, 280, 2520, 252, 2772, 231, 3003, 3003, 3003, 48048, 816816, 816816, 15519504, 15519504, 739024, 33592, 772616, 772616, 19315400, 742900, 20058300, 20058300, 581690700, 19389690, 601080390, 601080390
Offset: 1

Views

Author

Amarnath Murthy, Feb 26 2002

Keywords

Comments

The sequence can also be obtained by taking a(1) = 1 and then multiplying the previous term by n if n is coprime to the previous term a(n-1), dividing the previous term by n if n divides the previous term a(n-1), taking a(n) = a(n-1) if n is unrelated to a(n-1). - Amarnath Murthy, Oct 30 2002 (corrected by Franklin T. Adams-Watters, Dec 13 2006)

Crossrefs

Programs

  • Mathematica
    a = {1}; Do[AppendTo[a, If[GCD[a[[-1]], n] == 1, a[[-1]]*n, If[Divisible[a[[-1]], n], a[[-1]]/n, a[[-1]]]]], {n, 2, 32}]; a (* Ivan Neretin, May 21 2015 *)
  • PARI
    print1(k=1); for(n=2,99, if(gcd(k,n)==1, k*=n, if(k%n==0, k/=n)); print1(", "k)) \\ Charles R Greathouse IV, May 21 2015

Extensions

a(26)-a(32) corrected by Ivan Neretin, May 21 2015

A115012 Sum_{i=1..n, gcd(5,i)=1} i.

Original entry on oeis.org

1, 3, 6, 10, 10, 16, 23, 31, 40, 40, 51, 63, 76, 90, 90, 106, 123, 141, 160, 160, 181, 203, 226, 250, 250, 276, 303, 331, 360, 360, 391, 423, 456, 490, 490, 526, 563, 601, 640, 640, 681, 723, 766, 810, 810, 856, 903, 951, 1000, 1000, 1051, 1103, 1156, 1210, 1210, 1266
Offset: 1

Views

Author

N. J. A. Sloane, Feb 24 2006

Keywords

Crossrefs

Replacing 5 in the definition by 2, 3, 4, 5, 6, 7, 8, 9 gives respectively A008794, A068626, A008794, this sequence, A115014, A115015, A008794, A068626.

A068630 a(0)=0; a(n) = n + a(n-1) if gcd(n,a(n-1)) = 1 or a(n-1) = 0; a(n) = a(n-1) - n if n divides a(n-1), otherwise a(n) = a(n-1).

Original entry on oeis.org

0, 1, 3, 0, 4, 9, 9, 16, 8, 17, 27, 38, 38, 51, 65, 65, 81, 98, 98, 117, 137, 158, 158, 181, 205, 205, 231, 231, 231, 260, 260, 291, 323, 356, 356, 391, 427, 464, 464, 503, 543, 584, 584, 627, 627, 627, 673, 720, 672, 672, 672, 672, 672, 725, 779, 834, 834, 834
Offset: 0

Views

Author

Amarnath Murthy, Feb 26 2002

Keywords

Crossrefs

Extensions

Offset and a(55)-a(57) corrected by Gionata Neri, Mar 23 2017
Showing 1-4 of 4 results.