login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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
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, 16, 16, 18, 9, 12, 18, 19, 10, 21, 12, 21, 12, 22, 12, 27, 12, 24, 24, 22, 11, 27, 14, 27, 27, 18, 16, 30, 15, 30, 18, 31, 16, 36, 32, 21, 18, 34, 18, 36, 12, 36 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

Amiram Eldar, Table of n, a(n) for n = 1..10000

FORMULA

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.

MATHEMATICA

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 *)

PROG

(PARI) a(n)={my(v=vector(n)); for(i=0, n-1, v[i*(3*i-1)%n + 1]=1); vecsum(v)}

(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)))}

CROSSREFS

Cf. A000224, A290731, A290732.

Sequence in context: A345755 A111114 A242409 * A286244 A230010 A230847

Adjacent sequences:  A317620 A317621 A317622 * A317624 A317625 A317626

KEYWORD

nonn,mult

AUTHOR

Andrew Howroyd, Aug 01 2018

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 27 10:28 EDT 2021. Contains 347689 sequences. (Running on oeis4.)