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.

A280015 a(n) is the least k such that A056619(k) = prime(n).

Original entry on oeis.org

1, 2, 12, 10, 6, 76, 114, 34, 120, 246, 1386, 616, 1126, 3774, 510, 8220, 2634, 25810, 57936, 46836, 12180, 254940, 54574, 80040, 497146, 801780, 402324, 1003744, 6441196, 2858890, 27821214, 14312640, 47848164, 25049814, 8454126, 45433894, 4262890
Offset: 1

Views

Author

Robert Israel, Feb 21 2017

Keywords

Comments

a(n) is the least number that is a primitive root mod prime(n) but not mod any lower prime.
Using the Chinese Remainder Theorem, it is easy to show that such k always exists.

Examples

			10 is a primitive root mod prime(4) = 7, but not mod 2, 3 or 5.  This is the least number with that property, so a(4)=10.
		

Crossrefs

Cf. A056619.

Programs

  • Maple
    a[1]:= 1: a[2]:= 2: p:= 3:
    Cands:= {4,seq(seq(6*i+j,j=[0,4]),i=1..10^7)}:
    for n from 3 while Cands <> {} do
      p:= nextprime(p);
      r:= numtheory:-primroot(p);
      s:= select(t -> igcd(t,p-1)=1, {$1..p-1});
      q:= map(t -> r &^t mod p, s);
      R,Cands:= selectremove(t -> member(t mod p, q), Cands):
      if R = {} then break fi;
      a[n]:= min(R);
    od:
    seq(a[i],i=1..n-1);

A023049 Smallest prime > n having primitive root n, or 0 if no such prime exists.

Original entry on oeis.org

2, 3, 5, 0, 7, 11, 11, 11, 0, 17, 13, 17, 19, 17, 19, 0, 23, 29, 23, 23, 23, 31, 47, 31, 0, 29, 29, 41, 41, 41, 47, 37, 43, 41, 37, 0, 59, 47, 47, 47, 47, 59, 47, 47, 47, 67, 59, 53, 0, 53, 53, 59, 71, 59, 59, 59, 67, 73, 61, 73, 67, 71, 67, 0, 71, 79, 71, 71, 71, 79, 83, 83, 83, 79
Offset: 1

Views

Author

Keywords

Comments

Indices of record values of a(n)-n are (1, 2, 3, 6, 10, 18, 23, 78, 102, 105, 488, 652, 925, ...). Record values of a(n)/n are 3/2, 5/3, 11/6, 47/23, ... (Is there another n with a(n) > 2n ?) - M. F. Hasler, Feb 21 2017

Crossrefs

See also A056619, where the primitive root may be larger than the prime, whereas in A023049 it may not be.

Programs

  • Maple
    f:= proc(n) local p;
      if issqr(n) then return 0 fi;
      p:= nextprime(n);
      do
        if numtheory:-order(n,p) = p-1 then return p fi;
        p:= nextprime(p);
      od
    end proc:
    f(1):= 2:
    map(f, [$1..100]); # Robert Israel, Feb 21 2017
  • Mathematica
    a[n_] := For[p = 2, p <= 2 n + 1, p = NextPrime[p], If[MemberQ[ PrimitiveRootList[p], n], Return[p]]] /. Null -> 0; Array[a, 100] (* Jean-François Alcover, Mar 05 2019 *)
  • PARI
    A023049(n)={issquare(n)||forprime(p=n+1,,znorder(Mod(n,p))==p-1&&return(p));(n==1)*2} \\ M. F. Hasler, Feb 21 2017

Formula

a(n) = 0 iff n is a square > 1. - M. F. Hasler, Feb 21 2017

A280014 Numbers m == +- 2 (mod 10) but not m == 2 (mod 6).

Original entry on oeis.org

12, 18, 22, 28, 42, 48, 52, 58, 72, 78, 82, 88, 102, 108, 112, 118, 132, 138, 142, 148, 162, 168, 172, 178, 192, 198, 202, 208, 222, 228, 232, 238, 252, 258, 262, 268, 282, 288, 292, 298, 312, 318, 322, 328, 342, 348, 352, 358, 372, 378, 382, 388, 402, 408, 412, 418, 432, 438, 442, 448, 462, 468, 472, 478, 492, 498, 502, 508, 522
Offset: 1

