login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A258742 With a(1) = 1, a(n) is the smallest positive number not already in the sequence such that a(n)^2 + a(n-1)^2 is not prime. 1

%I #10 Jun 11 2015 09:37:50

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

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

%U 50,52,51,53,54,55,56,57,58,59,60,62,61,63,64,65,67,66,68,69,71,72,70,73,74,75,76,77,78,79,81

%N With a(1) = 1, a(n) is the smallest positive number not already in the sequence such that a(n)^2 + a(n-1)^2 is not prime.

%C Believed to be a permutation of the natural numbers.

%t f[n_] := Block[{a = {1}, k}, For[k = 2, k <= n, k++, i = 1; While[Or[PrimeQ[i^2 + a[[k - 1]]^2], MemberQ[a, i]], i++]; AppendTo[a, i]]; a]; f@ 120 (* _Michael De Vlieger_, Jun 10 2015 *)

%o (PARI) v=[1]; n=1; while(n<100, if(!isprime(n^2+v[#v]^2)&&!vecsearch(vecsort(v), n), v=concat(v, n); n=0); n++); v

%Y Cf. A055266, A100208.

%K nonn

%O 1,2

%A _Derek Orr_, Jun 08 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 18:17 EDT 2024. Contains 371962 sequences. (Running on oeis4.)