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.

A153587 a(n) = n mod (A062383(n) - n).

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 4, 1, 0, 1, 0, 0, 0, 2, 4, 6, 8, 10, 2, 5, 0, 4, 2, 2, 0, 2, 0, 0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 1, 4, 7, 10, 13, 0, 4, 8, 12, 4, 9, 4, 1, 0, 1, 4, 4, 0, 1, 0, 0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42
Offset: 0

Views

Author

J. Z. Bradley (jzbradley(AT)gmail.com), Dec 29 2008

Keywords

Crossrefs

Programs

  • C
    int A062383(int n) { if(n==0) return 1; return 2*(A062383(n/2)); }
    int a(int n) { return n % (A062383(n)-n); }
    
  • PARI
    b(n) = if (n, 2*b(n\2), 1);
    a(n) = n % (n - b(n)); \\ Michel Marcus, Jan 28 2018
    
  • Python
    def A153587(n): return n % ((1 << n.bit_length())-n) # Chai Wah Wu, Jun 30 2022

Formula

a(n) = n mod A080079(n), for n > 0. - Michel Marcus, Jan 28 2018

Extensions

More terms from Michel Marcus, Jan 28 2018