OFFSET
1,1
COMMENTS
LINKS
Robert Israel and Emmanuel Vantieghem, Table of n, a(n) for n = 1..81[Terms 1 through 70 were computed by R. Israel: terms 71 through 82 by E. Vantieghem. Nov 23 2015]
R. Israel in reply to Don Reble, A081650, SeqFan list, Nov. 17, 2015
MATHEMATICA
(* to get the sequence up to B *)
VQR=Table[Union[Mod[Range[(n^2)/2]^2, n^2]], {n, 2, 17}];
Print[2]; k=1; m=2; While[k<B, k++; m--; flag=0; While[flag==0, Label[m$]; m++; If[!IntegerQ[Sqrt[m]], j=1; While[j<k, j++; If[! MemberQ[VQR[[j-1]], Mod[m, j^2]], Goto[m$]]]; If[j==k, Print[m]; flag=1]]]](* Emmanuel Vantieghem, Nov 23 2013 *)
PROG
(PARI) t=2; for(n=1, 90, for(m=t, 9e9, issquare(m)&&next; for(k=1, n, issquare(Mod(m, k^2))||next(2)); print1(t=m, ", "); break))
(MATLAB)
N = 2*10^8; % to get all terms <= N
B = ones(1, N);
B([1:floor(sqrt(N))].^2) = 0;
m = 1;
while true
nsq = ones(m^2, 1);
sqs = unique(mod([1:m^2/2].^2, m^2));
sqs = [sqs(sqs > 0), m^2];
nsq(sqs) = 0;
S = nsq * ones(1, ceil(N/m^2));
S = reshape(S, 1, numel(S));
B(S(1:N)>0) = 0;
v = find(B, 1, 'first');
if numel(v) == 0
break
end
A(m) = v;
m = m + 1;
end
A % Robert Israel, Nov 17 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Nov 17 2015
STATUS
approved