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.

A102371 Numbers missing from A102370.

Original entry on oeis.org

1, 2, 7, 12, 29, 62, 123, 248, 505, 1018, 2047, 4084, 8181, 16374, 32755, 65520, 131057, 262130, 524279, 1048572, 2097133, 4194286, 8388587, 16777192, 33554409, 67108842, 134217711, 268435428, 536870885
Offset: 1

Views

Author

Philippe Deléham, Feb 13 2005

Keywords

Comments

Indices of negative numbers in A103122.
Write numbers in binary under each other; start at 2^k, read in upward direction with the first bit omitted and convert to decimal:
. . . . . . . . . . 0
. . . . . . . . . . 1
.. . . . . . . . . 10 < -- Starting here, the upward diagonal (first bit omitted) reads 1 -> 1
.. . . . . . . . . 11
. . . . . . . . . 100 < -- Starting here, the upward diagonal (first bit omitted) reads 10 -> 2
. . . . . . . . . 101
. . . . . . . . . 110
. . . . . . . . . 111
.. . . . . . . . 1000 < -- Starting here, the upward diagonal (first bit omitted) reads 111 -> 7
. . . . . . . . .1001
Thus a(n) = A102370(2^n - n) - 2^n.
Do we have a(n) = 2^n-1-A105033(n-1)? - David A. Corneth, May 07 2020

Crossrefs

Programs

  • Haskell
    a102371 n = a102371_list !! (n-1)
    a102371_list = map (a105027 . toInteger) $ tail a000225_list
    -- Reinhard Zumkeller, Jul 21 2012
  • Maple
    A102371:= proc (n) local t1, l; t1 := -n; for l to n do if `mod`(n-l,2^l) = 0 then t1 := t1+2^l end if end do; t1 end proc;
  • Python
    a=1
    for n in range(2,66):
        print(a, end=",")
        a ^= a+n
    # Alex Ratushnyak, Apr 21 2012
    

Formula

a(n) = -n + Sum_{ k >= 1, k == n mod 2^k } 2^k. - N. J. A. Sloane and David Applegate, Mar 22 2005. E.g. a(5) = -5 + 2^1 + 2^5 = 29.
a(2^k + k) -a(k) = 2^(2^k + k) - 2^k, with k>= 1.
a(1)=1, for n>1, a(n) = a(n-1) XOR (a(n-1) + n), where XOR is the bitwise exclusive-or operator. - Alex Ratushnyak, Apr 21 2012
a(n) = A105027(A000225(n)). - Reinhard Zumkeller, Jul 21 2012

Extensions

More terms from Benoit Cloitre, Mar 20 2005
a(16)-a(22) from Robert G. Wilson v, Mar 21 2005
a(15)-a(29) from David Applegate, Mar 22 2005