cp's OEIS Frontend

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.

A260709 Smallest nonsquare congruent to a square (mod k^2) for all k = 1..n.

Original entry on oeis.org

2, 5, 13, 52, 241, 241, 436, 1009, 1009, 1009, 2641, 2641, 8089, 8089, 8089, 8089, 18001, 18001, 53881, 53881, 53881, 53881, 87481, 87481, 87481, 87481, 87481, 87481, 117049, 117049, 515761, 515761, 515761, 515761, 515761, 515761, 1083289, 1083289, 1083289, 1083289
Offset: 1

Views

Author

M. F. Hasler, Nov 17 2015

Keywords

Comments

A variant of A081650 which uses the remainder modulo k^2 instead of the congruence (mod k^2).
Suggested by Don Reble and R. Israel and the original title of A081650.

Crossrefs

Cf. A081650.

Programs

  • 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
  • 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[kEmmanuel Vantieghem, Nov 23 2013 *)
  • 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))