A034796 a(1)=1, a(n-1) is a square mod a(n), and a(n) > a(n-1).
1, 2, 7, 9, 10, 13, 17, 19, 25, 26, 34, 37, 41, 43, 49, 50, 62, 67, 73, 74, 82, 87, 89, 94, 97, 99, 105, 106, 109, 113, 121, 122, 127, 129, 130, 133, 137, 139, 145, 146, 157, 162, 167, 173, 178, 181, 185, 187, 193, 194, 206, 214, 217, 218, 223, 237, 241, 243, 249
Offset: 1
Examples
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
Links
- T. D. Noe, Table of n, a(n) for n=1..1000
Programs
-
Maple
A034796 := proc(n) option remember; if n = 1 then 1; else for a from procname(n-1)+1 do if numtheory[quadres](procname(n-1),a) = 1 then return a; end if; end do: end if; end proc: # R. J. Mathar, Jul 27 2015
-
Mathematica
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 *)
Extensions
Clarified definition, Joerg Arndt, Aug 14 2013
Comments