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.

A076948 Smallest k such that nk-1 is a square, or 0 if no such number exists.

This page as a plain text file.
%I A076948 #23 Apr 28 2020 03:12:20
%S A076948 1,1,0,0,1,0,0,0,0,1,0,0,2,0,0,0,1,0,0,0,0,0,0,0,2,1,0,0,5,0,0,0,0,5,
%T A076948 0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,10,0,0,0,0,5,0,0,2,0,0,0,1,0,0,0,
%U A076948 0,0,0,0,10,13,0,0,0,0,0,0,0,1,0,0,2,0,0,0,13,0,0,0,0,0,0,0,5,0,0,0,1,0
%N A076948 Smallest k such that nk-1 is a square, or 0 if no such number exists.
%H A076948 Reinhard Zumkeller, <a href="/A076948/b076948.txt">Table of n, a(n) for n = 1..10000</a>
%F A076948 a(n) != 0 if and only if n is a term of A008784. - _Joerg Arndt_, Apr 27 2020
%F A076948 a(n) = 1 if and only if n is a term of A002522. - _Bernard Schott_, Apr 27 2020
%t A076948 a[n_] := Module[{r, j, k}, r = Solve[j>0 && k>0 && n k - 1 == j^2, {j, k}, Integers]; If[r === {}, Return[0], Return[k /. (r /. C[1] -> 0) // Min]]]; a[1] = 1;
%t A076948 Array[a, 100] (* _Jean-François Alcover_, Apr 27 2020 *)
%o A076948 (Haskell)
%o A076948 a076948 1 = 1
%o A076948 a076948 n = if null qs then 0 else head qs
%o A076948             where qs = filter ((> 0) . a037213 . subtract 1 . (* n)) [1..n]
%o A076948 -- _Reinhard Zumkeller_, Oct 25 2015
%o A076948 (PARI) a(n) = if (!issquare(Mod(-1, n)), 0, my(k=1); while (!issquare(n*k-1), k++); k); \\ _Michel Marcus_, Apr 27 2020
%Y A076948 Cf. A008784.
%Y A076948 Cf. A037213.
%K A076948 nonn
%O A076948 1,13
%A A076948 _Amarnath Murthy_, Oct 20 2002
%E A076948 Edited and extended by _Robert G. Wilson v_, Oct 21 2002