|
|
A080029
|
|
a(n) is taken to be the smallest positive integer not already present which is consistent with the condition "n is a member of the sequence if and only if a(n) is a multiple of 3".
|
|
5
|
|
|
0, 2, 3, 6, 5, 9, 12, 8, 15, 18, 11, 21, 24, 14, 27, 30, 17, 33, 36, 20, 39, 42, 23, 45, 48, 26, 51, 54, 29, 57, 60, 32, 63, 66, 35, 69, 72, 38, 75, 78, 41, 81, 84, 44, 87, 90, 47, 93, 96, 50, 99, 102, 53, 105, 108, 56, 111, 114, 59, 117, 120, 62, 123, 126, 65, 129, 132, 68
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
a(3m)=6m, a(3m+1)=3m+2, a(3m+2)=6m+3.
|
|
MATHEMATICA
|
|
|
PROG
|
(Python)
def a(n): m, r = divmod(n, 3); return 3*(2-r%2)*m + (r > 0)*(r+1)
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|