A115362 Row sums of ((1,x) + (x,x^2))^(-1)*((1,x)-(x,x^2))^(-1) (using Riordan array notation).
1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3
Offset: 0
Links
- Antti Karttunen, Table of n, a(n) for n = 0..16384
- Joseph Rosenbaum, Elementary Problem E319, American Mathematical Monthly, volume 45, number 10, December 1938, pages 694-696. (The A indices in P at equations 1' and 2' for p=4.)
Programs
-
Mathematica
a[ n_] := If[ n < 0, 0, 1 + IntegerExponent[n + 1, 4]]; (* Michael Somos, Jul 19 2017 *)
-
PARI
a(n) = 1 + valuation(n+1,4); \\ Joerg Arndt, Oct 07 2015
-
PARI
{a(n) = if( n<0, 0, n%4==3, 1 + a((n - 3) / 4), 1)}; /* Michael Somos, Jul 13 2017 */
-
Sage
[(1/3)*(4-sum(n.digits(4))+sum((n-1).digits(4))) for n in [1..96]] # Tom Edgar, Oct 06 2015
Formula
G.f.: Sum_{k>=0} x^(4^k)/(1-x^(4^k)). - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
Dirichlet g.f. (conjectured): zeta(s)/(1-2^(-2s)). - Ralf Stephan, Mar 27 2015
a(4*n) = a(4*n+1) = a(4*n+2) = 1, a(4*n+3) = 1+a(n), if n >= 0. - Michael Somos, Jul 13 2017
Comments