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-3 of 3 results.

A016726 Smallest k such that 1, 4, 9, ..., n^2 are distinct mod k.

Original entry on oeis.org

1, 2, 6, 9, 10, 13, 14, 17, 19, 22, 22, 26, 26, 29, 31, 34, 34, 37, 38, 41, 43, 46, 46, 53, 53, 53, 58, 58, 58, 61, 62, 67, 67, 71, 71, 73, 74, 79, 79, 82, 82, 86, 86, 89, 94, 94, 94, 97, 101, 101, 103, 106, 106, 109, 113, 113, 118, 118, 118, 122, 122, 127, 127, 131, 131, 134
Offset: 1

Views

Author

bernie(AT)wagnerpa.com (Bernie McCabe)

Keywords

Comments

This is the sequence of discriminators of the squares A000290, in the terminology of Arnold et al. - M. F. Hasler, May 04 2016

Crossrefs

Cf. A001751, A192419 (cubes), A192420 (4th powers), A347693.

Programs

  • Haskell
    a016726 n = a016726_list !! (n-1)
    a016726_list = [1,2,6,9] ++ (f 5 $ drop 4 a001751_list) where
       f n qs'@(q:qs) | q < 2*n   = f n qs
                      | otherwise = q : f (n+1) qs'
    -- Reinhard Zumkeller, Jun 20 2011
    
  • Mathematica
    a[n_] := (k = 2n; While[ Not[PrimeQ[k] || PrimeQ[k/2]], k++]; k); a[1]=1; a[2]=2; a[3]=6; a[4]=9; Table[a[n], {n, 1, 66}] (* Jean-François Alcover, Nov 30 2011, after formula *)
    sk[n_]:=Module[{k=2n,n2=Range[n]^2},While[Max[Tally[Mod[n2,k]][[All,2]]]> 1,k++];k]; Join[{1,2},Array[sk,70,3]] (* Harvey P. Dale, Oct 16 2016 *)
  • PARI
    A016726_vec(nMax)={my(S=[], a=1); vector(nMax, n, S=concat(S, n^2); while(#Set(S%a)M. F. Hasler, May 04 2016
    
  • PARI
    A016726(n)=if(n>4,min(nextprime(2*n),2*nextprime(n)),[1,2,6,9][n]) \\ M. F. Hasler, May 04 2016

Formula

For n > 4, a(n) is smallest k >= 2n such that k = p or k = 2p, p a prime.

A192420 Smallest k such that 1^4, 2^4, 3^4,... ,n^4 are distinct modulo k.

Original entry on oeis.org

1, 2, 6, 9, 11, 14, 14, 18, 19, 22, 22, 31, 31, 31, 31, 38, 38, 38, 38, 43, 43, 46, 46, 59, 59, 59, 59, 59, 59, 62, 62, 67, 67, 71, 71, 79, 79, 79, 79, 83, 83, 86, 86, 94, 94, 94, 94, 103, 103, 103, 103, 107, 107, 118, 118, 118, 118, 118, 118, 127, 127, 127, 127, 131, 131, 134, 134, 139, 139
Offset: 1

Views

Author

R. J. Mathar, Jun 30 2011

Keywords

Comments

The discriminator D(4,n).

Crossrefs

Programs

  • Maple
    dis := proc(j,n) local k,s,i; for k from 1 do s := {} ; for i from 1 to n do s := s union { (i^j) mod k} ; end do: if nops(s) = n then return k; end if; end do: end proc:
    A192420 := proc(n) dis(4,n) ; end proc:
  • Mathematica
    a[n_] := For[k = 1, True, k++, If[Unequal @@ PowerMod[Range[n], 4, k], Return[k]]]; Array[a, 100] (* Jean-François Alcover, May 18 2018 *)
  • PARI
    A192420(nMax,f=n->n^4)={my(S=[],a=1); vector(nMax,n,S=concat(S,f(n));while(#Set(S%a)M. F. Hasler, May 04 2016

A272633 Discriminator of the primes: Least m > 0 such that (prime(1),...,prime(n)) are all different mod m; a(0) = 0 by convention.

Original entry on oeis.org

0, 1, 2, 4, 6, 7, 7, 13, 13, 13, 19, 19, 19, 23, 23, 23, 31, 31, 31, 33, 37, 37, 43, 43, 47, 49, 53, 53, 53, 55, 61, 63, 67, 73, 73, 75, 75, 79, 83, 83, 89, 89, 91, 91, 97, 103, 103, 109, 113, 113, 115, 117, 119, 121, 121, 121, 121, 121, 139, 139, 141, 141, 151, 153, 157, 157, 159, 167, 169, 169, 175, 181, 181, 183, 187
Offset: 0

Views

Author

M. F. Hasler, May 04 2016

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local m;
          for m from `if`(n=1, 1, a(n-1)) while
            n<>nops({seq(ithprime(i) mod m, i=1..n)})
          do od; m
        end: a(0):=0:
    seq(a(n), n=0..80);  # Alois P. Heinz, May 04 2016
  • Mathematica
    a[0]=0; a[n_]:=Block[{m=1}, While[Length@ DeleteDuplicates@ Mod[Prime@ Range@ n, m] != n, m++]; m]; a /@ Range[0, 74] (* Giovanni Resta, May 04 2016 *)
  • PARI
    A272633(nMax)={my(S=[],a=1);vector(nMax, n, S=concat(S,prime(n)); while(#Set(S%a)
    				
Showing 1-3 of 3 results.