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.

A375487 a(n) is the number of integers k between 0 and n such that n AND k is a prime number (where AND denotes the bitwise AND operator).

This page as a plain text file.
%I A375487 #9 Aug 18 2024 09:05:13
%S A375487 0,0,1,2,0,1,2,4,0,0,4,5,0,3,2,6,0,1,8,10,0,6,4,11,0,4,4,10,0,7,2,11,
%T A375487 0,0,16,16,0,9,8,17,0,1,8,14,0,12,4,16,0,8,8,16,0,13,4,17,0,8,4,15,0,
%U A375487 15,2,18,0,0,32,33,0,16,16,34,0,1,16,27,0,18,8
%N A375487 a(n) is the number of integers k between 0 and n such that n AND k is a prime number (where AND denotes the bitwise AND operator).
%H A375487 Rémy Sigrist, <a href="/A375487/b375487.txt">Table of n, a(n) for n = 0..8192</a>
%H A375487 Rémy Sigrist, <a href="/A375487/a375487.png">Scatterplot of (n, k) such that 0 <= k <= n <= 1024 and n AND k is prime</a>
%F A375487 a(n) = 0 iff n = 0 or n belongs to A102210.
%F A375487 a(2^k-1) = A000720(2^k-1) for any k > 0.
%e A375487 The first terms, alongside the corresponding k's, are:
%e A375487   n   a(n)  k's
%e A375487   --  ----  ------------------
%e A375487    0     0  None
%e A375487    1     0  None
%e A375487    2     1  2
%e A375487    3     2  2, 3
%e A375487    4     0  None
%e A375487    5     1  5
%e A375487    6     2  2, 3
%e A375487    7     4  2, 3, 5, 7
%e A375487    8     0  None
%e A375487    9     0  None
%e A375487   10     4  2, 3, 6, 7
%e A375487   11     5  2, 3, 6, 7, 11
%e A375487   12     0  None
%e A375487   13     3  5, 7, 13
%e A375487   14     2  2, 3
%e A375487   15     6  2, 3, 5, 7, 11, 13
%o A375487 (PARI) a(n) = sum(k = 0, n, isprime(bitand(n, k)))
%Y A375487 Cf. A000720, A102210, A117494, A375485 (XOR variant), A375486 (OR variant).
%K A375487 nonn,base,easy
%O A375487 0,4
%A A375487 _Rémy Sigrist_, Aug 17 2024