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

A275583
The multiples of 3 of the sequence appear in blocks. The successive sizes of these blocks are given by the sequence itself.
0
1, 2, 3, 4, 5, 6, 9, 7, 8, 10, 11, 12, 15, 18, 13, 14, 16, 17, 19, 20, 21, 24, 27, 30, 22, 23, 25, 26, 28, 29, 31, 32, 33, 36, 39, 42, 45, 34, 35, 37, 38, 40, 41, 43, 44, 46, 47, 48, 51, 54, 57, 60, 63, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 64, 65, 66, 69, 72, 75, 78, 81, 84, 87, 90, 67, 68, 70, 71, 73, 74, 76, 77, 79, 80, 82, 83, 85, 86, 88, 89, 91, 92, 93
OFFSET
1,2
COMMENTS
The sequence is started with a(1)=1 and always extended with the smallest integer not yet used that doesn't lead to a contradiction.
The sequence is a permutation of the natural numbers.
EXAMPLE
The blocks of multiples of 3 are indicated here by parentheses; the successive block-sizes are 1, 2, 3, 4, 5, ... which reproduces the sequence itself:
1,2,(3),4,5,(6,9),7,8,10,11,(12,15,18),13,14,16,17,19,20,(21,24,27,30),22,23,25,26,28,29,31,32,(33,36,39,42,45),34,...
MATHEMATICA
a[1]=1; a[n_]:=a[n]=Block[{k=1}, While[MemberQ[s=Array[a, n-1], k]||(g=Length/@Select[SplitBy[Join[s, {k}], Mod[#, 3]==0&], Mod[First@#, 3]==0&]; g!=s[[;; Length@g]]), If[Mod[k, 3]==0&&FreeQ[s, k], Break[], k++]]; k]; Array[a, 93] (* Giorgos Kalogeropoulos, May 12 2022 *)
CROSSREFS
Sequence in context: A345900 A029964 A368240 * A295088 A332990 A257815
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Aug 02 2016
STATUS
approved