cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Ryohei Miyadera

Ryohei Miyadera's wiki page.

Ryohei Miyadera has authored 19 sequences. Here are the ten most recent ones:

A196126 Let A = {(x,y): x, y positive natural numbers and y <= x <= y^2}. a(n) is the cardinality of the subset {(x,y) in A such that x <= n}.

Original entry on oeis.org

1, 2, 4, 7, 10, 14, 19, 25, 32, 39, 47, 56, 66, 77, 89, 102, 115, 129, 144, 160, 177, 195, 214, 234, 255, 276, 298, 321, 345, 370, 396, 423, 451, 480, 510, 541, 572, 604, 637, 671
Offset: 1

Author

Taishi Inoue, Hiroshi Matsui, and Ryohei Miyadera, Sep 27 2011

Keywords

Comments

The set A locates integer points in the first quadrant above the parabola y=sqrt(x) up to the diagonal y=x. a(n) counts them up to a sliding right margin.
The first differences of the sequence are 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31, ....
In that way the sequence is constructed from first differences which are the natural numbers and repetitions for 3, 7, 13, 21, 31, 43, 57, 73, 91,...., (apparently the elements of A002061 starting at 3).

Examples

			The set is A = {(1,1),(2,2),(3,2),(4,2),(3,3),(4,3),(5,3),(6,3),(7,3),(8,3),(9,3),(4,4),(5,4),...}.
a(1) = 1 that is the number of elements in {(1,1)},
a(2) = 2 that is the number of elements in {(1,1),(2,2)} and
a(3) = 4 that is the number of elements in {(1,1),(2,2),(3,2),(3,3)},  ...
		

