login
Alternating-parity rearrangement of natural numbers: a(n) is the smallest number such that a(n-1)^2 + a(n)^2 is odd and composite.
0

%I #15 Oct 30 2018 10:31:02

%S 1,8,9,2,11,10,5,12,3,4,7,6,13,14,17,16,15,18,19,22,21,20,25,30,27,24,

%T 23,26,29,28,31,32,35,38,33,34,37,36,39,42,41,40,45,44,43,46,47,50,49,

%U 48,51,52,53,54,55,56,57,58,59,60,63,62,61,66,67,64,65

%N Alternating-parity rearrangement of natural numbers: a(n) is the smallest number such that a(n-1)^2 + a(n)^2 is odd and composite.

%C The maximum between a(n) and the n-th integer appears to be +-6. In the first 10k terms, the distribution of differences, from -6 to 6 is: 27, 140, 1350, 7002, 1282, 168, 31. Therefore I conjecture that Lim_{n->infinity} a(n) = n.

%e 1^2 + 8^2 = 65 composite, 8^2 + 9^2 = 145 composite, 9^2 + 2^2 = 85 composite.

%t f[s_List] := Block[{k = If[ OddQ[ s[[-1]]], 2, 3], m = s[[-1]]}, While[a = k^2 + m^2; MemberQ[s, k] || PrimeQ[a] || EvenQ[a], k += 2]; Append[s, k]]; Nest[f, {1}, 70] (* _Robert G. Wilson v_, Jan 02 2012 *)

%Y Cf. A203069.

%K nonn

%O 1,2

%A _Zak Seidov_, Dec 29 2011