|
|
A111201
|
|
a(1)=1 then a(n)=a(n-1)+n if n is already in the sequence, a(n)=a(n-1)+n+1 otherwise.
|
|
0
|
|
|
1, 4, 8, 12, 18, 25, 33, 41, 51, 62, 74, 86, 100, 115, 131, 148, 166, 184, 204, 225, 247, 270, 294, 319, 344, 371, 399, 428, 458, 489, 521, 554, 587, 622, 658, 695, 733, 772, 812, 853, 894, 937, 981, 1026, 1072, 1119, 1167, 1216, 1266, 1317, 1368, 1421, 1475
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(n)=(1/2)*(n^2+3*n-sqrt(3n)-sqrt(n))+o(n^(1/2))
|
|
EXAMPLE
|
2 is not in the sequence thus a(2)=a(1)+2+1=4 which is in the sequence thus a(4)=a(3)+4 but 3 is not in the sequence thus a(3)=a(2)+4=8 and a(4)=12
|
|
PROG
|
(PARI) an=vector(100); a(n)=if(n<0, 0, an[n]); an[1]=1; for(n=2, 1000, an[n]=if(setsearch(Set(vector(n-1, i, a(i))), n), a(n-1)+n, a(n-1)+n+1))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|