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-8 of 8 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

A019464 Multiply by 1, add 1, multiply by 2, add 2, etc., start with 1.

Original entry on oeis.org

1, 1, 2, 4, 6, 18, 21, 84, 88, 440, 445, 2670, 2676, 18732, 18739, 149912, 149920, 1349280, 1349289, 13492890, 13492900, 148421900, 148421911, 1781062932, 1781062944, 23153818272, 23153818285, 324153455990, 324153456004, 4862301840060, 4862301840075, 77796829441200
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A033540 (=a(2n)).
Cf. A082458 (same, but start with 0), A019465 (start with 2), A019466 (start with 3).
Cf. A019460 .. A019463 & A082448 (similar, but first add, then multiply).

Programs

  • Haskell
    a019464 n = a019464_list !! n
    a019464_list = 1 : concat (unfoldr ma (1, [1, 1])) where
       ma (x, [_, j]) = Just (ij', (x + 1, ij')) where ij' = [x * j, x * j + x]
    -- Reinhard Zumkeller, Nov 14 2011
    
  • Mathematica
    a[n_?EvenQ] := n/2 + a[n-1]; a[n_?OddQ] := (n+1)*a[n-1]/2;
    a[0] = 1; Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Nov 15 2011 *)
  • PARI
    A019464(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

For n>=1, a(2n)=floor((1+e)*(n-1)!)-1, a(2n+1)=floor((1+e)*(n+1)!)-n-2. - Benoit Cloitre, Apr 29 2003
a(n+1) = (1/2)*a(n)*(n+1 mod 2)*(n+2) + (1/2)*(n mod 2)*(2*a(n)+n+1). - Francois Jooste (pin(AT)myway.com), Jun 25 2003
a(n) = (n mod 2)*(floor((1+e)*(floor(n/2)+1)!)-floor(n/2)-2)+((n+1) mod 2)*(floor((1+e)*floor(n/2)!)-1) for n >= 1 with a(0) = 1. - Wesley Ivan Hurt, Aug 04 2025

Extensions

Edited by M. F. Hasler, Feb 25 2018

A019466 Multiply by 1, add 1, multiply by 2, add 2, etc.; start with 3.

Original entry on oeis.org

3, 3, 4, 8, 10, 30, 33, 132, 136, 680, 685, 4110, 4116, 28812, 28819, 230552, 230560, 2075040, 2075049, 20750490, 20750500, 228255500, 228255511, 2739066132, 2739066144, 35607859872, 35607859885, 498510038390, 498510038404, 7477650576060, 7477650576075, 119642409217200
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A082458 (same, but start with 0), A019464 (start with 1), A019465 (start with 2).
Cf. A019460 .. A019463 & A082448 (similar, but first add, then multiply).

Programs

  • Mathematica
    Module[{a = 3}, Join[{a}, Flatten[Array[{a *= #, a += #} &, 20]]]] (* Paolo Xausa, Oct 24 2024 *)
  • PARI
    A019466(n,a=3)={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

A082458 Multiply by 1, add 1, multiply by 2, add 2, etc., starting with 0.

Original entry on oeis.org

0, 0, 1, 2, 4, 12, 15, 60, 64, 320, 325, 1950, 1956, 13692, 13699, 109592, 109600, 986400, 986409, 9864090, 9864100, 108505100, 108505111, 1302061332, 1302061344, 16926797472, 16926797485, 236975164790, 236975164804, 3554627472060, 3554627472075, 56874039553200, 56874039553216
Offset: 0

Views

Author

Vladeta Jovovic, Apr 25 2003

Keywords

Comments

Bisections: A007526 and A038154.

Crossrefs

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

Programs

  • Mathematica
    Module[{a = 0}, Join[{a}, Flatten[Array[{a *= #, a += #} &, 20]]]] (* Paolo Xausa, Oct 24 2024 *)
  • PARI
    a(n)=if(n<2,0,if(n%2,(n+1)/2*(floor(exp(1)*((n-1)/2)!)-1),floor(exp(1)*(n/2)!)-1))
    
  • PARI
    A082458(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

Formula

For n>=2, a(2n)=floor(e*n!)-1, a(2*n+1)=(n+1)*(floor(e*n!)-1). - Benoit Cloitre, Apr 28 2003

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

A019465 Multiply by 1, add 1, multiply by 2, add 2, etc., start with 2.

Original entry on oeis.org

2, 2, 3, 6, 8, 24, 27, 108, 112, 560, 565, 3390, 3396, 23772, 23779, 190232, 190240, 1712160, 1712169, 17121690, 17121700, 188338700, 188338711, 2260064532, 2260064544, 29380839072, 29380839085, 411331747190, 411331747204, 6169976208060, 6169976208075, 98719619329200
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A082458 (same, but start with 0), A019465 (start with 2), A019466 (start with 3).
Cf. A019460 .. A019463 & A082448 (similar, but first add, then multiply).

Programs

  • Maple
    A[0]:= 2:
    for n from 0 to 14 do
      A[2*n+1]:= (n+1)*A[2*n];
      A[2*n+2]:= (n+1)+A[2*n+1];
    od:
    seq(A[i],i=0..30); # Robert Israel, Dec 22 2015
  • Mathematica
    a = {2}; Do[If[EvenQ@ Length@ a, AppendTo[a, Floor[Length[a]/2] Last@ a],
    AppendTo[a, Last@ a + Floor[Length[a] /2]]], {k, 27}]; Rest@ a (* Michael De Vlieger, Dec 22 2015 *)
  • PARI
    A019465(n,a=2)={for(i=2,n+1,if(bittest(i,0),a+=i\2,a*=i\2));a} \\ M. F. Hasler, Feb 25 2018

Formula

From Robert Israel, Dec 22 2015: (Start)
a(2*k) = 2*k! + Sum_{j=0..k-1} k!/j! = 2*k! + k*e*Gamma(k,1).
a(2*k+1) = 2*(k+1)! + Sum_{j=0..k-1} (k+1)!/j! = 2*(k+1)! + k*(k+1)*e*Gamma(k,1).
a(n) ~ (e+2)*(ceiling(n/2))!. (End)

Extensions

Edited by M. F. Hasler, Feb 25 2018

A019462 Add 1, multiply by 1, add 2, multiply by 2, etc., start with 3.

Original entry on oeis.org

3, 4, 4, 6, 12, 15, 45, 49, 196, 201, 1005, 1011, 6066, 6073, 42511, 42519, 340152, 340161, 3061449, 3061459, 30614590, 30614601, 336760611, 336760623, 4041127476, 4041127489, 52534657357, 52534657371, 735485203194, 735485203209, 11032278048135, 11032278048151
Offset: 0

Views

Author

Keywords

Crossrefs

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

Programs

  • Mathematica
    Module[{a = 3}, Flatten[{a, Array[{a += #, a *= #} &, 20]}]] (* Paolo Xausa, Oct 24 2024 *)
  • PARI
    A019462(n, a=3)={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-8 of 8 results.