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).

Original entry on oeis.org

9, 26, 57, 18, 124, 239, 158, 333, 42, 1215, 513, 691, 1172, 3038, 295, 1468, 2511, 15458, 3859, 6372, 923, 1523, 5436, 1148, 412, 4943, 4432, 5573, 476, 68, 21304, 30422, 6021, 8881, 33731, 25667, 3868, 3170, 17987, 26626, 43588, 7296, 14628, 22076, 138057
Offset: 1

Views

Author

Felix Fröhlich, Oct 24 2014

Keywords

Comments

a(n) >= A039678(n) for all n.

Crossrefs

Programs

  • Mathematica
    Array[Block[{b = 2}, While[PowerMod[b, # - 1, #^3] != 1, b++]; b] &@ Prime@ # &, 45] (* Michael De Vlieger, Nov 25 2018 *)
    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 *)
  • PARI
    a(n) = my(p=prime(n)); for(b=2, oo, if(Mod(b, p^3)^(p-1)==1, return(b)))
    
  • Python
    from sympy import prime
    def a(n):
        b, p = 2, prime(n)
        p3 = p**3
        while pow(b, p-1, p3) != 1: b += 1
        return b
    print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Sep 26 2021
    
  • Python
    from sympy import prime
    from sympy.ntheory.residue_ntheory import nthroot_mod
    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

Extensions

Edited by Felix Fröhlich, Nov 24 2018