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.

A203077 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.

Original entry on oeis.org

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, 23, 26, 29, 28, 31, 32, 35, 38, 33, 34, 37, 36, 39, 42, 41, 40, 45, 44, 43, 46, 47, 50, 49, 48, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 62, 61, 66, 67, 64, 65
Offset: 1

Views

Author

Zak Seidov, Dec 29 2011

Keywords

Comments

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.

Examples

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

Crossrefs

Cf. A203069.

Programs

  • Mathematica
    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 *)