login

Revision History for A249039

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing all changes.
a(1)=1, a(2)=2; thereafter a(n) = a(n-1) + a(n-1-(number of even terms so far)) + a(n-1-(number of odd terms so far)).
(history; published version)
#10 by Reinhard Zumkeller at Tue Nov 11 10:57:40 EST 2014
STATUS

editing

approved

#9 by Reinhard Zumkeller at Tue Nov 11 10:43:13 EST 2014
FORMULA

For n > 1: a(n+1) = a(n) + a(n - A249040(n)) + a(n - A249041(n)) by mutual recursion. - Reinhard Zumkeller, Nov 11 2014

#8 by Reinhard Zumkeller at Tue Nov 11 10:41:45 EST 2014
PROG

(Haskell)

import Data.List (genericIndex)

a249039 n = genericIndex a249039_list (n - 1)

a249039_list = 1 : 2 : f 2 2 1 1 where

f x u v w = y : f (x + 1) y (v + 1 - mod y 2) (w + mod y 2)

where y = u + a249039 (x - v) + a249039 (x - w)

-- Reinhard Zumkeller, Nov 11 2014

#7 by Reinhard Zumkeller at Tue Nov 11 10:40:42 EST 2014
LINKS

Reinhard Zumkeller, <a href="/A249039/b249039.txt">Table of n, a(n) for n = 1..10000</a>

STATUS

approved

editing

#6 by N. J. A. Sloane at Sun Oct 26 18:17:22 EDT 2014
STATUS

editing

approved

#5 by N. J. A. Sloane at Sun Oct 26 18:17:19 EDT 2014
NAME

a(1)=1, a(2)=2; thereafter a(n) = a(n-1) + a(n-1-(number of even terms so far)) + a(n-1-(number of odd terms so far)).

COMMENTS

Suggested by A006336 and , A007604 and A249036-A249038.

MAPLE

v[n]:=v[n-1]+v[n-1-w[n-1]]+v[n-1-x[n-1]];

[seq(v[n], n=1..M)]; # A249036A249039

[seq(w[n], n=1..M)]; # A249037A249040

[seq(x[n], n=1..M)]; # A249038A249041

CROSSREFS

Cf. A006336, A007604, A249036, A249037, A249038.

A249037 A249040 and A249038 A249041 give numbers of even and odd terms so far.

STATUS

approved

editing

#4 by N. J. A. Sloane at Sun Oct 26 18:15:26 EDT 2014
STATUS

editing

approved

#3 by N. J. A. Sloane at Sun Oct 26 18:15:23 EDT 2014
NAME

q

a(1)=1, a(2)=2; thereafter a(n) = a(n-1-(number of even terms so far)) + a(n-1-(number of odd terms so far)).

COMMENTS

Suggested by A006336 and A007604.

MAPLE

M:=100;

v[1]:=1; v[2]:=2; w[1]:=0; w[2]:=1; x[1]:=1; x[2]:=1;

for n from 3 to M do

v[n]:=v[n-1-w[n-1]]+v[n-1-x[n-1]];

if v[n] mod 2 = 0 then w[n]:=w[n-1]+1; x[n]:=x[n-1];

else w[n]:=w[n-1]; x[n]:=x[n-1]+1; fi;

od:

[seq(v[n], n=1..M)]; # A249036

[seq(w[n], n=1..M)]; # A249037

[seq(x[n], n=1..M)]; # A249038

CROSSREFS

Cf. A006336, A007604.

A249037 and A249038 give numbers of even and odd terms so far.

#2 by N. J. A. Sloane at Sun Oct 26 18:13:37 EDT 2014
NAME

allocated for N. J. A. Sloane

q

DATA

1, 2, 4, 7, 11, 17, 26, 37, 52, 70, 92, 120, 157, 200, 254, 323, 401, 490, 597, 719, 859, 1021, 1211, 1438, 1687, 1979, 2325, 2740, 3183, 3704, 4262, 4863, 5553, 6350, 7201, 8174, 9216, 10336, 11545, 12894, 14350, 15928, 17646, 19526, 21596, 23893, 26352, 29060, 32060, 35406, 39167

OFFSET

1,2

KEYWORD

allocated

nonn

AUTHOR

N. J. A. Sloane, Oct 26 2014

STATUS

approved

editing

#1 by N. J. A. Sloane at Sun Oct 19 16:30:51 EDT 2014
NAME

allocated for N. J. A. Sloane

KEYWORD

allocated

STATUS

approved