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.

User: Russ Cox

Russ Cox's wiki page.

Russ Cox has authored 33 sequences. Here are the ten most recent ones:

A249058 a(n) = number of primes less than the square root of the (2^n)-th prime.

Original entry on oeis.org

0, 0, 1, 2, 4, 5, 7, 9, 12, 17, 24, 32, 45, 61, 82, 114, 154, 215, 293, 404, 557, 766, 1057, 1459, 2025, 2800, 3880, 5379, 7470, 10368, 14414, 20030, 27864, 38745, 53982, 75206, 104799, 146151, 203821, 284381, 396976, 554303, 774256, 1081749, 1511871, 2113506
Offset: 0

Author

Russ Cox, Oct 19 2014

Keywords

Crossrefs

Cf. A033844. Related to analysis of A247665.

Programs

  • Mathematica
    PrimePi[Sqrt[Prime[2^n]]]

Formula

a(n) = primepi(sqrt(A033844(n))). - Jens Kruse Andersen, Oct 20 2014

Extensions

More terms from Jens Kruse Andersen, Oct 20 2014

A248391 Terms in A247665 which are neither primes nor prime powers, in order of appearance.

Original entry on oeis.org

15, 14, 85, 57, 161, 319, 403, 259, 451, 559, 235, 901, 177, 1159, 1541, 781, 2117, 1027, 2573, 445, 1649, 1121, 122, 707, 851, 1133, 2911, 3103, 1417, 3397, 3503, 415, 4183, 2159, 5141, 393, 2603, 244, 973, 2323, 5513, 10117, 4223, 4553, 11899, 2171, 7439, 5549, 8507, 3247, 6731, 579, 2489, 8083, 1379, 3197
Offset: 1

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Crossrefs

A248390 Composite terms in A247665 in order of appearance.

Original entry on oeis.org

4, 9, 8, 15, 14, 25, 27, 16, 49, 121, 169, 85, 57, 32, 161, 319, 403, 125, 289, 81, 361, 64, 259, 529, 451, 841, 559, 961, 235, 901, 177, 1159, 128, 343, 1369, 1541, 781, 1681, 2117, 1027, 1849, 2573, 445, 2209, 1649, 2809, 243, 1121, 122, 707
Offset: 1

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Crossrefs

A248389 Terms in A247665 that are less than the previous term.

Original entry on oeis.org

8, 15, 14, 25, 16, 85, 57, 32, 161, 403, 125, 81, 64, 259, 451, 559, 235, 901, 177, 1159, 128, 343, 781, 1027, 445, 1649, 243, 1121, 122, 707, 851, 1133, 2911, 3103, 1417, 3397, 3503, 415, 4183, 2159, 5141, 393, 2603, 244, 973, 2323, 10117, 1331, 4223, 4553, 11899, 2171, 6241, 5549, 625, 7921, 3247, 6731, 579
Offset: 1

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Comments

All terms are composite.

Crossrefs

Cf. A247665.

A248388 Indices of composite terms in A247665.

Original entry on oeis.org

3, 6, 7, 13, 15, 27, 28, 31, 32, 40, 50, 55, 57, 63, 65, 82, 101, 111, 112, 115, 116, 127, 131, 132, 165, 172, 203, 204, 223, 225, 231, 233, 255, 263, 264, 278, 331, 332, 358, 407, 408, 417, 447, 448, 451, 455, 463, 467, 511, 527, 557, 661, 663, 665, 717, 761
Offset: 1

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Crossrefs

A248387 a(n) = index of n-th prime in A247665.

Original entry on oeis.org

1, 2, 4, 5, 8, 9, 10, 11, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 56, 58, 59, 60, 61, 62, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81
Offset: 1

Author

Russ Cox and N. J. A. Sloane, Oct 16 2014

Keywords

Crossrefs

Subsequence of A248918.

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a248387 = (+ 1) . fromJust . (`elemIndex` a247665_list) . a000040
    -- Reinhard Zumkeller, Oct 16 2014

A248381 Multiples of 3 in A247665 in order of appearance.

Original entry on oeis.org

9, 15, 27, 57, 81, 177, 243, 393, 579, 729, 849, 1257, 2187, 4197, 4143, 5853, 6561, 17817, 17781, 19683, 56157, 59049, 104289, 104277, 154509
Offset: 1

Author

Russ Cox and N. J. A. Sloane, Oct 12 2014

Keywords

Comments

The initial multiples of 3 occur at positions 6,13,28,57,115,231, ... - conjecturally, for n > 13, A247665(n) is a multiple of 3 iff n = 29*2^k-1, k >= 0.

Examples

			Table showing index where multiples of 3 appear, the multiple of 3, and the number of different prime factors of that term:
6 9 1
13 15 2
28 27 1
57 57 2
115 81 1
231 177 2
463 243 1
927 393 2
1855 579 2
3711 729 1
7423 849 2
14847 1257 2
29695 2187 1
59391 4197 2
118783 4143 2
237567 5853 2
475135 6561 1
950271 17817 2
1900543 17781 2
3801087 19683 1
7602175 56157 2
15204351 59049 1
30408703 104289 2
60817407 104277 2
121634815 154509 2
		

Crossrefs

Cf. A247665, A248379 (multiples of 2).

A178939 Maximal AND-OR-XOR formula complexity (operator count) for n-input Boolean functions.

Original entry on oeis.org

1, 1, 4, 7, 12
Offset: 1

Author

Russ Cox, Dec 30 2010

Keywords

References

  • D. E. Knuth, The Art of Computer Programming, Volume 4A, Section 7.1.2.

Crossrefs

Cf. A056287.

A160638 Bit-reversed 8-bit binary numbers.

