login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations (which often say "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A331532 a(n) is the number of nonnegative integers k such that (n^2) AND (k^2) = k^2 (where AND denotes the bitwise AND operator). 2
1, 2, 2, 3, 2, 5, 3, 4, 2, 5, 5, 9, 3, 4, 4, 4, 2, 4, 5, 7, 5, 12, 9, 4, 3, 9, 4, 11, 4, 7, 4, 6, 2, 5, 4, 7, 5, 12, 7, 15, 5, 7, 12, 13, 9, 17, 4, 3, 3, 7, 9, 4, 4, 20, 11, 15, 4, 8, 7, 12, 4, 5, 6, 6, 2, 4, 5, 7, 4, 11, 7, 14, 5, 12, 12, 29, 7, 8, 15, 5, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

Equivalently, this is the number of nonnegative integers k such that (n^2) OR (k^2) = n^2 (where OR denotes the bitwise OR operator); this connects this sequence to A001316.

LINKS

Rémy Sigrist, Table of n, a(n) for n = 0..8192

Rémy Sigrist, Scatterplot of (x, y) such that (x^2) AND (y^2) = y^2, with 0 <= x <= 1024

FORMULA

a(2^k) = 2 for any k >= 0.

a(n) <= n+1.

EXAMPLE

For n = 7:

- we have:

  k  7^2 AND k^2

  -  -----------

  0  0 = 0

  1  1 = 1

  2  0 <> 4

  3  1 <> 9

  4  16 = 16

  5  17 <> 25

  6  32 <> 36

  7  49 = 49

- hence a(7) = 4.

PROG

(PARI) a(n) = sum(k=0, n, bitand(n^2, k^2)==k^2)

CROSSREFS

Cf. A001316, A331533 (corresponding k's).

Sequence in context: A025478 A084371 A025476 * A078773 A151663 A162753

Adjacent sequences:  A331529 A331530 A331531 * A331533 A331534 A331535

KEYWORD

nonn,base

AUTHOR

Rémy Sigrist, Jan 19 2020

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 December 2 03:22 EST 2020. Contains 338865 sequences. (Running on oeis4.)