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.

A249275 a(n) is the smallest b > 1 such that p = prime(n) satisfies b^(p-1) == 1 (mod p^3).

This page as a plain text file.
%I A249275 #43 May 18 2022 07:59:06
%S A249275 9,26,57,18,124,239,158,333,42,1215,513,691,1172,3038,295,1468,2511,
%T A249275 15458,3859,6372,923,1523,5436,1148,412,4943,4432,5573,476,68,21304,
%U A249275 30422,6021,8881,33731,25667,3868,3170,17987,26626,43588,7296,14628,22076,138057
%N A249275 a(n) is the smallest b > 1 such that p = prime(n) satisfies b^(p-1) == 1 (mod p^3).
%C A249275 a(n) >= A039678(n) for all n.
%H A249275 Vincenzo Librandi, <a href="/A249275/b249275.txt">Table of n, a(n) for n = 1..100</a>
%t A249275 Array[Block[{b = 2}, While[PowerMod[b, # - 1, #^3] != 1, b++]; b] &@ Prime@ # &, 45] (* _Michael De Vlieger_, Nov 25 2018 *)
%t A249275 dpa[n_]:=Module[{p=Prime[n], a=9}, While[PowerMod[a, p - 1, p^3]!=1, a++]; a]; Array[dpa, 50] (* _Vincenzo Librandi_, Nov 30 2018 *)
%o A249275 (PARI) a(n) = my(p=prime(n)); for(b=2, oo, if(Mod(b, p^3)^(p-1)==1, return(b)))
%o A249275 (Python)
%o A249275 from sympy import prime
%o A249275 def a(n):
%o A249275     b, p = 2, prime(n)
%o A249275     p3 = p**3
%o A249275     while pow(b, p-1, p3) != 1: b += 1
%o A249275     return b
%o A249275 print([a(n) for n in range(1, 46)]) # _Michael S. Branicky_, Sep 26 2021
%o A249275 (Python)
%o A249275 from sympy import prime
%o A249275 from sympy.ntheory.residue_ntheory import nthroot_mod
%o A249275 def A249275(n): return 2**3+1 if n == 1 else int(nthroot_mod(1,(p:= prime(n))-1,p**3,True)[1]) # _Chai Wah Wu_, May 17 2022
%Y A249275 Cf. A039678, A242742.
%K A249275 nonn
%O A249275 1,1
%A A249275 _Felix Fröhlich_, Oct 24 2014
%E A249275 Edited by _Felix Fröhlich_, Nov 24 2018