login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A229297 Number of solutions to x^2 == n (mod 2*n) for 0 <= x < 2*n. 4
1, 0, 1, 2, 1, 0, 1, 0, 3, 0, 1, 2, 1, 0, 1, 4, 1, 0, 1, 2, 1, 0, 1, 0, 5, 0, 3, 2, 1, 0, 1, 0, 1, 0, 1, 6, 1, 0, 1, 0, 1, 0, 1, 2, 3, 0, 1, 4, 7, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 3, 8, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 5, 2, 1, 0, 1, 4, 9, 0, 1, 2, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Andrew Howroyd, Table of n, a(n) for n = 1..10000

FORMULA

From Andrew Howroyd, Aug 07 2018: (Start)

Multiplicative with a(2^e) = 1 + (-1)^e, a(p^e) = p^floor(e/2) for odd prime p.

a(n) = A000188(n) for odd n, a(2^k) = 1 + (-1)^k for k > 0. (End)

MATHEMATICA

A[n_] := Sum[If[Mod[a^2, 2*n] == n, 1, 0], {a, 0, 2*n - 1}]; Array[A, 100]

PROG

(PARI) a(n)={sum(i=0, 2*n-1, i^2%(2*n)==n)} \\ Andrew Howroyd, Aug 06 2018

(PARI) a(n)={if(valuation(n, 2)%2==1, 0, core(n, 1)[2])} \\ Andrew Howroyd, Aug 07 2018

CROSSREFS

Cf. A000188, A229294, A229295, A229296.

Sequence in context: A118269 A144152 A265674 * A116675 A123022 A072943

Adjacent sequences:  A229294 A229295 A229296 * A229298 A229299 A229300

KEYWORD

nonn,mult

AUTHOR

José María Grau Ribas, Sep 22 2013

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 November 22 08:33 EST 2019. Contains 329389 sequences. (Running on oeis4.)