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.

A349673 a(n) is the smallest positive integer m such that the set of numbers {f(k) : 1 <= k <= n} are pairwise distinct modulo m for f(x)=x^3+x.

Original entry on oeis.org

1, 3, 3, 9, 9, 9, 9, 9, 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81
Offset: 1

Views

Author

Michel Marcus, Nov 24 2021

Keywords

Comments

This is called the discriminator of f(x)=x^3+x.
First differs from A064235 at n=244.

Crossrefs

Cf. A064235.

Programs

  • Mathematica
    a[n_] := Module[{e1 = IntegerExponent[n-1, 3], e2 = IntegerExponent[n-2, 3], e = -1}, If[3^e1 == n - 1 && Mod[e1,6] == 5, e = e1 - 1]; If[3^e2 == n-2 && Mod[e2,6] == 5, e = e2 - 1];If[e > -1, 7*3^e, 3^Ceiling[Log[3,n]]]]; Array[a, 100] (* Amiram Eldar, Nov 24 2021 *)
  • PARI
    isok(n,m) = my(v=vector(n, k, (k^3+k)% m)); #v == #vecsort(v,,8);
    a(n) = my(m=1); while (!isok(n, m), m++); m;
    
  • PARI
    a(n) = {my(v); if ((n%3 == 1) && (n!=1), v=valuation(n-1,3); if ((3^v == n-1) && ((v%6)==5), return(7*3^(v-1)))); if ((n%3 == 2) && (n!=2), v=valuation(n-2,3); if ((3^v == n-2) && ((v%6)==5), return(7*3^(v-1)))); return(3^ceil(log(n)/log(3)));}

Formula

a(n) = 7*3^(6s+4) if n=3^(6s+5)+1 or n=3^(6s+5)+2; otherwise a(n) = 3^ceiling(log_3(n)) (see Theorem 1.1 in Yang & Zhao).