cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A363710 a(n) is the number of pairs of nonnegative integers (x, y) such that x + y = n and A003188(x) AND A003188(y) = 0 (where AND denotes the bitwise AND operator).

Original entry on oeis.org

1, 2, 2, 2, 4, 4, 2, 2, 4, 8, 6, 4, 6, 4, 2, 2, 4, 8, 10, 8, 12, 12, 6, 4, 6, 12, 8, 4, 6, 4, 2, 2, 4, 8, 10, 8, 16, 20, 10, 8, 12, 24, 20, 12, 16, 12, 6, 4, 6, 12, 16, 12, 16, 16, 8, 4, 6, 12, 8, 4, 6, 4, 2, 2, 4, 8, 10, 8, 16, 20, 10, 8, 16, 32, 28, 20, 28
Offset: 0

Views

Author

Rémy Sigrist, Jun 17 2023

Keywords

Comments

Equivalently, a(n) is the number of k >= 0 such that A332497(k) + A332498(k) = n.
The set of pairs of nonnegative integers (x, y) such that A003188(x) AND A003188(y) = 0 is related to the T-square fractal (see illustration in Links section).

Examples

			For n = 8:
- we have:
  k  A332497(8-k)  A332497(k)  A332497(8-k) AND A332497(k)
  -  ------------  ----------  ---------------------------
  0            12           0                            0
  1             4           1                            0
  2             5           3                            1
  3             7           2                            2
  4             6           6                            6
  5             2           7                            2
  6             3           5                            1
  7             1           4                            0
  8             0          12                            0
- so a(8) = 4.
		

Crossrefs

Programs

  • PARI
    a(n) = 2*sum(k=0, n\2, bitand(bitxor(n-k, (n-k)\2), bitxor(k, k\2))==0) - (n==0)
    
  • Python
    A363710=lambda n: sum(map(lambda k: not (k^k>>1)&(n-k^n-k>>1),range(n+1>>1)))<<1 if n else 1 # Natalia L. Skirrow, Jun 22 2023

Formula

a(n) = 2 iff n belongs to A075427.