%I #36 Jun 23 2020 14:34:52
%S 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,
%T 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,
%U 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
%N Terms of A006257 (Josephus problem) repeated.
%C First differs from both A266509 and A266529 at a(25), and shares with them infinitely many terms.
%H Ivan Neretin, <a href="/A266539/b266539.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a>
%F 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
%e Written as an irregular triangle in which the row lengths are twice the terms of A011782 the sequence begins:
%e 0, 0;
%e 1, 1;
%e 1, 1, 3, 3;
%e 1, 1, 3, 3, 5, 5, 7, 7;
%e 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15;
%e ...
%e Row sums give 0 together with A004171.
%p A006257[0]:=0: for n from 1 to 100 do A006257[n]:=(A006257[n-1]+1) mod n +1: end do:
%p seq(A006257[i]$2,i=0..100); # _Robert Israel_, Jan 13 2016
%t 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 *)
%Y Partial sums give A266540.
%Y Cf. A004171, A006257, A011782, A256249, A266509, A266529, A266535.
%K nonn,tabf
%O 1,7
%A _Omar E. Pol_, Jan 02 2016
%E Offset changed to 1 by _Ivan Neretin_, Feb 09 2017