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.
%I A317623 #11 Sep 13 2020 13:05:44 %S A317623 1,1,3,2,3,3,4,4,9,3,6,6,7,4,9,8,9,9,10,6,12,6,12,12,11,7,27,8,15,9, %T A317623 16,16,18,9,12,18,19,10,21,12,21,12,22,12,27,12,24,24,22,11,27,14,27, %U A317623 27,18,16,30,15,30,18,31,16,36,32,21,18,34,18,36,12,36 %N A317623 Number of distinct values of X*(3*X-1) mod n. %H A317623 Amiram Eldar, <a href="/A317623/b317623.txt">Table of n, a(n) for n = 1..10000</a> %F A317623 Multiplicative with a(2^e) = 2^(e-1), a(3^e) = 3^e, a(p^e) = 1 + floor( p^(e+1)/(2*p+2) ) for prime p >= 5. %t A317623 f[2, e_] := 2^(e-1); f[3, e_] := 3^e; f[p_, e_] := 1 + Floor[p^(e+1)/(2*p+2)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Sep 13 2020 *) %o A317623 (PARI) a(n)={my(v=vector(n)); for(i=0, n-1, v[i*(3*i-1)%n + 1]=1); vecsum(v)} %o A317623 (PARI) a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); if(p<=3, if(p==2, 2^(e-1), 3^e), 1 + p^(e+1)\(2*p+2)))} %Y A317623 Cf. A000224, A290731, A290732. %K A317623 nonn,mult %O A317623 1,3 %A A317623 _Andrew Howroyd_, Aug 01 2018