OFFSET
1,1
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
FORMULA
a(3*n+1) = 3*n+2, a(3*n+2) = 3*n+3 and a(3*n+3) = 3*n+4 + a(n+1) for n >= 0.
G.f.: A(x) = Sum_{k>=0} (1/(1 - x^(3^k))^2 - 1).
PROG
(Ruby)
def A(k, n)
ary = [0]
(1..n).each{|i|
j = i + 1
j += ary[i / k] if i % k == 0
ary << j
}
ary[1..-1]
end
p A(3, 80)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, May 27 2024
STATUS
approved