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.

A019460 Add 1, multiply by 1, add 2, multiply by 2, etc., start with 2.

Original entry on oeis.org

2, 3, 3, 5, 10, 13, 39, 43, 172, 177, 885, 891, 5346, 5353, 37471, 37479, 299832, 299841, 2698569, 2698579, 26985790, 26985801, 296843811, 296843823, 3562125876, 3562125889, 46307636557, 46307636571, 648306911994, 648306912009, 9724603680135, 9724603680151, 155593658882416
Offset: 0

Views

Author

Keywords

Comments

After a(7) = 43, the next prime in the sequence is a(649) with 676 digits. - M. F. Hasler, Jan 12 2011

References

  • New York Times, Oct 13, 1996.

Crossrefs

Cf. A019461 (same, but start with 0), A019463 (start with 1), A019462 (start with 3), A082448 (start with 4).
Cf. A082458, A019464, A019465, A019466 (similar, but first multiply, then add; starting with 0,1,2,3).

Programs

  • Mathematica
    a[n_] := If[ OddQ@n, a[n - 1] + (n + 1)/2, a[n - 1]*n/2]; a[0] = 2; Table[ a@n, {n, 0, 28}] (* Robert G. Wilson v, Jul 21 2009 *)
  • PARI
    A019460(n)=2*(A000522(n\2)+(n\2)!)-if(bittest(n,0),1,n\2+2)
    /* For producing the terms in increasing order, the following 'hack' can be used M. F. Hasler, Jan 12 2011 */
    lastn=0; an1=1; A000522(n)={ an1=if(n, n==lastn && return(an1); n==lastn+1||error(); an1*lastn=n)+1 }
    
  • Python
    l=[2]
    for n in range(1, 101):
        l.append(l[n - 1] + ((n + 1)//2) if n%2 else l[n - 1]*(n//2))
    print(l) # Indranil Ghosh, Jul 05 2017

Formula

a(2n) = 2*(A000522(n) + n!) - n - 2.
a(2n+1) = 2*(A000522(n) + n!) - 1.
Recursive: a(0) = 2, a(n) = (1 + floor((n-1)/2) - ceiling((n-1)/2))*(a(n-1) + (n+2)/2) + (ceiling((n-1)/2) - floor((n-1)/2))*(n/2)*a(n-1). - Wesley Ivan Hurt, Jan 12 2013

Extensions

One more term from Robert G. Wilson v, Jul 21 2009
Formula provided by Nathaniel Johnston, Nov 11 2010
Formula double-checked and PARI code added by M. F. Hasler, Nov 12 2010
Edited by M. F. Hasler, Feb 25 2018

A019463 Add 1, multiply by 1, add 2, multiply by 2, etc., start with 1.

Original entry on oeis.org

1, 2, 2, 4, 8, 11, 33, 37, 148, 153, 765, 771, 4626, 4633, 32431, 32439, 259512, 259521, 2335689, 2335699, 23356990, 23357001, 256927011, 256927023, 3083124276, 3083124289, 40080615757, 40080615771, 561128620794, 561128620809, 8416929312135, 8416929312151, 134670868994416
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A019461 (same, but start with 0), A019460 (start with 2), A019462, (start with 3), A082448. (start with 4).
Cf. A082458, A019464, A019465, A019466 (similar, but first multiply, then add).
Cf. A019762.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, (t->
          `if`(n::odd, t+(n+1)/2, t*n/2))(a(n-1)))
        end:
    seq(a(n), n=0..32);  # Alois P. Heinz, Jan 16 2024
  • Mathematica
    For[i=1;lst={1},i<15,i++,AppendTo[lst,i+Last[lst]];AppendTo[lst,i Last[lst]]];lst (* Harvey P. Dale, Feb 25 2012 *)
    FoldList[If[OddQ[#2], #1 + (#2 + 1)/2, #1 * (#2/2)]&, 1, Range[32]] (* AnneMarie Torresen, Nov 26 2023 *)
  • PARI
    A019463(n, a=1)={for(i=2, n+1, if(bittest(i, 0), a*=i\2, a+=i\2)); a} \\ M. F. Hasler, Feb 25 2018

Formula

Limit_{n->oo} a(2n)/n! = 1 + 2e = 1 + A019762. - Jon E. Schoenfield, Jan 16 2024

Extensions

Edited by M. F. Hasler, Feb 25 2018

A082448 Add 1, multiply by 1, add 2, multiply by 2, etc.; start with 4.

Original entry on oeis.org

4, 5, 5, 7, 14, 17, 51, 55, 220, 225, 1125, 1131, 6786, 6793, 47551, 47559, 380472, 380481, 3424329, 3424339, 34243390, 34243401, 376677411, 376677423, 4520129076, 4520129089, 58761678157, 58761678171, 822663494394, 822663494409, 12339952416135, 12339952416151, 197439238658416
Offset: 0

Views

Author

N. J. A. Sloane, based on a suggestion of Nick MacDonald, Apr 25 2003

Keywords

Crossrefs

Cf. A019461 (same, but start with 0), A019463 (start with 1), A019460 (start with 2), A019462 (start with 3).
Cf. A082458, A019464 .. A019466 (similar, but first multiply, then add).

Programs

  • Mathematica
    k = 0; NestList[(k++; {Last@# + k, k(k + Last@#)}) &, {4}, 16] // Flatten
  • PARI
    a=4; for(n=1,150,print(a,","); b=if(n%2-1,a*ceil(n/2),a+ceil(n/2)); a=b)
    
  • PARI
    A082448(n,a=4)={for(i=2,n+1,if(bittest(i,0),a*=i\2,a+=i\2));a} \\ M. F. Hasler, Feb 25 2018

Formula

For n>=2, a(2n)=floor((2e+4)*n!)-n-2, a(2n+1)=floor((2e+4)*n!)-1.

Extensions

More terms from Benoit Cloitre, Apr 26 2003
Edited by M. F. Hasler, Feb 25 2018

A019461 Add 1, multiply by 1, add 2, multiply by 2, etc.; start with 0.

Original entry on oeis.org

0, 1, 1, 3, 6, 9, 27, 31, 124, 129, 645, 651, 3906, 3913, 27391, 27399, 219192, 219201, 1972809, 1972819, 19728190, 19728201, 217010211, 217010223, 2604122676, 2604122689, 33853594957, 33853594971, 473950329594, 473950329609, 7109254944135, 7109254944151, 113748079106416
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A019463 (same, but start with 1), A019460 (start with 2), A019462 (start with 3), A082448 (start with 4).
Cf. A082458, A019464 .. A019466 (similar, but first multiply, then add).

Programs

  • Maple
    A019461 := proc(n) option remember; if n = 0 then 0 elif n mod 2 = 1 then (n+1)/2+A019461(n-1) else (n/2)*A019461(n-1); fi; end;
  • Mathematica
    Module[{a = 0}, Join[{a}, Flatten[Array[{a += #, a *= #} &, 20]]]] (* Paolo Xausa, Oct 24 2024 *)
  • PARI
    A019461(n,a=0)={for(i=2,n+1,if(bittest(i,0),a*=i\2,a+=i\2));a} \\ M. F. Hasler, Feb 25 2018

Extensions

Edited by M. F. Hasler, Feb 25 2018
Showing 1-4 of 4 results.