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

A076041 a(n) = n! for n < 4; else a(n) = floor(P(n-1)/n) where P(n) = a(1) * a(2) * ... * a(n).

Original entry on oeis.org

1, 2, 6, 3, 7, 42, 1512, 2000376, 3556892570112, 11386336279786153952123289, 117862412614885811248635740101130996768076206774085
Offset: 1

Views

Author

Amarnath Murthy, Oct 29 2002

Keywords

Comments

Original definition: a(1)=1, a(n)=n*P(n-1) if P(n-1) < n, a(n) = floor(P(n-1)/n) if n <= P(n-1), where P(n-1) = a(1) * a(2) * ... * a(n-1).
Next term a(12) = 1273391928...9197035520 ~ 1.27*10^100 has 101 digits. - M. F. Hasler, Oct 21 2014

Examples

			a(4) = floor(1*2*6/4) = 3.
a(5) = floor(1*2*6*3/5) = floor(36/5) = 7.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; p[n_] := Product[a[k], {k, 1, n}]; a[n_ /; p[n-1] < n] := a[n] = n*p[n-1]; a[n_ /; n < p[n-1]] := a[n] = Floor[p[n-1]/n]; Table[a[n], {n, 1, 12}] (* Jean-François Alcover, Jul 22 2013 *)
  • PARI
    a(n)=if(n<4,n!,P=3!;for(i=3,n-1,P*=P\i);P\n) \\ M. F. Hasler, Oct 21 2014

Extensions

Corrected and extended by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 20 2003
Edited by M. F. Hasler, Oct 21 2014

A238324 a(1) = 1 and a(n+1) = if a(n) > 2*n+1 then a(n)-2*n-1 else a(n)+2*n+1.

Original entry on oeis.org

1, 4, 9, 2, 11, 22, 9, 24, 7, 26, 5, 28, 3, 30, 1, 32, 65, 30, 67, 28, 69, 26, 71, 24, 73, 22, 75, 20, 77, 18, 79, 16, 81, 14, 83, 12, 85, 10, 87, 8, 89, 6, 91, 4, 93, 2, 95, 190, 93, 192, 91, 194, 89, 196, 87, 198, 85, 200, 83, 202, 81, 204, 79, 206, 77
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 07 2015

Keywords

Comments

Abs(a(n+1) - a(n)) = 2*n+1;
a(A265327(n)) = n and a(m) != n for m < A265327(n).

Crossrefs

Programs

  • Haskell
    a238324 n = a238324_list !! (n-1)
    a238324_list = scanl1 (\u v -> if u > v then u - v else u + v) [1, 3 ..]
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[a>2n+1,a-2n-1,a+2n+1]}; NestList[nxt,{1,1},70][[All,2]] (* Harvey P. Dale, Oct 07 2016 *)

A365203 a(1) = 1; a(n) = a(n - 1) + n if a(n - 1) < n, a(n) = n^2 if a(n - 1) = n, a(n) = a(n - 1)/n if a(n - 1) > n and a(n - 1) == 0 (mod n), otherwise a(n) = a(n - 1) - n.

Original entry on oeis.org

1, 3, 9, 5, 25, 19, 12, 4, 13, 3, 14, 2, 15, 1, 16, 256, 239, 221, 202, 182, 161, 139, 116, 92, 67, 41, 14, 42, 13, 43, 12, 44, 11, 45, 10, 46, 9, 47, 8, 48, 7, 49, 6, 50, 5, 51, 4, 52, 3, 53, 2, 54, 1, 55, 3025, 2969, 2912, 2854, 2795, 2735, 2674, 2612, 2549
Offset: 1

Views

Author

Felix Huber, Aug 26 2023

Keywords

Examples

			a(2) = a(1) + 2 = 3, since a(1) = 1 < 2.
a(3) = 3^2 = 9, since a(2) = 2.
a(4) = a(3) - 4 = 5, since a(3) = 9 > 4 and 9 != 0 (mod 4).
a(83) = a(82)/83 = 14, a(82) = 1162 > 83 and 1162 == 0 (mod 83).
		

Crossrefs

Programs

  • Maple
    A365203 := proc(n) option remember;
        if n = 1 then 1;
        elif procname(n - 1) < n then procname(n - 1) + n;
        elif n = procname(n - 1) then n*n;
        elif irem(procname(n - 1), n) = 0 then procname(n - 1)/n;
        else procname(n - 1) - n;
        end if;
    end proc;
    seq(A365203(n), n = 1 .. 10000);
  • Mathematica
    nxt[{n_,a_}]:={n+1,Which[a<(n+1),a+n+1,a==n+1,(n+1)^2,a>(n+1)&&Mod[a,n+1]==0,a/(n+1),True,a-n-1]}; NestList[nxt,{1,1},70][[;;,2]] (* Harvey P. Dale, Apr 30 2025 *)
  • PARI
    lista(nn) = my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(vs = sign(va[n-1] - n)); if (vs<0, va[n] = va[n-1] + n, if (vs==0, va[n] = n^2, if ((va[n-1] % n)== 0, va[n] = va[n-1]/n, va[n] = va[n-1] - n)));); va; \\ Michel Marcus, Aug 27 2023
    
  • Python
    from itertools import count, islice
    def A365203_gen(): # generator of terms
        yield (a:=1)
        for n in count(2):
            if aA365203_list = list(islice(A365203_gen(),30)) # Chai Wah Wu, Sep 23 2023

A117137 Same as triangle in A117136, but omit final 1 from each row.

Original entry on oeis.org

1, 1, 2, 4, 1, 3, 6, 2, 7, 1, 4, 8, 3, 9, 2, 10, 1, 5, 10, 4, 11, 3, 12, 2, 13, 1, 6, 12, 5, 13, 4, 14, 3, 15, 2, 16, 1, 7, 14, 6, 15, 5, 16, 4, 17, 3, 18, 2, 19, 1
Offset: 0

Views

Author

N. J. A. Sloane, Apr 21 2006

Keywords

Comments

Row n has length 2n+1.

Examples

			Triangle begins:
Row 0: 1
Row 1: 1 2 4
Row 2: 1 3 6 2 7
Row 3: 1 4 8 3 9 2 10
Row 4: 1 5 10 4 11 3 12 2 13
...
		

Crossrefs

The segments of A046901 appear as rows 2, 7, 22, 67, ... (A060816) of this array.

A363653 a(1) = 1; for n > 1, a(n) = a(n-1) - A000005(n) if a(n) strictly positive, else a(n) = a(n-1) + A000005(n).

Original entry on oeis.org

1, 3, 1, 4, 2, 6, 4, 8, 5, 1, 3, 9, 7, 3, 7, 2, 4, 10, 8, 2, 6, 2, 4, 12, 9, 5, 1, 7, 5, 13, 11, 5, 1, 5, 1, 10, 8, 4, 8, 16, 14, 6, 4, 10, 4, 8, 6, 16, 13, 7, 3, 9, 7, 15, 11, 3, 7, 3, 1, 13, 11, 7, 1, 8, 4, 12, 10, 4, 8, 16, 14, 2, 4, 8, 2, 8, 4, 12, 10, 20, 15, 11, 9, 21
Offset: 1

Views

Author

Ctibor O. Zizka, Jun 13 2023

Keywords

Comments

Variation on Recamán's sequence A005132.

Examples

			a(1) = 1
a(2) = 1 + A000005(2) = 3
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Module[{d = DivisorSigma[0, n]}, If[a[n - 1] > d, a[n - 1] - d, a[n - 1] + d]]; Array[a, 100] (* Amiram Eldar, Jun 13 2023 *)
Previous Showing 11-15 of 15 results.