OFFSET
0,2
COMMENTS
Conjecture: Every positive integer is in this sequence.
Conjecture: Odd numbers are not repeated.
Both conjectures are true. Sequence follows the pattern: for n = 0,1,2,..., the sequence consists of 2*n terms of value 2*(n+1), followed by the terms 2*n+1 and 2*(n+1). Thus 0 terms of 2 followed by 1 and 2, then 2 terms of 4 followed by 3 and 4, then 4 terms of 6 followed by 5 and 6, etc. In other words, a(n*(3+n)) = 2n+1 and for the rest of the terms, a(n*(n+1)) ,..., a(n+(n+1)^2) = 2*(n+1). It can be shown that this definition satisfies the recurrence relation. - Chai Wah Wu, Jun 06 2016
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
MATHEMATICA
a[0]=1; a[1]=2; a[n_]:=a[n]=a[n-a[n-2]]+2; Table[a[n], {n, 0, 1000}]
PROG
(Haskell)
a193358 n = a193358_list !! n
a193358_list =
1 : 2 : (map ((+ 2) . a193358) $ zipWith (-) [2..] a193358_list)
-- Reinhard Zumkeller, Jul 27 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Jul 24 2011
EXTENSIONS
Offset fixed by Reinhard Zumkeller, Jul 27 2011
STATUS
approved