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.

Showing 1-4 of 4 results.

A333339 a(n) is the smallest positive number k such that n divides 3^k - k.

Original entry on oeis.org

1, 1, 3, 3, 7, 3, 2, 3, 9, 7, 4, 3, 16, 5, 27, 11, 5, 9, 29, 7, 27, 45, 39, 3, 73, 27, 27, 27, 22, 27, 132, 27, 36, 5, 27, 27, 65, 29, 27, 27, 27, 27, 10, 59, 27, 39, 12, 27, 47, 73, 42, 27, 68, 27, 36, 27, 30, 47, 154, 27, 192, 147, 27, 59, 16, 45, 119, 75, 39
Offset: 1

Views

Author

Jinyuan Wang, Mar 16 2020

Keywords

Comments

For any positive integer n, if k = a(n) + n*m*A007734(n) and m >= 0 then 3^k - k is divisible by n.
a(n) > log_3(n). - Robert Israel, Mar 19 2020

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      for k from 1 do if 3 &^k - k mod n = 0 then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 19 2020
  • Mathematica
    a[n_] := Module[{k = 1}, While[!Divisible[3^k - k, n], k++]; k]; Array[a, 100] (* Amiram Eldar, Mar 16 2020 *)
  • PARI
    a(n) = for(k=1, oo, if(Mod(3, n)^k==k, return(k)));

Formula

a(3^m) = 3^m for m >= 0.
a(3^m-m) = m for m >= 1. - Robert Israel, Mar 19 2020

A135359 a(n) is the smallest nonnegative number k such that n divides 2^k-k.

Original entry on oeis.org

0, 2, 4, 4, 3, 4, 11, 8, 5, 14, 7, 4, 10, 16, 16, 16, 30, 16, 30, 16, 11, 58, 75, 16, 34, 10, 5, 16, 6, 16, 8, 32, 58, 30, 16, 16, 58, 30, 10, 16, 33, 16, 54, 92, 16, 118, 224, 16, 36, 34, 59, 16, 36, 34, 63, 16, 130, 6, 64, 16, 43, 8, 16, 64, 16, 58, 210, 84, 118, 16, 43, 16, 32
Offset: 1

Views

Author

John L. Drost, Feb 16 2008

Keywords

Examples

			a(7)=11, since 2^11-11= 3*7*97 and 2^k-k is not divisible by 7 for 0<=k<11.
		

Crossrefs

See A072872 for another version.

Programs

  • Magma
    S:=[0];
    k:=1;
    for n in [2..80] do
      while not IsZero((2^k-k) mod n) do
           k:=k+1;
      end while;
      Append(~S, k);
      k:=1;
    end for;
    S; // Bruno Berselli, Aug 18 2013
  • Mathematica
    b[n_] := Module[{k = 0}, While[! Divisible[2^k - k, n], k++]; k]; Array[b, 25] (* G. C. Greubel, Oct 11 2016 *)
  • PARI
    a(n) = {my(k = 0); while ((2^k-k) % n, k++); k;} \\ Michel Marcus, Aug 18 2013
    

Extensions

Edited by N. J. A. Sloane, May 27 2010

A333340 a(n) is the smallest positive number k such that n divides 4^k - k.

Original entry on oeis.org

1, 2, 1, 4, 6, 4, 2, 8, 4, 6, 14, 4, 22, 2, 16, 16, 21, 4, 25, 16, 4, 14, 26, 16, 19, 22, 13, 4, 16, 16, 33, 32, 82, 50, 36, 4, 84, 62, 22, 16, 18, 4, 16, 100, 49, 26, 122, 16, 65, 46, 52, 68, 7, 40, 26, 88, 25, 16, 19, 16, 3, 66, 4, 64, 66, 82, 127, 52, 94, 36
Offset: 1

Views

Author

Jinyuan Wang, Apr 14 2020

Keywords

Crossrefs

Programs

  • PARI
    a(n) = for(k=1, oo, if(Mod(4, n)^k==k, return(k)));

Formula

a(4^m) = 4^m for m >= 0.

A333341 a(n) is the smallest positive number k such that n divides 5^k - k.

Original entry on oeis.org

1, 1, 4, 1, 5, 5, 16, 5, 4, 5, 9, 5, 5, 17, 5, 5, 11, 11, 16, 5, 16, 9, 2, 5, 25, 5, 4, 17, 74, 5, 56, 21, 16, 11, 100, 29, 13, 101, 5, 5, 43, 17, 27, 9, 40, 61, 8, 5, 32, 25, 11, 5, 28, 29, 45, 61, 16, 149, 21, 5, 3, 63, 58, 53, 5, 47, 75, 133, 4, 145, 76, 29
Offset: 1

Views

Author

Jinyuan Wang, Apr 14 2020

Keywords

Comments

For any positive integer n, if k = a(n) + n*m*A007736(n) and m >= 0 then 5^k - k is divisible by n.

Crossrefs

Programs

  • PARI
    a(n) = for(k=1, oo, if(Mod(5, n)^k==k, return(k)));

Formula

a(5^m) = 5^m for m >= 0.
Showing 1-4 of 4 results.