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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A295642 Lexicographically earliest sequence of distinct prime numbers such that, for any n > 0, a(n) AND n = n (where AND denotes the binary AND operator). 1
3, 2, 7, 5, 13, 23, 31, 11, 29, 43, 47, 61, 79, 127, 191, 17, 19, 59, 83, 53, 149, 151, 223, 89, 157, 251, 283, 317, 349, 383, 479, 37, 41, 103, 107, 101, 109, 167, 239, 173, 233, 367, 379, 431, 509, 751, 1087, 113, 179, 307, 311, 181, 373, 439, 503, 313, 443 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

This sequence is a permutation of the prime numbers (A000040) and for any prime p, a(n) = p for some n <= p.

For any n > 0, a(n) >= A295609(n).

LINKS

Rémy Sigrist, Table of n, a(n) for n = 1..10000

Rémy Sigrist, Scatterplot of the first 2^17 terms

Rémy Sigrist, Colored scatterplot of the first 2^17 terms (where the color is function of A000120(n), the Hamming weight of n)

Rémy Sigrist, C++ program for A295642

EXAMPLE

The first terms, alongside the binary representation of n and a(n), are:

  n   a(n)   bin(n)  bin(a(n))

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

   1     3        1         11

   2     2       10         10

   3     7       11        111

   4     5      100        101

   5    13      101       1101

   6    23      110      10111

   7    31      111      11111

   8    11     1000       1011

   9    29     1001      11101

  10    43     1010     101011

  11    47     1011     101111

  12    61     1100     111101

  13    79     1101    1001111

  14   127     1110    1111111

  15   191     1111   10111111

  16    17    10000      10001

  17    19    10001      10011

  18    59    10010     111011

  19    83    10011    1010011

  20    53    10100     110101

MATHEMATICA

Fold[Append[#1, Block[{p = 2}, While[Nand[FreeQ[#1, p], BitAnd[p, #2] == #2], p = NextPrime@ p]; p]] &, {3}, Range[2, 57]] (* Michael De Vlieger, Nov 26 2017 *)

PROG

(C++) See Links section.

CROSSREFS

Cf. A000040, A000120, A295609.

Sequence in context: A006921 A292204 A292203 * A014693 A318783 A253564

Adjacent sequences:  A295639 A295640 A295641 * A295643 A295644 A295645

KEYWORD

nonn,base

AUTHOR

Rémy Sigrist, Nov 25 2017

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 June 24 23:57 EDT 2021. Contains 345445 sequences. (Running on oeis4.)