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.

A035091 Smallest prime == 1 mod (n^2).

This page as a plain text file.
%I A035091 #29 Mar 16 2025 13:12:17
%S A035091 2,5,19,17,101,37,197,193,163,101,727,433,677,197,1801,257,3469,1297,
%T A035091 10831,401,883,1453,12697,577,11251,677,1459,3137,10093,1801,15377,
%U A035091 12289,2179,3469,7351,1297,5477,18773,9127,1601,16811,3529,22189,11617
%N A035091 Smallest prime == 1 mod (n^2).
%C A035091 Smallest prime of form (n^2)*k+1, i.e., an arithmetic progression with n^2 differences; k is the subscript of the progressions.
%H A035091 Amiram Eldar, <a href="/A035091/b035091.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..500 from Robert Price)
%H A035091 <a href="/index/Pri#primes_AP">Index entries for sequences related to primes in arithmetic progressions</a>.
%e A035091 a(5) = 101 because in 5^2k + 1 = 25k + 1 progression k=4 generates the smallest prime (this is 101) and 26, 51, and 76 are composite.
%t A035091 With[{prs=Prime[Range[2500]]},Flatten[Table[Select[prs,Mod[#-1,n^2]==0&,1],{n,50}]]] (* _Harvey P. Dale_, Sep 22 2021 *)
%o A035091 (PARI) a(n) = if(n == 1, 2, my(s = n^2); forprime(p = 1, , if(p % s == 1, return(p)))); \\ _Amiram Eldar_, Mar 16 2025
%Y A035091 Analogous case is A034694. Special case is A002496.
%Y A035091 Cf. A070844 to A070858, A061092, A035095.
%K A035091 nonn
%O A035091 1,1
%A A035091 _Labos Elemer_