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.

A301917 a(n) is the least k for which A301916(n) divides 3^k + 1.

Original entry on oeis.org

1, 2, 3, 8, 9, 14, 15, 9, 4, 21, 26, 5, 11, 6, 39, 44, 24, 50, 17, 56, 63, 68, 69, 74, 25, 39, 81, 86, 8, 98, 99, 105, 111, 116, 60, 128, 134, 15, 140, 141, 146, 17, 158, 165, 84, 87, 176, 61, 93, 189, 194, 99, 200, 102, 73, 224, 114, 230, 231, 243, 83, 254
Offset: 1

Views

Author

Luke W. Richards, Mar 28 2018

Keywords

Comments

This can be used to factor P-1 values for potential primes, P of the form 3^k+2.
A301915 can be used in conjunction with this sequence such that A301916 always divides 3^(a(n) + k*A301915(n)) + 1 for all nonnegative values of k.

Examples

			A301916(1) = 2 and the first value of k for which 3^k+1 is a multiple of 2 is k = 1, so a(1) = 1.
A301916(5) = 19 and the first value of k for which 3^k+1 is a multiple of 19 is k = 9, so a(5) = 9.
		

Crossrefs

Programs

  • Maple
    f:= proc(p) local t; t:= numtheory:-order(3,p); if t::even then t/2 else NULL fi end proc:
    f(2):= 1:
    map(f, [seq(ithprime(i),i=1..300)]); # Robert Israel, May 23 2018
  • Mathematica
    f[p_] := Module[{t = MultiplicativeOrder[3, p]}, If[EvenQ[t],  t/2, Nothing]];
    f[2] = 1;
    f /@ Table[Prime[i], {i, 1, 300}] (* Jean-François Alcover, Feb 02 2023, after Robert Israel *)
  • PARI
    lista(nn) = {for (n=1, nn, p = prime(n); if (p != 3, m = Mod(3, p); nb = znorder(m); for (k=1, nb, if (m^k == Mod(-1, p), print1(k, ", ")););););} \\ Michel Marcus, May 18 2018

Formula

a(n) = A301919(n+1) - 1 for n > 1.