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.

A292410 Difference between (2n+1)^2 and highest power of 2 less than or equal to (2n+1)^2.

Original entry on oeis.org

0, 1, 9, 17, 17, 57, 41, 97, 33, 105, 185, 17, 113, 217, 329, 449, 65, 201, 345, 497, 657, 825, 1001, 161, 353, 553, 761, 977, 1201, 1433, 1673, 1921, 129, 393, 665, 945, 1233, 1529, 1833, 2145, 2465, 2793, 3129, 3473, 3825, 89, 457, 833, 1217, 1609, 2009, 2417, 2833, 3257
Offset: 0

Views

Author

Zhandos Mambetaliyev, Sep 15 2017

Keywords

Examples

			a(0) = 1^2 - 2^0 =  0.
a(1) = 3^2 - 2^3 =  1.
a(2) = 5^2 - 2^4 =  9.
a(3) = 7^2 - 2^5 = 17.
a(4) = 9^2 - 2^6 = 17.
		

Crossrefs

Cf. A000079 (2^n), A016754 (odd squares), A053645 (distance to power of 2), A056577.

Programs

  • Maple
    seq((2*n+1)^2 - 2^ilog2((2*n+1)^2), n=0..100); @ Robert Israel, Oct 19 2017
  • Mathematica
    Table[# - 2^Floor@ Log2@ # &[(2 n + 1)^2], {n, 0, 53}] (* Michael De Vlieger, Sep 18 2017 *)
  • PARI
    a(n) = my(k = 0); while(2^k < (2*n+1)^2, k++); if (k, k--); (2*n+1)^2 - 2^k; \\ Michel Marcus, Sep 16 2017

Formula

a(n) = A053645(A016754(n)). - Michel Marcus, Sep 16 2017

Extensions

More terms from Michel Marcus, Sep 16 2017