A270226 a(n) is the number of terms in the n-th block of consecutive integers of A136119.
1, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3
Offset: 1
Keywords
Examples
From A136119 consecutive blocks are 1 a(1)=1, 3, 4, 5 a(2)=3, 7, 8 a(3)=2, 10, 11 a(4)=2, 13, 14, 15 a(5)=3.
Crossrefs
Cf. A136119.
Programs
-
C
#include
#include int main(){ int i,a,b; int j=0; for(i=2; i<200; i++){ a=ceil((i-0.5)*sqrt(2)); b=ceil((i-1.5)*sqrt(2)); if(a-b==1)j++; else{j++; printf("%d,",j); j=0;} } return 0; }
Formula
a(1)=1, a(n+1) = floor(n*sqrt(2)+1/sqrt(2)) - floor((n-1)*sqrt(2)+1/sqrt(2)) + 1. - Michel Dekking, Jan 22 2017
Comments