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.

A257231 a(n) = n^2 mod p where p is the least prime greater than n.

This page as a plain text file.
%I A257231 #25 Sep 08 2022 08:46:12
%S A257231 1,1,4,1,4,1,5,9,4,1,4,1,16,9,4,1,4,1,16,9,4,1,7,25,16,9,4,1,4,1,36,
%T A257231 25,16,9,4,1,16,9,4,1,4,1,16,9,4,1,36,25,16,9,4,1,36,25,16,9,4,1,4,1,
%U A257231 36,25,16,9,4,1,16,9,4,1,4,1,36,25,16,9,4,1,16,9,4,1,36,25,16,9,4
%N A257231 a(n) = n^2 mod p where p is the least prime greater than n.
%C A257231 Conjecture: a(n) is always a positive square, except for the terms 5, 7, 69, 42 and 17 given by n = 7, 23, 113, 114, and 115 respectively. It is easy to show that nonsquare terms are in [p, q) iff p and q are consecutive primes and q-p > sqrt(q). There are no gaps between consecutive primes greater than sqrt(q) for 127 < q < 4*10^18 (see Nicely's table of maximal prime gaps).
%H A257231 Chris Boyd, <a href="/A257231/b257231.txt">Table of n, a(n) for n = 1..10000</a>
%H A257231 Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/gaps/gaplist.html">First occurrence prime gaps</a> [For local copy see A000101]
%H A257231 Tomás Oliveira e Silva, <a href="http://sweet.ua.pt/tos/gaps.html">Gaps between consecutive primes</a>
%e A257231 a(23) = 7 because 23^2 mod 29 = 7.
%e A257231 a(24) = 25 because 24^2 mod 29 = 25.
%t A257231 Table[Mod[n^2, NextPrime@ n], {n, 87}] (* _Michael De Vlieger_, Apr 19 2015 *)
%t A257231 Table[PowerMod[n,2,NextPrime[n]],{n,90}] (* _Harvey P. Dale_, May 24 2015 *)
%o A257231 (PARI) a(n)=n^2%nextprime(n+1)
%o A257231 (Magma) [n^2 mod NextPrime(n): n in [1..80]]; // _Vincenzo Librandi_, Apr 19 2015
%Y A257231 Cf. A257230.
%K A257231 nonn,easy
%O A257231 1,3
%A A257231 _Chris Boyd_, Apr 19 2015