OFFSET
1,2
COMMENTS
a(n) is also the number of elements in the set {(x,y): 1<=x,y<=n, the fraction x/y reduces to a fraction of the form (odd#)/(odd#)}. - Adam McDougall (mcdougall.adam(AT)gmail.com), Feb 20 2009
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
A. Erickson and F. Ruskey, Enumerating maximal tatami mat coverings of square grids with v vertical dominoes, arXiv:1304.0070 [math.CO], 2013.
R. A. MacLeod, On the Largest Odd Divisor of n, The American Mathematical Monthly, Vol. 75, No. 6 (Jun. - Jul., 1968), pp. 647-648.
FORMULA
a(n) = Sum_{k>=1} (round(n/2^k))^2. - Alejandro Erickson, Apr 13 2012
a(n) = n^2/3 + O(n) (see MacLeod link). - Michel Marcus, Dec 05 2013
a(j*2^k) = a(j) + (4^k-1)*j^2/3 for any j >= 1, k >= 0. - Jinyuan Wang, Mar 23 2019
MATHEMATICA
Accumulate[Table[Times@@(#[[1]]^#[[2]]&/@Select[FactorInteger[i], #[[1]] != 2&]), {i, 90}]] (* Harvey P. Dale, Jun 25 2013 *)
PROG
(HP 50G Calculator) IDIV2 returns quotient & remainder to stack.
<< 0 SWAP
WHILE DUP 0 >
REPEAT 2 IDIV2 OVER + SQ ROT + SWAP
END DROP >>
# Gerald Hillier, May 02 2009, May 18 2009, Aug 01 2009
(PARI) a(n)=sum(k=1, log(n)\log(2)+1, round(n/2^k)^2) \\ Charles R Greathouse IV, Oct 06 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 10 2008
STATUS
approved