A266539 Terms of A006257 (Josephus problem) repeated.
0, 0, 1, 1, 1, 1, 3, 3, 1, 1, 3, 3, 5, 5, 7, 7, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 17, 17, 19, 19, 21, 21, 23, 23, 25, 25, 27, 27, 29, 29, 31, 31, 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15, 17, 17, 19, 19, 21, 21, 23, 23, 25, 25
Offset: 1
Examples
Written as an irregular triangle in which the row lengths are twice the terms of A011782 the sequence begins: 0, 0; 1, 1; 1, 1, 3, 3; 1, 1, 3, 3, 5, 5, 7, 7; 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15; ... Row sums give 0 together with A004171.
Links
Crossrefs
Programs
-
Maple
A006257[0]:=0: for n from 1 to 100 do A006257[n]:=(A006257[n-1]+1) mod n +1: end do: seq(A006257[i]$2,i=0..100); # Robert Israel, Jan 13 2016
-
Mathematica
Join[{0, 0}, Table[SeriesCoefficient[(1 + x^2)/((-1 + x)^2 (1 + x)), {x, 0, m}], {n, 6}, {m, 0, 2^n - 1}]] // Flatten (* Michael De Vlieger, Jan 05 2016 *)
Formula
G.f.: (x^2 + x^4)/(1 - x - x^2 + x^3) - (1 - x)^(-1)*Sum_{k>=1} 2^k*x^(2^(k+1)). - Robert Israel, Jan 13 2016
Extensions
Offset changed to 1 by Ivan Neretin, Feb 09 2017
Comments