The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A087780 Number of non-congruent solutions to x^2 == 2 mod n. 3
1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,7
LINKS
FORMULA
Multiplicative with a(p^m) = 2 for p == 1, 7 (mod 8); a(p^m) = 0 for p == 3, 5 (mod 8); a(2^1) = 1; a(2^m) = 0 for m > 1. - Eric M. Schmidt, Apr 20 2013
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = log(sqrt(2)+1)/(sqrt(2)*zeta(2)) = A196525/A013661 = 0.37887551404073012021... . - Amiram Eldar, Nov 21 2023
MATHEMATICA
f[2, e_] := Boole[e == 1]; f[p_, e_] := If[MemberQ[{1, 7}, Mod[p, 8]], 2, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 19 2020 *)
PROG
(Sage)
def A087780(n) :
res = 1
for (p, m) in factor(n) :
if p % 8 in [1, 7] : res *= 2
elif not (p==2 and m==1) : return 0
return res
# Eric M. Schmidt, Apr 20 2013
(PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i, 1] == 2, (f[i, 2] == 1), if(f[i, 1]%8 == 1 || f[i, 1]%8 == 7, 2, 0))); } \\ Amiram Eldar, Nov 21 2023
CROSSREFS
Sequence in context: A332006 A086016 A103270 * A082523 A186034 A280843
KEYWORD
mult,nonn,easy
AUTHOR
Yuval Dekel (dekelyuval(AT)hotmail.com), Oct 06 2003
EXTENSIONS
More terms from David Wasserman, Jun 17 2005
STATUS
approved

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 May 20 06:19 EDT 2024. Contains 372703 sequences. (Running on oeis4.)