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.

A330569 a(n) = 1 if n is odd, otherwise a(n) = 2^(v-1)+1 where v is the 2-adic valuation of n (A007814(n)).

Original entry on oeis.org

1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 9, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 17, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 9, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 33, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 9, 1, 2, 1, 3, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2020

Keywords

Comments

Conjecture: a(n) is the height of the bottom region in column n of the Conant gasket in A328078.

Crossrefs

Programs

  • Mathematica
    a[n_] := If[OddQ[n], 1, 1 + 2^(IntegerExponent[n, 2] - 1)]; Array[a, 100] (* Amiram Eldar, Aug 30 2024 *)
  • PARI
    a(n) = if(n % 2, 1, 1 + 1 << (valuation(n, 2) - 1)); \\ Amiram Eldar, Aug 30 2024
  • Python
    def A330569(n): return 1+(0 if n&1 else 1<<(~n & n-1).bit_length()-1) # Chai Wah Wu, Jul 01 2022
    

Formula

a(n) = (A006519(n) + A040001(n))/2. - Ridouane Oudra, Jul 30 2025