login
A274213
Meta recurrence: a(0) = 1, a(1) = 2, a(2) = 3, a(n) = a(n - a(n-3)) + 3 for n > 2.
2
1, 2, 3, 6, 6, 6, 4, 5, 6, 9, 9, 9, 9, 9, 9, 7, 8, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 10, 11, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 14, 15, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 16, 17, 18, 21, 21, 21, 21, 21, 21, 21
OFFSET
0,2
COMMENTS
The sequence is constructed by starting with 3*m copies of 3*(m+1), followed by 3*m+1, 3*m+2, 3*m+3, as m varies from 0, 1, 2, ... It is straightforward to check that this construction satisfies the recurrence relation.
The construction shows that the sequence is well defined, every positive integer is in the sequence, and every integer not a proper multiple of 3 appears only once. If t is a multiple of 3, then t appears t-2 times.
In general, the meta recurrence a(n) = a(n-a(n-k))+k with initial conditions a(i) = i+1 for i = 0,...,k-1 has a simple solution and can be constructed starting with k*m copies of k*(m+1), followed by k*m+1, k*m+2, ..., k*(m+1), as m varies from 0, 1, 2, ... This sequence is well defined, every positive integer is in the sequence, and every integer not a proper multiple of k appears once. If t is a multiple of k, then t appears t-k+1 times.
MATHEMATICA
A274213[n_] := A274213[n] = If[n < 3, n + 1, A274213[n - A274213[n - 3]] + 3]; Array[A274213, 100, 0] (* Paolo Xausa, May 24 2024 *)
PROG
(Python)
A274213_list = [1, 2, 3]
for n in range(3, 10001):
A274213_list.append(A274213_list[-A274213_list[-3]]+3)
(Magma) I:=[1, 2, 3]; [n le 3 select I[n] else Self(n-Self(n-3))+3 : n in [1..80]]; // Vincenzo Librandi, Jun 18 2016
CROSSREFS
Sequence in context: A085273 A151850 A290223 * A350315 A078706 A077082
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Jun 13 2016
STATUS
approved