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.

A377669 a(n) is the least prime p such that (3^p - 3)/p == n (mod p), or -1 if there is no such prime p.

This page as a plain text file.
%I A377669 #10 Jun 07 2025 16:47:03
%S A377669 11,2,3,5,7,23,43,5721619,2311,105830189,31300663,13,113,17,821,1181,
%T A377669 19,37
%N A377669 a(n) is the least prime p such that (3^p - 3)/p == n (mod p), or -1 if there is no such prime p.
%C A377669 For n = 18, 24, 27, 28, 30, 38, ..., a(n) > 6 * 10^9 if it is not -1.
%C A377669 a(18) > 2*10^11 if it is not -1. - _Michael S. Branicky_, Nov 04 2024
%F A377669 a(n) = prime(i) where A179078(i) = n, if such i exists.
%e A377669 a(4) = 7 because (3^7 - 3)/7 = 312 == 4 (mod 7), and 7 is the first prime that works.
%p A377669 f:= p -> (3&^p-3 mod p^2)/p:
%p A377669 V:= Array(0..17): count:= 0:
%p A377669 p:= 1:
%p A377669 for i from 1 while count < 23 do
%p A377669   p:= nextprime(p);
%p A377669   v:= f(p);
%p A377669   if v <= 22 and V[v] = 0 then V[v]:= i; count:= count+1 fi;
%p A377669 od:
%p A377669 convert(V, list);
%t A377669 lpp[n_]:=Module[{p=2},While[Mod[(3^p-3)/p,p]!=n,p=NextPrime[p]];p]; Array[lpp,17,0] (* _Harvey P. Dale_, Jun 07 2025 *)
%Y A377669 Cf. A179078, A377655.
%K A377669 nonn,more
%O A377669 0,1
%A A377669 _Robert Israel_, Nov 03 2024