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.

A213541 a(n) = n AND n^2, where AND is the bitwise AND operator.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 4, 1, 0, 1, 0, 9, 0, 9, 4, 1, 0, 1, 0, 1, 16, 17, 4, 17, 0, 17, 0, 25, 16, 9, 4, 1, 0, 1, 0, 1, 0, 1, 36, 33, 0, 1, 32, 41, 0, 41, 4, 33, 0, 33, 0, 33, 16, 49, 36, 17, 0, 49, 32, 25, 16, 9, 4, 1, 0, 1, 0, 1, 0, 1, 4, 1, 64, 65, 64, 73, 0, 9, 68
Offset: 0

Views

Author

Alex Ratushnyak, Jun 14 2012

Keywords

Comments

The graph of this sequence has the shape of a tilted Sierpinski triangle. - WG Zeist, Jan 15 2019

Crossrefs

Cf. A213370.
Cf. A000290.
Cf. A007745 (OR), A169810 (XOR), A002378.

Programs

  • Haskell
    import Data.Bits ((.&.))
    a213541 n = n .&. n ^ 2  -- Reinhard Zumkeller, Apr 25 2013
    
  • Mathematica
    Table[BitAnd[n, n^2], {n, 0, 63}] (* Alonso del Arte, Jun 19 2012 *)
  • PARI
    a(n) = bitand(n, n^2); \\ Michel Marcus, Jan 15 2019
  • Python
    print([n*n & n for n in range(99)])
    

Formula

a(2^k + x) = a(x) + (x^2 AND 2^k) for 0 <= x < 2^k. - David Radcliffe, May 06 2023