A007604 a(n) = a(n-1) + a(n-1-(number of odd terms so far)).
1, 2, 3, 4, 6, 9, 12, 16, 22, 31, 40, 52, 68, 90, 121, 152, 192, 244, 312, 402, 523, 644, 796, 988, 1232, 1544, 1946, 2469, 2992, 3636, 4432, 5420, 6652, 8196, 10142, 12611, 15080, 18072, 21708, 26140, 31560, 38212, 46408, 56550, 69161, 81772, 96852
Offset: 1
References
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
Programs
-
Haskell
a007604 n = a007604_list !! (n-1) a007604_list = concat $ map tail $ tail a046936_tabl -- Reinhard Zumkeller, Jan 01 2014
-
Maple
A[1]:= 1: A[2]:= 2: o:= 1: for n from 3 to 100 do A[n]:= A[n-1] + A[n-1-o]; if A[n]::odd then o:= o+1 fi od: seq(A[i],i=1..100); # Robert Israel, Mar 14 2023
-
Mathematica
a[n_Integer] := a[n] = Block[{c, k}, c = 0; k = 1; While[k < n, If[ OddQ[ a[k] ], c++ ]; k++ ]; Return[a[n - 1] + a[n - 1 - c] ] ]; a[1] = 1; a[2] = 2; Table[ a[n], {n, 0, 60} ]
Extensions
Entry revised by N. J. A. Sloane, Oct 26 2014
Comments