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.

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