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”).

A193358
a(0)=1; a(1)=2 and for n>1: a(n)=a(n-a(n-2))+2.
5
1, 2, 4, 4, 3, 4, 6, 6, 6, 6, 5, 6, 8, 8, 8, 8, 8, 8, 7, 8, 10, 10, 10, 10, 10, 10, 10, 10, 9, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
OFFSET
0,2
COMMENTS
Conjecture: Every positive integer is in this sequence.
Conjecture: Odd numbers are not repeated.
a(A193422(n)) = n and a(m) <> n for m < A193422(n). [Reinhard Zumkeller, Jul 27 2011]
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
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
Sequence in context: A202690 A342754 A257978 * A214028 A079533 A072872
KEYWORD
nonn
AUTHOR
EXTENSIONS
Offset fixed by Reinhard Zumkeller, Jul 27 2011
STATUS
approved