OFFSET
1,1
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
FORMULA
a(4*n+1) = 4*n+2, a(4*n+2) = 4*n+3, a(4*n+3) = 4*n+4 and a(4*n+4) = 4*n+5 + a(n+1) for n >= 0.
G.f.: A(x) = Sum_{k>=0} (1/(1 - x^(4^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(4, 90)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, May 27 2024
STATUS
approved