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.

A182251 a(0) = 0, a(n) = (a(n-1) OR n) * n.

Original entry on oeis.org

0, 1, 6, 21, 84, 425, 2586, 18137, 145096, 1305873, 13058830, 143647141, 1723765788, 22408955257, 313725373682, 4705880605425, 75294089686800, 1279999524675617, 23039991444161430, 437759837439067189, 8755196748781343780, 183859131724408219737, 4044900897936980834346
Offset: 0

Views

Author

Alex Ratushnyak, Apr 20 2012

Keywords

Crossrefs

Cf. A080098.

Programs

  • Mathematica
    a[0]=0; a[n_]:=n BitOr[a[n-1],n]; Array[a,23,0] (* Stefano Spezia, Apr 15 2022 *)
    nxt[{n_,a_}]:={n+1,BitOr[a,n+1](n+1)}; NestList[nxt,{0,0},30][[All,2]] (* Harvey P. Dale, Feb 08 2023 *)
  • PARI
    a(n) = if (n==0, 0, n*bitor(a(n-1), n)); \\ Michel Marcus, Apr 16 2022
  • Python
    a=0
    for i in range(1,51):
      print(a)
      a |= i
      a *= i
    

Formula

a(0) = 0, a(n) = (a(n-1) OR n) * n, where OR is the bitwise logical inclusive-OR operator.