login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A317623 Number of distinct values of X*(3*X-1) mod n. 2

%I #11 Sep 13 2020 13:05:44

%S 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 16,16,18,9,12,18,19,10,21,12,21,12,22,12,27,12,24,24,22,11,27,14,27,

%U 27,18,16,30,15,30,18,31,16,36,32,21,18,34,18,36,12,36

%N Number of distinct values of X*(3*X-1) mod n.

%H Amiram Eldar, <a href="/A317623/b317623.txt">Table of n, a(n) for n = 1..10000</a>

%F 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 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 (PARI) a(n)={my(v=vector(n)); for(i=0, n-1, v[i*(3*i-1)%n + 1]=1); vecsum(v)}

%o (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 Cf. A000224, A290731, A290732.

%K nonn,mult

%O 1,3

%A _Andrew Howroyd_, Aug 01 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 14 06:54 EDT 2024. Contains 375920 sequences. (Running on oeis4.)