OFFSET
1,2
COMMENTS
The subsequence of every other term (a(2n-1), n >= 1) is the ruler sequence A007814 = (0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, ...), in particular every fourth term is zero. The nonzero terms among them, a(4n-1) = A007814(2n) (n >= 1) have both their neighbors equal to one more than themselves, a(4n-2) = a(4n) = a(4n-1) + 1 = A007814(2n) + 1.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
From Robert Israel, Dec 04 2016: (Start)
G.f.: (1+x+x^2)*Sum_{k>=1} x^(2^k-2)/(1-x^(2^k)) - 1/(1-x). (End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Sep 13 2024
MAPLE
seq(padic:-ordp(n*(n+1)*(n+2)/6, 2), n=1..100); # Robert Israel, Dec 04 2016
MATHEMATICA
a[n_] := IntegerExponent[n*(n+1)*(n+2)/6, 2]; Array[a, 100] (* Amiram Eldar, Sep 13 2024 *)
PROG
(PARI) a(n)=valuation(n*(n+1)*(n+2)/6, 2)
(Magma) [Valuation(n*(n+1)*(n+2)/6, 2): n in [1..100]]; // Vincenzo Librandi, Dec 04 2016
(Python)
def A275019(n): return (~(m:=n*(n+1)*(n+2)//6)& m-1).bit_length() # Chai Wah Wu, Jul 07 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Dec 03 2016
STATUS
approved