Views

Author

M. F. Hasler, Feb 21 2017

Keywords

Comments

Also, numbers congruent to 12, 18, 22 or 28 (mod 30). Also, numbers such that A056619(n) = 5.

Crossrefs

Programs

  • Mathematica
    Select[Range@ 524, MemberQ[{12, 18, 22, 28}, Mod[#, 30]] &] (* Michael De Vlieger, Feb 21 2017 *)
    LinearRecurrence[{1,0,0,1,-1},{12,18,22,28,42},80] (* Harvey P. Dale, Nov 09 2017 *)
  • PARI
    a(n)=[12,18,22,28][(n-1)%4+1]+(n-1)\4*30
    
  • PARI
    Vec(2*x*(2 + x)*(3 + x^2 + x^3) / ((1 - x)^2*(1 + x)*(1 + x^2)) + O(x^60)) \\ Colin Barker, Feb 12 2018

Formula

a(n+4) = a(n)+30.
From Colin Barker, Feb 12 2018: (Start)
G.f.: 2*x*(2 + x)*(3 + x^2 + x^3) / ((1 - x)^2*(1 + x)*(1 + x^2)).
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
(End)
a(n) = (5 + 30*n - 3*(-1)^n + 10*A057077(n))/4. - Stefano Spezia, Dec 26 2021

A347772 Square array read by antidiagonals downwards: T(n,k) is the smallest prime p not dividing n such that (p-1) / ord_p(n) = k (n>=2, k>=1), or 0 if no such p exists.

Original entry on oeis.org

3, 7, 2, 43, 11, 0, 113, 67, 3, 2, 251, 13, 0, 11, 11, 31, 41, 17, 13, 19, 2, 1163, 61, 0, 101, 7, 3, 3, 73, 883, 31, 0, 5, 73, 17, 2, 397, 313, 0, 199, 31, 29, 13, 5, 7, 151, 271, 73, 827, 139, 1031, 113, 0, 3, 2, 331, 431, 0, 569, 463, 19, 251, 13, 103, 7, 5, 1753, 5743, 151, 487, 97, 43
Offset: 2

Views

Author

Eric Chen, Sep 14 2021

Keywords

Examples

			Table begins:
  n\k |  1   2    3    4     5    6     7    8    9    10    11    12
  ----+--------------------------------------------------------------
   2  |  3   7   43  113   251   31  1163   73  397   151   331  1753
   3  |  2  11   67   13    41   61   883  313  271   431  5743   193
   4  |  0   3    0   17     0   31     0   73    0   151     0   433
   5  |  2  11   13  101     0  199   827  569  487    31  1453   181
   6  | 11  19    7    5    31  139   463   97   37   101   353   241
   7  |  2   3   73   29  1031   19    43  113  883   311   353  1453
   8  |  3  17   13  113   251    7  1163   89  109   431  1013   577
   9  |  2   5    0   13     0   67     0  313    0    41     0    61
  10  |  7   3  103   53    11   79   211   41   73   281   353    37
  11  |  2   7  193    5   191   19   379  449  199  1301  2531  1549
  12  |  5  23   19   37   271   13    29  193  487    11    89   373
  ...
		

Crossrefs

Row 2: A101208.
Row 3: A101209.
Row 10: A054471.
Column 1: A056619.

Programs

  • PARI
    a(m, n)=forprime(p=2, 2^40, if(gcd(m, p)==1 && znorder(Mod(m, p))==(p-1)/n, return(p)))
    is(m, n)=p=core(m); if(p>1 && p%4==1 && n%p==0 && n%2, return(1)); 0
    A347772(m, n)=if(is(m, n) || (issquare(m) && n%2 && (m%2==0 || n>1)), 0, a(m, n))

Formula

T(n,k) = 0 if n is square, k is odd, n > 1.
T(n,k) = 0 if n is even square, k is odd.
T(n,k) = 0 if (let n' be the squarefree part (A007913) of n) n' == 1 (mod 4), n' > 1, k is divisible by n', k is odd.
T(27,k) = 0 for k == 4 or 8 (mod 12).
T(n,k) == 1 mod k if nonzero.
Showing 1-4 of 4 results.