Original entry on oeis.org

0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156
Offset: 0

Author

Russ Cox, May 21 2009

Comments

This sequence is found in computer programs that need to reverse the bits in a byte, typically during data compression or other bit-level encoding. a(n) is its own inverse: a(a(n)) = n.
A permutation of the integers 0-255. - Jon Perry, Oct 06 2012
a(n) is even for 0 <= n< 128 and odd for n <= 128 < 256. - Jon Perry, Oct 06 2012
a(m) + a(n) = a(m+n) when the binary representations of m and n have no bits in common. - Jon Perry, Oct 06 2012

Examples

			n = 1 = 00000001 binary, so a(1) = 10000000 binary = 128.
n = 29 = 00011101 binary, so a(29) = 10111000 binary = 184.
		

References

  • Henry S. Warren, Hacker's Delight, Addison-Wesley, 2002, pages 101-106.

Crossrefs

Cf. A217589.

Programs

  • C
    int a = 0; for(int i=0; i<8; i++) if(n & (1<
    				
  • Haskell
    import Data.Bits (testBit, setBit)
    import Data.Word (Word8)
    a160638 :: Word8 -> Word8
    a160638 n = rev 0 0 where
       rev 8 y = y
       rev i y = rev (i + 1) (if testBit n i then setBit y (7 - i) else y)
    -- Reinhard Zumkeller, Jan 12 2013
    
  • Maple
    a:= n-> Bits[Join](ListTools[Reverse](Bits[Split](n, bits=8))):
    seq(a(n), n=0..255);  # Alois P. Heinz, Nov 28 2024
  • Mathematica
    a[n_] := FromDigits[PadLeft[IntegerDigits[n, 2], 8] // Reverse, 2]; Table[a[n], {n, 0, 255}] (* Jean-François Alcover, Dec 26 2015 *)
    IntegerReverse[Range[0, 255], 2, 8] (* Paolo Xausa, Nov 28 2024 *)
  • PARI
    A160638(n)=binary(n+256)*vector(9,n,2^n)~\4  \\ M. F. Hasler, Oct 07 2012
    
  • PARI
    A160638(n)=sum(i=0,7,bittest(n,7-i)<M. F. Hasler, Oct 07 2012
    
  • Python
    def a(n): return int(bin(n)[2:].zfill(8)[::-1], 2)
    print([a(n) for n in range(256)]) # Michael S. Branicky, Jul 13 2022

Formula

a(n) = floor(A030101(n+256)/2). - Reinhard Zumkeller, Jan 12 2013

A129760 Bitwise AND of binary representation of n-1 and n.

Original entry on oeis.org

0, 0, 2, 0, 4, 4, 6, 0, 8, 8, 10, 8, 12, 12, 14, 0, 16, 16, 18, 16, 20, 20, 22, 16, 24, 24, 26, 24, 28, 28, 30, 0, 32, 32, 34, 32, 36, 36, 38, 32, 40, 40, 42, 40, 44, 44, 46, 32, 48, 48, 50, 48, 52, 52, 54, 48, 56, 56, 58, 56, 60, 60, 62, 0, 64, 64, 66, 64, 68, 68, 70, 64, 72, 72, 74
Offset: 1

Author

Russ Cox, May 15 2007

Keywords

Comments

Also the number of Ducci sequences with period n.
Also largest number less than n having in binary representation fewer ones than n has; A048881(n-1) = A000120(a(n)) = A000120(n)-1. - Reinhard Zumkeller, Jun 30 2010
a(n) is the parent of vertex n in the binomial tree. The binomial tree is root vertex n=0, then for n>=1 the parent of n is n with its least significant 1-bit changed to a 0-bit. Binomial tree order 5, n=0 to 31 inclusive, is the frontispiece of Knuth volume 1, second and subsequent editions. Vertices are shown there with n in binary dots and a(n) is the next vertex towards the root at the bottom of the page. - Kevin Ryde, Jul 24 2019

Examples

			a(6) = 6 AND 5 = binary 110 AND 101 = binary 100 = 4.
		

References

  • Donald E. Knuth, The Art of Computer Programming, volume 1, second edition, frontispiece. Reproduced with brief description of the art in Donald E. Knuth, Selected Papers on Fun and Games, 2010, Chapter 47 Geek Art, figure 16, page 679.

Programs

  • C
    int a(int n) { return n & (n-1); }
    
  • Magma
    [n - 2^Valuation(n, 2): n in [1..100]]; // Vincenzo Librandi, Jul 25 2019
    
  • Maple
    nmax := 75: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := (2*n-2) * 2^p od: od: seq(a(n), n=1..nmax); # Johannes W. Meijer, Jun 22 2011, revised Jan 25 2013
    A129760 := n -> Bits:-And(n-1, n):
    seq(A129760(n), n=1..75); # Peter Luschny, Sep 26 2019
  • Mathematica
    Table[BitAnd[n, n - 1], {n, 1, 100}] (* Vladimir Joseph Stephan Orlovsky, Jul 19 2011 *)
  • PARI
    a(n)=bitand(n,n-1) \\ Charles R Greathouse IV, Jun 23 2011
    
  • Python
    def a(n): return n & (n-1)
    print([a(n) for n in range(1, 71)]) # Michael S. Branicky, Jul 13 2022

Formula

a(n) = n AND n-1.
Equals n - A006519(n). - N. J. A. Sloane, May 26 2008
From Johannes W. Meijer, Jun 22 2011: (Start)
a((2*n-1)*2^p) = (2*n-2)*(2^p), p>=0.
a(2*n-1) = (2*n-2), n>=1, and a(2^p+1) = 2^p, p>=1. (End)