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.

A259234 Smallest b > 1 not occurring earlier in the sequence such that p = prime(n) satisfies b^(p-1) == 1 (mod p^2).

Original entry on oeis.org

5, 8, 7, 18, 3, 19, 38, 28, 42, 14, 115, 76, 51, 75, 53, 338, 137, 264, 143, 11, 306, 31, 99, 184, 107, 181, 43, 164, 96, 68, 62, 58, 161, 328, 313, 78, 226, 65, 253, 259, 532, 298, 176, 276, 284, 174, 165, 69, 330, 44, 33, 332, 94, 263, 48, 79, 171, 747, 731
Offset: 1

Views

Author

Felix Fröhlich, Jun 29 2015

Keywords

Comments

Is this a permutation of the positive integers > 1?

Crossrefs

Cf. A039678.

Programs

  • Maple
    g:= proc() false end:
    a:= proc(n) option remember; local b, p, pm, pp;
          if n>0 then a(n-1); p:= ithprime(n); pm:=p-1; pp:= p^2;
          for b from 2 while g(b) or b &^ pm mod pp <> 1 do od;
          g(b):= true; b fi
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jul 20 2015
  • Mathematica
    f[n_] := f[n] = Block[{b = 2, p = Prime@ n, lst = Array[f, n - 1]}, While[ PowerMod[b, p - 1, p^2] != 1 || MemberQ[lst, b], b++]; b]; Array[f, 60] (* Robert G. Wilson v, Jul 12 2015 *)
  • PARI
    v=vector(1); forprime(p=1, 50, b=2; while(Mod(b, p^2)^(p-1)!=1, b++; if(Mod(b, p^2)^(p-1)==1, for(k=1, #v, if(b==v[k], b++)))); v=concat(v, b); print1(v[#v], ", "))
    
  • PARI
    A259234=List();for(n=1,500,my(p=prime(n),b=1);until(Mod(b++,p^2)^(p-1)==1 && !setsearch(Set(A259234),b),); listput(A259234,b); /*print1(b",")*/) \\ M. F. Hasler, Jul 20 2015