A130829 2n+1 appears 2n times.
3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17
Offset: 1
Programs
-
Maple
seq(2*n+1 $ 2*n, n=1..10); # Robert Israel, Jan 14 2015
-
Python
from math import isqrt def A130829(n): return 1|((m:=isqrt(n))+int((n-m*(m+1)<<2)>=1)<<1) # Chai Wah Wu, Oct 17 2022
Formula
a(n) = 2*floor(sqrt(n)+1/2)+1. - Mikael Aaltonen, Jan 14 2015
From Robert Israel, Jan 14 2015: (Start)
G.f.: (x/(1-x))*(1+2*Sum_{m>=0} x^(m*(m+1))) = (x/(1-x))*(1+x^(-1/4)*theta_2(0,x)) where theta_2 is the second Jacobi theta function.
a(2n) = a(2n-1) = 2*A002024(n)+1.
a(n) = A001670(n)+1.
(End)