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.
%I A091569 #15 Sep 23 2023 03:16:05 %S A091569 1,3,5,7,9,11,13,15,8,6,4,2,12,10,36,34,32,30,28,26,24,22,20,18,16,14, %T A091569 52,50,48,35,33,31,29,27,25,23,21,19,17,64,62,60,40,38,148,146,144,37, %U A091569 39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83 %N A091569 a(1) = 1; for n > 1, a(n) is the smallest positive integer not already used such that a(n)*a(n-1) + 1 is a perfect square. %C A091569 Does this sequence contain every positive integer? We could get an equally interesting sequence by choosing a(1) to be any other positive integer. %C A091569 A sequence with the same condition but without the requirement for a(n) to be distinct would end up repeating (1,3) or (2,4), depending on the initial term. - _Ivan Neretin_, May 26 2015 %H A091569 Ivan Neretin, <a href="/A091569/b091569.txt">Table of n, a(n) for n = 1..10000</a> %e A091569 10 is followed by 36 because 10*36+1 = 19^2 and 8 and 12 were already used. %p A091569 N:= 10^4: Used:= Vector(N,datatype=integer[4]): %p A091569 a[1]:= 1: blocked:= false: Used[1]:= 1: %p A091569 for n from 2 to 100 while not(blocked) do %p A091569 ndone:= false; %p A091569 if n = 2 then T:= [0] %p A091569 else T:= select(t -> t^2 mod a[n-1] = 1, [$0..a[n-1]-1]) %p A091569 fi; %p A091569 for s from 0 while not (ndone) do %p A091569 for t in T while not (ndone) do %p A091569 x:= s * a[n-1] + t; %p A091569 if x <= 1 then next fi; %p A091569 y:= (x^2-1)/a[n-1]; %p A091569 if y > N then blocked:= true; ndone:= true %p A091569 elif Used[y] = 0 then %p A091569 a[n]:= y; %p A091569 Used[y]:= 1; %p A091569 ndone:= true; %p A091569 print(n,y); %p A091569 fi %p A091569 od %p A091569 od %p A091569 od: %p A091569 seq(a[n],n=1..100); # _Robert Israel_, May 26 2015 %t A091569 a = {1}; Do[a = Join[a, Select[Complement[Range[(Max[a] + 1)*n], a], IntegerQ[Sqrt[#*a[[-1]] + 1]] &, 1]], {n, 2, 71}]; a (* _Ivan Neretin_, May 26 2015 *) %o A091569 (MATLAB) A = zeros(1, 100); A(1) = 1; used = zeros(1, 1000); used(1) = 1; for i = 2:100; found = 0; k = 0; while found == 0; k = k + 1; if used(k) == 0; s = sqrt(k*A(i - 1) + 1); if s == floor(s); A(i) = k; used(k) = 1; found = 1; end; end; end; end; A %Y A091569 Cf. A083203. %K A091569 easy,nonn %O A091569 1,2 %A A091569 _David Wasserman_, Mar 04 2004