|
| |
|
|
A100208
|
|
Minimal permutation of the natural numbers such that the sum of squares of two consecutive terms is a prime.
|
|
7
| |
|
|
1, 2, 3, 8, 5, 4, 9, 10, 7, 12, 13, 20, 11, 6, 19, 14, 15, 22, 17, 18, 23, 30, 29, 16, 25, 24, 35, 26, 21, 34, 39, 40, 33, 28, 37, 32, 27, 50, 31, 44, 41, 46, 49, 36, 65, 38, 45, 52, 57, 68, 43, 42, 55, 58, 47, 48, 53, 62, 73, 60, 61, 54, 59, 64, 71, 66, 79, 56, 51, 76, 85, 72
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,2
|
|
|
COMMENTS
| a(1) = 1 and for n>1: a(n) = smallest m not occurring earlier such that m^2 + a(n-1)^2 is a prime; the primes are in A100209.
Note the same parity of a(n) and n for all terms. [Zak Seidov Apr 27 2011]
Sub-sequence s(1..m) is a permutation of the natural numbers 1..m only for m=1,2,3. [Zak Seidov Apr 28 2011]
All filtering primes (A100209) are distinct because primes of the form 4k+1 have a unique representation as the sum of two squares. [Zak Seidov Apr 28 2011]
|
|
|
LINKS
| Zak Seidov, Table of n, a(n) for n = 1..20000
Index entries for sequences that are permutations of the natural numbers
|
|
|
FORMULA
| a(A100211(n)) = A100211(a(n)) = n.
a(n) = sqrt(A073658(n)).
a(n)^2 + a(n+1)^2 = A100209(n).
|
|
|
MATHEMATICA
| nn = 100; unused = Range[2, nn]; t = {1}; While[k = 0; While[k++; k <= Length[unused] && ! PrimeQ[t[[-1]]^2 + unused[[k]]^2]]; k <= Length[unused], AppendTo[t, unused[[k]]]; unused = Delete[unused, k]]; t (* T. D. Noe, Apr 27 2011 *)
|
|
|
PROG
| (Haskell)
import Data.Set (singleton, notMember, insert)
a100208 n = a100208_list !! (n-1)
a100208_list = 1 : (f 1 [1..] $ singleton 1) where
f x (w:ws) s
| w `notMember` s &&
a010051 (x*x + w*w) == 1 = w : (f w [1..] $ insert w s)
| otherwise = f x ws s where
-- Reinhard Zumkeller, Apr 28 2011
|
|
|
CROSSREFS
| Cf. A100209, A100211, A171964, A181723, A181730 [Zak Seidov Apr 27 2011].
Cf. A080478, A010051.
Sequence in context: A202651 A084110 A192646 * A093928 A135874 A138682
Adjacent sequences: A100205 A100206 A100207 * A100209 A100210 A100211
|
|
|
KEYWORD
| nonn
|
|
|
AUTHOR
| Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Nov 08 2004
|
| |
|
|