login
a(n) + a(n - 1) is alternatively a square or a cube, a(1) = 1.
1

%I #9 Dec 14 2023 05:20:01

%S 1,3,5,4,4,5,3,1,7,2,6,3,5,4,4,5,3,1,7,2,6,3,5,4,4,5,3,1,7,2,6,3,5,4,

%T 4,5,3,1,7,2,6,3,5,4,4,5,3,1,7,2,6,3,5,4,4,5,3,1,7,2,6,3,5,4,4,5,3,1,

%U 7,2,6,3,5,4,4,5,3,1,7,2,6,3,5,4,4,5,3,1,7,2,6,3,5,4,4,5,3,1,7,2,6,3,5,4,4

%N a(n) + a(n - 1) is alternatively a square or a cube, a(1) = 1.

%C a(1) = 1; a(2n) is a minimal positive m such that a(2n - 1) + m is a square, a(2n + 1) is a minimal positive m such that a(2n) + m is a cube. Sequence is periodic (apparently with the same period for any a(1)).

%e a(1)=1, a(2)=3 because 1+3 is a square, a(3)=5 because 3+5 is a cube, a(4)=4 because 5+4 is a square, etc.

%t b=1; s={b}; Do[Do[bi=b+i; If[IntegerQ[Sqrt[bi]],b=i; AppendTo[s,b]; Break[]],{i,1000}]; c=b; Do[ci=c+i; If[IntegerQ[ci^(1/3)],c=i; Break[]],{i,1000}]; AppendTo[s,c]; b=c,{100}]; s

%K nonn

%O 1,2

%A _Zak Seidov_, Aug 08 2007