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 A034796 #21 Jul 27 2015 05:46:44 %S A034796 1,2,7,9,10,13,17,19,25,26,34,37,41,43,49,50,62,67,73,74,82,87,89,94, %T A034796 97,99,105,106,109,113,121,122,127,129,130,133,137,139,145,146,157, %U A034796 162,167,173,178,181,185,187,193,194,206,214,217,218,223,237,241,243,249 %N A034796 a(1)=1, a(n-1) is a square mod a(n), and a(n) > a(n-1). %C A034796 a(n) is the smallest number larger than a(n-1) such that a(n-1) is a quadratic residue mod a(n). - _R. J. Mathar_, Jul 27 2015 %H A034796 T. D. Noe, <a href="/A034796/b034796.txt">Table of n, a(n) for n=1..1000</a> %e A034796 For n=3 we have a(2)=2. 2 is not quadratic residue mod 3 because the quadratic residues mod 3 are {0,1}, see A011655. 2 is not a quadratic residue mod 4 because the quadratic residues mod 4 are {0,1}, see A000035. 2 is not a quadratic residue mod 5 because the quadratic residues mod 5 are {0,1,4}, see A070430. 2 is not a quadratic residue mod 6 because the quadratic residues mod 6 are {0,1,3,4}, see A070431. 2 is a quadratic residue mod 7 because the quadratic residues mod 7 are {0,1,2,4}, see A053879. So a(3)=7. - _R. J. Mathar_, Jul 27 2015 %p A034796 A034796 := proc(n) %p A034796 option remember; %p A034796 if n = 1 then %p A034796 1; %p A034796 else %p A034796 for a from procname(n-1)+1 do %p A034796 if numtheory[quadres](procname(n-1),a) = 1 then %p A034796 return a; %p A034796 end if; %p A034796 end do: %p A034796 end if; %p A034796 end proc: # _R. J. Mathar_, Jul 27 2015 %t A034796 residueQ[n_, k_] := Length[ Select[ Range[ Floor[k/2]]^2, Mod[#, k] == n &, 1]] == 1; a[1] = 1; a[n_] := a[n] = For[k = a[n-1] + 1, True, k++, If[residueQ[a[n-1], k], Return[k]]]; Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Aug 13 2013 *) %K A034796 nonn,nice %O A034796 1,2 %A A034796 _David W. Wilson_ %E A034796 Clarified definition, _Joerg Arndt_, Aug 14 2013