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.

A070847 Smallest prime == 1 mod (3n).

Original entry on oeis.org

7, 7, 19, 13, 31, 19, 43, 73, 109, 31, 67, 37, 79, 43, 181, 97, 103, 109, 229, 61, 127, 67, 139, 73, 151, 79, 163, 337, 349, 181, 373, 97, 199, 103, 211, 109, 223, 229, 937, 241, 739, 127, 1033, 397, 271, 139, 283, 433, 883, 151, 307, 157, 3181, 163, 331, 337
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Crossrefs

Cf. A034694.
Cf. A024892 (n such that a(n)=3*n+1).
Cf. A002476.

Programs

  • Maple
    f:= proc(n) local k,d;
      if n::even then d:= 3*n else d:= 6*n fi;
      for k from 1 by d do if isprime(k) then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Sep 19 2019
  • Mathematica
    a[n_] := Module[{k, d}, If[EvenQ[n], d = 3n, d = 6n]; For[k = 1, True, k += d, If[PrimeQ[k], Return[k]]]];
    Array[a, 100] (* Jean-François Alcover, Jun 11 2020, after Maple *)
  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(3*n)>0,s++); print1(s,","))

Extensions

More terms from Benoit Cloitre, May 18 2002