login
a(0)=2; for n>0, a(n) = smallest prime not occurring earlier in the sequence such that a(n-1)+a(n) is a multiple of floor(sqrt(n)). If no such prime exists, the sequence terminates.
3

%I #13 Jul 25 2015 14:03:52

%S 2,3,5,7,11,13,17,19,23,31,29,37,41,43,47,61,59,53,67,73,71,89,79,97,

%T 83,107,103,127,113,137,163,157,173,167,193,197,109,101,139,131,151,

%U 149,181,179,199,191,211,227,223,239,251,281,293,337,307,379,349,421,419,449,433,463,461,491,229,283,269,331,277,347,317,443,373,467,389,499,397,523

%N a(0)=2; for n>0, a(n) = smallest prime not occurring earlier in the sequence such that a(n-1)+a(n) is a multiple of floor(sqrt(n)). If no such prime exists, the sequence terminates.

%C Is this sequence infinite and, if so, is it a permutation of the primes? For this sequence the answers are probably both Yes. A134204 and A224223 are similar sequences whose status is also unknown, while A224221 and A224222 are similar sequences which terminate after about 20 terms.

%H N. J. A. Sloane, <a href="/A224229/b224229.txt">Table of n, a(n) for n = 0..9999</a>

%p # A224229

%p Digits:=100;

%p M1:=100000; hit:=Array(1..M1);

%p M2:=1000;

%p a:=[2]; hit[1]:=1;

%p p:=2;

%p for n from 1 to M2 do

%p t1:=floor(sqrt(n));

%p sw1:=-1;

%p for i from 2 to M1 do

%p q:=ithprime(i);

%p if ( (p+q) mod t1 ) = 0 and hit[i] <> 1 then sw1:=1; break; fi;

%p od:

%p if sw1 < 0 then lprint("ERROR", n, a); break; fi;

%p a:=[op(a),q];

%p hit[i]:=1;

%p p:=q;

%p od:

%p a;

%Y Cf. A134204, A224221, A224222, A224223.

%K nonn,look

%O 0,1

%A _N. J. A. Sloane_, Apr 10 2013