Programs

  • Mathematica
    (* Calculates a(n) using the definition of the sequence. *)
    data = Flatten[Table[Table[{k, n}, {k, n, n^2}], {n, 1, 40}], 1];
    Table[Length[Select[data, #[[1]] <= m &]], {m, 1, 40}]
    (* Calculates a(n) using a formula. *)
    ff[t_] := Block[{u}, u = Floor[Sqrt[t]]; u (u + 1) (2 u + 1)/6 - u (u - 1)/2 + (t - u) (t - u + 1)/2]; Table[ff[t], {t, 1, 40}]
  • PARI
    a(n)=my(u=sqrtint(n));u*(u^2+2)/3+(n-u)*(n-u+1)/2 \\ Charles R Greathouse IV, Oct 05 2011

Formula

a(n) = u*(u+1)*(2*u+1)/6 - u*(u-1)/2 + (n-u)*(n-u+1)/2, where u = floor(sqrt(n)) = A000196(n).

Extensions

Entry rewritten by R. J. Mathar, Jan 28 2012

A165728 If we divide the sequence into these subsequences, the pattern is obvious. {{1,1}, {0,1}, {1,1}}, {{0,1,0,1}, {1,1,1,1}, {0,1,0,1}}, {{1,1,1,1,1,1,1,1}, {0,1,0,1,0,1,0,1}, {1,1,1,1,1,1,1,1}}, {{0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1}}, ...

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Offset: 1

Author

Ryohei Miyadera and Masakazu Naito, Sep 25 2009

Keywords

Comments

This is a sequence made by a variant of the Josephus Problem mod 2, but we use the last number to eliminate instead the last number that remains.
We put n numbers in a circle, and in this variant two numbers are to be eliminated at the same time.
These two processes of elimination go in different directions. Suppose that there are n numbers. Then the first process of elimination starts with the first number and the 2nd, 4th, 6th numbers, ... are to be eliminated.
The second process starts with the n-th number, and the (n-1)-st, (n-3)-rd, (n-5)-th number, ... are to be eliminated.
We suppose that the first process comes first and the second process second at every stage.
We denote by JI2(n) the position of the last number to be eliminated when we have n numbers.
If we use this sequence JI2(n) for n = 6,7,8,... under mod 2, then we get the above sequence with 1 and 0.
Note that we have to omit the first 5 terms to get this sequence with its beautiful pattern.

Examples

			Suppose that there are n = 14 numbers. Then the 2nd, 4th, and 6th numbers will be eliminated by the first process. Similarly 13th, 11th, and 9th numbers will be eliminated by the second process. Now two directions are going to overlap. The first process will eliminate the 8 and 12 and the second process will eliminate 5 and 1. After this the first process will eliminate 3 and 14, and the second process will eliminate 10. The number that remains is 7, and hence the last number to be eliminated is 14. Therefore JI2(14) = 14. JI2(14) = 0 (mod 2).
		

Crossrefs

Programs

  • Mathematica
    last2 = {1, 2, 1, 1, 1, 3, 5, 6, 5, 5}; Table[JI2[n] = last2[[n]], {n, 1, 10}]; JI2[m_] := JI2[m] = Block[{n, h}, h = Mod[m, 8]; n = (m - h)/8; Which[h == 0, 4 JI2[2 n] - 1 - Floor[JI2[2 n]/(n + 1)], h == 1, 8 n + 5 - 4 JI2[2 n], h == 2, 4 JI2[2 n] -3 -Floor[JI2[2 n]/(n + 2)], h == 3, 8 n + 7 - 4 JI2[2 n], h == 4, 8 n + 8 - 4 JI2[2 n + 1] + Floor[JI2[2 n + 1]/(n + 2)], h == 5, 4 JI2[2 n + 1] - 1, h == 6, 8 n + 10 - 4 JI2[2 n + 1] + Floor[JI2[2 n + 1]/(n + 2)], h == 7, 4 JI2[2 n + 1] - 3]]; Table[Mod[JI2[n], 2], {n, 6, 95}]

Formula

{JI2(n): n = 1,2,3,4,5,6,7,8} = {1, 2, 1, 1, 1, 3, 5}.
(1) JI2(8*n) = 4*JI2(2*n) - 1 - [JI2(2*n)/(n+1) ].
(2) JI2(8*n+1) = 8*n + 5 - 4*JI2(2*n).
(3) JI2(8*n+2) = 4*JI2(2*n) - 3 - [JI2(2*n)/(n + 2)] .
(4) JI2(8*n+3) = 8*n + 7 - 4*JI2(2*n).
(5) JI2(8*n+4) = 8*n + 8 - 4*JI2(2*n+1) + [JI2(2*n+1)/(n+2)].
(6) JI2(8*n+5) = 4*JI2(2*n+1) - 1.
(7) JI2(8*n+6) = 8*n + 10 - 4*JI2(2*n+1) + [JI2(2*n+1)/(n+2)].
(8) JI2(8*n+7) = 4*JI2(2*n+1) - 3,
Note that recurrence relations are the same as those of A165556, but initial values are different.

A166383 Let dsf(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the digits of an integer n. dsf(1583236420) =1682731 and dsf(1682731) = 18470991,...,dsf(388290999) = 1583236420,.. in this way this 97 numbers make a loop for the function dsf. In fact this is the longest loop for dsf function in the set of all nonnegative integers.

Original entry on oeis.org

1583236420, 16827317, 18470991, 792441996, 1163132183, 16823961, 404291050, 387424134, 17601586, 17697199, 1163955211, 387473430, 18424896, 421022094, 387421016, 17647705, 2520668, 16873662, 17740759, 389894501, 808398820
Offset: 1

Author

Ryohei Miyadera, Oct 13 2009

Keywords

Comments

In fact there are only 8 loops in the whole nonnegative integers for the dsf-function that we defined. We have discovered this fact with the calculation by Mathematica and other general purpose languages. We have presented 6 loops to this On-Line Encyclopedia of Integer Sequences, and other two loops are in fact fixed points {1} and {3435}. It is easy to see that dsf(1) = 1 and dsf(3435) = 3^3+4^4+3^3+5^5=3435.

Examples

			This is an iterative process that starts with 1583236420.
		

Crossrefs

Programs

  • Mathematica
    dsf[n_] := Block[{m = n, t}, t = IntegerDigits[m]; Sum[Max[1, t[[k]]]^t[[k]], {k, Length[t]}]]; NestList[dsf,1583236420,194]

Formula

Let dsf(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the digits of an integer n. By applying the function dsf to 1583236420 repeatedly we can get a loop of the length of 97.

A165942 For a nonnegative integer n, define dsf(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} lists digits of n. Then starting with a(1) = 3418, a(n+1) = dsf(a(n)).

Original entry on oeis.org

3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413, 3418, 16777500, 2520413
Offset: 1

Author

Ryohei Miyadera, Daisuke Minematsu and Taishi Inoue, Oct 01 2009

Keywords

Comments

Period 3. In fact there are only 8 such loops among all the nonnegative integers for the "dsf" function that we defined.

Examples

			a(2) = dsf(a(1)) = dsf(3418) = 3^3+4^4+1^1+8^8 = 16777500; a(3) = dsf(16777500) = 1^1+6^6+7^7+7^7+7^7+5^5+0^0+0^0 = 2520413; a(4) = dsf(2520413) = 2^2+5^5+2^2+0^0+4^4+1^1+3^3 = 3418.
This is an iterative process that starts with 3418.
		

Crossrefs

dsf is A045503.

Programs

  • Mathematica
    dsf[n_] := Block[{m = n, t}, t = IntegerDigits[m]; Sum[Max[1, t[[k]]]^t[[k]], {k, Length[t]}]]; NestList[dsf, 3418, 6]
    LinearRecurrence[{0, 0, 1},{3418, 16777500, 2520413},30] (* Ray Chandler, Aug 25 2015 *)

Extensions

Cross-reference from Charles R Greathouse IV, Nov 01 2009
Edited by Charles R Greathouse IV, Mar 18 2010
Extended by Ray Chandler, Aug 25 2015

A166072 Define dsf(n) = A045503(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the decimal digits of n. dsf(809265896) = 808491852 and dsf(808491852) = 437755524,...,dsf(792488396) = 809265896, so these 8 numbers make a loop for the function dsf.

Original entry on oeis.org

809265896, 808491852, 437755524, 1657004, 873583, 34381154, 16780909, 792488396, 809265896, 808491852, 437755524, 1657004, 873583, 34381154, 16780909, 792488396, 809265896, 808491852, 437755524, 1657004, 873583
Offset: 1

Author

Ryohei Miyadera, Satoshi Hashiba and Koichiro Nishimura, Oct 06 2009

Keywords

Comments

In fact there are only 8 loops among all the nonnegative integers for the "dsf" function that we defined. We have discovered this fact through calculations using Mathematica and general-purpose languages.
Periodic with period 8.

Crossrefs

Programs

  • Mathematica
    dsf[n_] := Block[{m = n, t}, t = IntegerDigits[m]; Sum[Max[1, t[[k]]]^t[[k]], {k, Length[t]}]]; NestList[dsf, 809265896,16]
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 1},{809265896, 808491852, 437755524, 1657004, 873583, 34381154, 16780909, 792488396},24] (* Ray Chandler, Aug 25 2015 *)

Formula

a(n+1) = dsf(a(n)).

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010
Extended by Ray Chandler, Aug 25 2015

A166121 Let dsf(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the digits of an integer n. dsf(791621579) = 776537851 and dsf(776537851) = 19300779, ..., dsf(824599) = 791621579, ... in this way these 11 numbers make a loop for the function dsf.

Original entry on oeis.org

791621579, 776537851, 19300779, 776488094, 422669176, 388384265, 50381743, 17604196, 388337603, 34424740, 824599, 791621579, 776537851, 19300779, 776488094, 422669176, 388384265, 50381743, 17604196, 388337603, 34424740
Offset: 1

Author

Ryohei Miyadera, Takuma Nakaoka and Koichiro Nishimura, Oct 07 2009

Keywords

Comments

In fact there are only 8 loops among all the nonnegative integers for the "dsf" function that we defined. We have discovered this fact through calculations using Mathematica and general-purpose languages.

Examples

			This is an reiterative process that starts with 791621579.
		

Crossrefs

Programs

  • Mathematica
    dsf[n_] := Block[{m = n, t}, t = IntegerDigits[m]; Sum[Max[1, t[[k]]]^t[[k]], {k, Length[t]}]]; NestList[dsf,791621579,22]

Formula

Let dsf(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the digits of an integer n. By applying the function dsf to 791621579 we can get a loop of length 11.

A166227 Let dsf(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the digits of an integer n. dsf(793312220) = 388244100 and dsf(388244100) = 33554978, ..., dsf(387467199) = 793312220, ... in this way these 40 numbers make a loop for the function dsf.

Original entry on oeis.org

793312220, 388244100, 33554978, 405027808, 34381363, 16824237, 17647707, 3341086, 16824184, 33601606, 140025, 3388, 33554486, 16830688, 50424989, 791621836, 405114593, 387427281, 35201810, 16780376, 18517643, 17650825, 17653671, 1743552, 830081, 33554462, 53476, 873607, 18470986, 421845378, 34381644, 16824695, 404294403, 387421546, 17651084, 17650799, 776537847, 20121452, 3396, 387467199, 793312220
Offset: 1

Author

Ryohei Miyadera, Takuma Nakaoka and Koichiro Nishimura, Oct 09 2009

Keywords

Comments

In fact there are only 8 loops among all the nonnegative integers for the "dsf" function that we defined. We have discovered this fact through calculations using Mathematica and general-purpose languages.

Examples

			This is an reiterative process that starts with 7793312220.
		

Crossrefs

Programs

  • Mathematica
    dsf[n_] := Block[{m = n, t}, t = IntegerDigits[m]; Sum[Max[1, t[[k]]]^t[[k]], {k, Length[t]}]]; NestList[dsf,7793312220,80]
  • PARI
    dsf(n) = my(d = digits(n)); sum(i=1, #d, d[i]^d[i]); \\ Michel Marcus, Apr 21 2014

Formula

Let dsf(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the digits of an integer n. By applying the function dsf to 793312220 we can get a loop of length 40.

Extensions

More terms from Michel Marcus, Apr 21 2014

A166024 Define dsf(n) = A045503(n) = n_1^{n_1}+n_2^{n_2}+n_3^{n_3} + n_m^{n_m}, where {n_1,n_2,n_3,...n_m} is the list of the decimal digits of n. Starting with a(1) = 421845123, a(n+1) = dsf(a(n)).

Original entry on oeis.org

421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890, 421845123, 16780890
Offset: 1

Author

Ryohei Miyadera, Satoshi Hashiba and Koichiro Nishimura, Oct 04 2009

Keywords

Comments

In fact there are only 8 loops among all the nonnegative integers for the "dsf" function that we defined.
Periodic with period 2.

Examples

			dsf(421845123) = 16780890 and dsf(16780890) = 421845123, so these 2 numbers make a loop for the function dsf.
		

Crossrefs

Programs

  • Mathematica
    dsf[n_] := Block[{m = n, t}, t = IntegerDigits[m]; Sum[Max[1, t[[k]]]^t[[k]], {k, Length[t]}]]; NestList[dsf, 421845123,4]
    LinearRecurrence[{0, 1},{421845123, 16780890},24] (* Ray Chandler, Aug 25 2015 *)

Formula

a(n+1) = dsf(a(n)).

Extensions

Comment and editing by Charles R Greathouse IV, Aug 02 2010
Second sentence of Name moved to Example by Michael De Vlieger, Aug 24 2023

A165735 Surviving integers under the double-count Josephus problem (see A054995), modulo 3.

Original entry on oeis.org

1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Author

Ryohei Miyadera and Masakazu Naito, Sep 25 2009

Keywords

Comments

Old name was: The pattern is obvious. The sequence can be divided into subsequences of {1,1,1,...} and {2,2,2,...}.
Let n be a natural number. We put n numbers in a circle, and we are going to remove every third number. Let J3(n) be the last number that remains. This is the traditional Josephus Problem. Let J3 (mod 3) be the residue of the sequence J3(n) under mod 3. J3 (mod 3) produces the sequence {1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,...}.

Examples

			If we use n = 10, then we put numbers 1,2,3,4,5,6,7,8,9,10 in a circle. We eliminate 3,6,9,2,7,1,8,5,10, and the last number that remains is 4. Therefore J3(10) = 4 and J3(10) = 1 mod 3.
		

Crossrefs

Programs

  • Mathematica
    J3[1] = 1; J3[2] = 2; J3[n_] := J3[n] = Block[{m, t}, t = Mod[n, 3]; m = (n - t)/3; Which[t == 0, J3[2 m] + Floor[(J3[2 m] - 1)/2], t == 1, If[J3[2 m + 1] == 1, 3 m + 1, J3[2 m + 1] + Floor[J3[2 m + 1]/2] - 2], t == 2, J3[2 m + 1] + Floor[J3[2 m + 1]/2] + 1]]; Table[Mod[J3[n], 3], {n, 1, 200}]

Formula

(1) J3(1) = 1 and J3(2) = 2.
(2) J3(3m) = J3(2m) + [(J3(2m)-1)/2].
(3a) J3(3m+1) = 3m + 1 (if J3(2m + 1) = 1).
(3b) J3(3m+1) = J3(2m+1) + [J3(2m+1)/2] - 2 (if J3(2m + 1) > 1).
(4) J3(3m+2) = J3(2m+1) + [J3(2m+1)/2] + 1
a(n) = A010872(A054995(n)). - Gordon Atkinson, Aug 21 2019

Extensions

New name from Gordon Atkinson, Aug 21 2019

A165556 A symmetric version of the Josephus problem read modulo 2.

Original entry on oeis.org

1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Offset: 1

Author

Ryohei Miyadera and Masakazu Naito, Sep 22 2009

Keywords

Comments

We put n numbers in a circle, and in this variant two numbers are to be eliminated at the same time.
These two processes of elimination go in different directions. Suppose that there are n numbers.
Then the first process of elimination starts with the first number and the 2nd, 4th, 6th numbers, ... are to be eliminated.
The second process starts with the n-th number, and the (n-1)st, (n-3)rd, (n-5)th numbers, ... are to be eliminated.
We suppose that the first process comes first and the second process second at every stage.
We denote the position of the last survivor by JI(n). If we use this sequence under mod 2, then we get the above sequence with 1 and 0.
Old name was "{1,1}, {1, 0, 1, 0}, {1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}, ... In this way the two patterns {1,1} and {0,1} take turns in subsequences with the length of 2, 4, 8, 16, 64,...".

Examples

			Suppose that there are n = 14 numbers.
Then the 2nd, 4th, and 6th numbers will be eliminated by the first process. Similarly the 13th, 11th, and 9th numbers will be eliminated by the second process.
Now two directions are going to overlap. The first process will eliminate the 8, 12 and the second process will eliminate 5, 1.
After this the first process will eliminate 3, 14, and the second process will eliminate 10. The number that remains is 7. Therefore JI(14) = 7 and JI(14) = 1 (mod 2).
		

Crossrefs

Programs

  • Mathematica
    initialvalue = {1, 1, 3, 4, 3, 6, 1, 3}; Table[JI[n] = initialvalue[[n]], {n, 1, 8}]; JI[m_] := JI[m] = Block[{n, h}, h = Mod[m, 8]; n = (m - h)/8; Which[h == 0, 4 JI[2 n] - 1 - Floor[JI[2 n]/(n + 1)], h == 1, 8 n + 5 - 4 JI[2 n], h == 2, 4 JI[2 n] -3 -Floor[JI[2 n]/(n + 2)], h == 3, 8 n + 7 - 4 JI[2 n], h == 4, 8 n + 8 - 4 JI[2 n + 1] + Floor[JI[2 n + 1]/(n + 2)], h == 5, 4 JI[2 n + 1] - 1, h == 6, 8 n + 10 - 4 JI[2 n + 1] + Floor[JI[2 n + 1]/(n + 2)], h == 7, 4 JI[2 n + 1] - 3]]; Table[Mod[JI[n], 2], {n, 1, 62}]
    Flatten[Table[{PadRight[{},2^n,{1}],PadRight[{},2^(n+1),{1,0}]},{n,1,5,2}],1] (* Harvey P. Dale, Mar 24 2013 *)

Formula

a(n) = JI(n) mod 2, and:
JI(8*n) = 4*JI(2*n) - 1 - [JI(2*n)/(n+1)].
JI(8*n+1) = 8*n + 5 - 4*JI(2*n).
JI(8*n+2) = 4*JI(2*n) - 3 - [JI(2*n)/(n+2)].
JI(8*n+3) = 8*n + 7 - 4*JI(2*n).
JI(8*n+4) = 8*n + 8 - 4*JI(2*n+1) + [JI(2*n+1)/(n+2)].
JI(8*n+5) = 4*JI(2*n+1) - 1.
JI(8*n+6) = 8*n + 10 - 4*JI(2*n+1) + [JI(2*n+1)/(n+2)].
JI(8*n+7) = 4*JI(2*n+1) - 3.
where [ ] is the floor function.
Conjecture: a(n) = (1 - (-1)^(n + (n + 1)*floor(log_2(n + 1))))/2. - Velin Yanev, Nov 23 2016
a(n) = A325594(n) mod 2. - Gordon Atkinson, Oct 06 2019

Extensions

New name from Gordon Atkinson, Sep 06 2019 and Oct 04 2019