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.

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, ...

This page as a plain text file.
%I A045975 #20 Jul 02 2025 16:01:56
%S A045975 1,2,4,9,15,21,24,28,32,36,45,55,65,75,85,90,96,102,108,114,120,133,
%T A045975 147,161,175,189,203,217,224,232,240,248,256,264,272,280,297,315,333,
%U A045975 351,369,387,405,423,441,450,460,470,480,490,500,510,520,530,540,561,583,605,627,649,671,693
%N 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, ...
%C A045975 A generalized Connell sequence.
%H A045975 Reinhard Zumkeller, <a href="/A045975/b045975.txt">Rows n=1..150 of triangle, flattened</a>
%e A045975 Triangle begins:
%e A045975     1;
%e A045975     2,   4;
%e A045975     9,  15,  21;
%e A045975    24,  28,  32,  36;
%e A045975    45,  55,  65,  75,  85;
%e A045975    90,  96, 102, 108, 114, 120;
%e A045975   133, 147, 161, 175, 189, 203, 217;
%e A045975   ...
%t A045975 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 *)
%o A045975 (Haskell)
%o A045975 a045975 n k = a045975_tabl !! (n-1) !! (k-1)
%o A045975 a045975_row n = a045975_tabl !! (n-1)
%o A045975 a045975_tabl = f 1 [1..] where
%o A045975    f k xs = ys : f (k+1) (dropWhile (<= last ys) xs) where
%o A045975      ys | even k    = take k ms
%o A045975         | otherwise = take k $ filter odd ms
%o A045975      ms = filter ((== 0) . (`mod` k)) xs
%o A045975 -- _Reinhard Zumkeller_, Jan 18 2012
%Y A045975 Cf. A001614, A033291.
%Y A045975 Seen as a triangle read by rows: cf. A204558 (row sums), A005917 (central terms), A204556 (left edge), A204557 (right edge).
%K A045975 nonn,easy,nice,tabl
%O A045975 1,2
%A A045975 Fang-kuo Huang (gsyps(AT)ms17.hinet.net)
%E A045975 More terms from _James Sellers_
%E A045975 Keyword tabl added by _Reinhard Zumkeller_, Jan 18 2012