A235963 n appears (n+1)/(1 + (n mod 2)) times.
0, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13
Offset: 0
Examples
As a triangle: 0; 1; 2, 2, 2; 3, 3; 4, 4, 4, 4, 4; 5, 5, 5; 6, 6, 6, 6, 6, 6, 6; 7, 7, 7, 7; 8, 8, 8, 8, 8, 8, 8, 8, 8; ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..5000
Programs
-
Maple
T:= n-> n$(n+1)/(n mod 2+1): seq(T(n), n=0..13); # Alois P. Heinz, Nov 23 2024
-
Mathematica
Table[Table[n, {(n + 1)/(1 + Mod[n, 2])}], {n, 0, 14}]//Flatten (* T. D. Noe, Jan 29 2014 *)
-
Python
from math import isqrt def A235963(n): return (m:=isqrt((n+1<<3)//3))-(n+1<=(m*(3*m+4)+1 if m&1 else m*(3*m+2))>>3) # Chai Wah Wu, Nov 23 2024
-
Python
A235963=lambda n: ((s:=isqrt(24*n+1))+1)//6+(s-1)//6 # Natalia L. Skirrow, May 13 2025
Formula
Let t = (sqrt(n*8/3 + 1) - 1)/2 + 1/3 and let k = floor(t); then a(n) = 2k if t - k < 2/3, 2k+1 otherwise. - Jon E. Schoenfield, Jun 13 2017
a(n) = m if n+1>A001318(m) and a(n) = m-1 otherwise where m = floor(sqrt(8(n+1)/3)). - Chai Wah Wu, Nov 23 2024
From Natalia L. Skirrow, May 13 2025: (Start)
a(n) = floor((s+1)/6) + floor((s-1)/6) where s=floor(sqrt(24*n+1)).
G.f.: (f(x,x^2)-1)/(1-x), where f is Ramanujan's bivariate theta function. (End)
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)-1)*Pi/8 + (2-sqrt(2))*log(2)/8 + log(2+sqrt(2))/(2*sqrt(2)). - Amiram Eldar, May 28 2025
Comments