login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A045975
Take the first odd integer and multiple of 1, the next 2 even integers and multiples of 2, the next 3 odd integers and multiples of 3, the next 4 even integers and multiples of 4, ...
6
1, 2, 4, 9, 15, 21, 24, 28, 32, 36, 45, 55, 65, 75, 85, 90, 96, 102, 108, 114, 120, 133, 147, 161, 175, 189, 203, 217, 224, 232, 240, 248, 256, 264, 272, 280, 297, 315, 333, 351, 369, 387, 405, 423, 441, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 561, 583, 605, 627, 649, 671, 693
OFFSET
1,2
COMMENTS
A generalized Connell sequence.
LINKS
EXAMPLE
Triangle begins:
1;
2, 4;
9, 15, 21;
24, 28, 32, 36;
45, 55, 65, 75, 85;
90, 96, 102, 108, 114, 120;
133, 147, 161, 175, 189, 203, 217;
...
MATHEMATICA
first[n_?EvenQ] := (n - 1)*n^2/2; first[n_?OddQ] := n*(n^2 - 2n + 3)/2; row[n_] := (ro = {first[n]}; next = first[n] + n; While[ Length[ro] < n, If[Mod[next , 2] == Mod[n, 2], AppendTo[ro, next]]; next = next + n]; ro); Flatten[ Table[row[n], {n, 1, 11}]](* Jean-François Alcover, Jun 08 2012 *)
PROG
(Haskell)
a045975 n k = a045975_tabl !! (n-1) !! (k-1)
a045975_row n = a045975_tabl !! (n-1)
a045975_tabl = f 1 [1..] where
f k xs = ys : f (k+1) (dropWhile (<= last ys) xs) where
ys | even k = take k ms
| otherwise = take k $ filter odd ms
ms = filter ((== 0) . (`mod` k)) xs
-- Reinhard Zumkeller, Jan 18 2012
CROSSREFS
Seen as a triangle read by rows: cf. A204558 (row sums), A005917 (central terms), A204556 (left edge), A204557 (right edge).
Sequence in context: A036277 A042960 A266596 * A058296 A347473 A025217
KEYWORD
nonn,easy,nice,tabl
AUTHOR
Fang-kuo Huang (gsyps(AT)ms17.hinet.net)
EXTENSIONS
More terms from James A. Sellers
Keyword tabl added by Reinhard Zumkeller, Jan 18 2012
STATUS
approved