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.

Showing 1-10 of 12 results. Next

A214414 Fixed points of permutations A105027 and A214417.

Original entry on oeis.org

0, 1, 5, 7, 18, 22, 26, 30, 1031, 1039, 1047, 1055, 1063, 1071, 1079, 1087, 1095, 1103, 1111, 1119, 1127, 1135, 1143, 1151, 1159, 1167, 1175, 1183, 1191, 1199, 1207, 1215, 1223, 1231, 1239, 1247, 1255, 1263, 1271, 1279, 1287, 1295, 1303, 1311, 1319, 1327
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 21 2012

Keywords

Comments

A105027(a(n)) = A214417(a(n)) = a(n).

Crossrefs

Programs

  • Haskell
    a214414 n = a214414_list !! (n-1)
    a214414_list = [x | x <- [0..], a105027 x == x]

A214417 Inverse permutation to A105027.

Original entry on oeis.org

0, 1, 3, 2, 6, 5, 4, 7, 11, 10, 9, 12, 15, 14, 13, 8, 20, 19, 18, 21, 24, 23, 22, 17, 28, 27, 26, 29, 16, 31, 30, 25, 37, 36, 35, 38, 41, 40, 39, 34, 45, 44, 43, 46, 33, 48, 47, 42, 53, 52, 51, 54, 57, 56, 55, 50, 61, 60, 59, 62, 49, 32, 63, 58, 70, 69, 68
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 21 2012

Keywords

Crossrefs

Cf. A214416, A214414 (fixed points).

Programs

  • Haskell
    -- import Data.List (elemIndex)
    -- import Data.Maybe (fromJust)
    a214417 = fromJust . (`elemIndex` a105027_list)

A214433 Where A105025 and A105027 agree.

Original entry on oeis.org

0, 1, 2, 3, 9, 10, 13, 14, 34, 37, 42, 45, 50, 53, 58, 61, 517, 522, 533, 538, 549, 554, 565, 570, 581, 586, 597, 602, 613, 618, 629, 634, 645, 650, 661, 666, 677, 682, 693, 698, 709, 714, 725, 730, 741, 746, 757, 762, 773, 778, 789, 794, 805, 810, 821, 826
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 21 2012

Keywords

Comments

A105025(a(n)) = A105027(a(n)).

Examples

			A105025(1018) = A105027(1018) = 1011, => 1018 is a term: a(80) = 1018;
A105025(1019) = 994 and A105027(1019) = 1014, => 1019 not a term;
A105025(524302) = A105027(524302) = 524317, => a(81) = 524302;
A105025(524303) = 524312 and A105027(524303) = 524300, => 524302 not a term.
-
		

Crossrefs

Cf. A214489.

Programs

  • Haskell
    a214433 n = a214433_list !! (n-1)
    a214433_list = [x | x <- [0..], a105025 x == a105027 x]

A105154 Consider trajectory of n under repeated application of map k -> A105027(k); a(n) = length of cycle.

Original entry on oeis.org

1, 1, 2, 2, 2, 1, 2, 1, 4, 2, 2, 4, 4, 2, 2, 4, 4, 4, 1, 4, 4, 4, 1, 4, 4, 4, 1, 4, 4, 4, 1, 4, 8, 4, 4, 4, 4, 8, 4, 4, 8, 4, 4, 4, 4, 8, 4, 4, 8, 4, 4, 4, 4, 8, 4, 4, 8, 4, 4, 4, 4, 8, 4, 4, 16, 8, 4, 2, 4, 8, 16, 2, 16, 8, 4, 2, 4, 8, 16, 2, 16, 8, 4, 2, 4, 8, 16, 2, 16, 8, 4, 2, 4, 8, 16, 2, 16, 8, 4, 2, 4
Offset: 0

Views

Author

Philippe Deléham, Apr 30 2005

Keywords

Comments

Why is this always a power of 2?
a(n) is always a power of 2: If n is a k-bit number, then so are all numbers in the A105154-orbit of n. For m in the orbit, the i-th bit (i=1,..,k) of A105154(m) is the i-th bit of m-k+i and hence depends only on the lower i bits of m. By induction quickly follows that the lower i bits run through a cycle of length dividing 2^i. This also shows that a(n) <= n for n > 0.

Crossrefs

Programs

  • Haskell
    a105154 n = t [n] where
       t xs@(x:_) | y `elem` xs = length xs
                  | otherwise   = t (y : xs) where y = a105027 x
    -- Reinhard Zumkeller, Jul 21 2012

Extensions

More terms taken from b-file by Hagen von Eitzen, Jun 24 2009

A105028 Binary equivalents of A105027.

Original entry on oeis.org

0, 1, 11, 10, 110, 101, 100, 111, 1111, 1010, 1001, 1000, 1011, 1110, 1101, 1100, 11100, 10111, 10010, 10001, 10000, 10011, 10110, 10101, 10100, 11111, 11010, 11001, 11000, 11011, 11110, 11101, 111101, 101100, 100111, 100010, 100001
Offset: 0

Views

Author

N. J. A. Sloane, Apr 03 2005

Keywords

Crossrefs

Formula

a(n) = A007088(A105027(n)). - Michel Marcus, May 06 2020

Extensions

More terms from Philippe Deléham and Erich Friedman, Aug 05 2005

A102370 "Sloping binary numbers": write numbers in binary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

0, 3, 6, 5, 4, 15, 10, 9, 8, 11, 14, 13, 28, 23, 18, 17, 16, 19, 22, 21, 20, 31, 26, 25, 24, 27, 30, 61, 44, 39, 34, 33, 32, 35, 38, 37, 36, 47, 42, 41, 40, 43, 46, 45, 60, 55, 50, 49, 48, 51, 54, 53, 52, 63, 58, 57, 56, 59, 126, 93, 76, 71, 66, 65, 64, 67, 70, 69
Offset: 0

Views

Author

Philippe Deléham, Feb 13 2005

Keywords

Comments

All terms are distinct, but certain terms (see A102371) are missing. But see A103122.
Trajectory of 1 is 1, 3, 5, 15, 17, 19, 21, 31, 33, ..., see A103192.

Examples

			........0
........1
.......10
.......11
......100
......101
......110
......111
.....1000
.........
The upward-sloping diagonals are:
0
11
110
101
100
1111
1010
.......
giving 0, 3, 6, 5, 4, 15, 10, ...
The sequence has a natural decomposition into blocks (see the paper): 0; 3; 6, 5, 4; 15, 10, 9, 8, 11, 14, 13; 28, 23, 18, 17, 16, 19, 22, 21, 20, 31, 26, 25, 24, 27, 30; 61, ...
Reading the array of binary numbers along diagonals with slope 1 gives this sequence, slope 2 gives A105085, slope 0 gives A001477 and slope -1 gives A105033.
		

Crossrefs

Related sequences (1): A103542 (binary version), A102371 (complement), A103185, A103528, A103529, A103530, A103318, A034797, A103543, A103581, A103582, A103583.
Related sequences (2): A103584, A103585, A103586, A103587, A103127, A103192 (trajectory of 1), A103122, A103588, A103589, A103202 (sorted), A103205 (base 10 version).
Related sequences (3): A103747 (trajectory of 2), A103621, A103745, A103615, A103842, A103863, A104234, A104235, A103813, A105023, A105024, A105025, A105026, A105027, A105028.
Related sequences (4): A105029, A105030, A105031, A105032, A105033, A105034, A105035, A105108.

Programs

  • Haskell
    a102370 n = a102370_list !! n
    a102370_list = 0 : map (a105027 . toInteger) a062289_list
    -- Reinhard Zumkeller, Jul 21 2012
    
  • Maple
    A102370:=proc(n) local t1,l; t1:=n; for l from 1 to n do if n+l mod 2^l = 0 then t1:=t1+2^l; fi; od: t1; end;
  • Mathematica
    f[n_] := Block[{k = 1, s = 0, l = Max[2, Floor[Log[2, n + 1] + 2]]}, While[k < l, If[ Mod[n + k, 2^k] == 0, s = s + 2^k]; k++ ]; s]; Table[ f[n] + n, {n, 0, 71}] (* Robert G. Wilson v, Mar 21 2005 *)
  • PARI
    A102370(n)=n-1+sum(k=0,ceil(log(n+1)/log(2)),if((n+k)%2^k,0,2^k)) \\ Benoit Cloitre, Mar 20 2005
    
  • PARI
    {a(n) = if( n<1, 0, sum( k=0, length( binary( n)), bitand( n + k, 2^k)))} /* Michael Somos, Mar 26 2012 */
    
  • Python
    def a(n): return 0 if n<1 else sum([(n + k)&(2**k) for k in range(len(bin(n)[2:]) + 1)]) # Indranil Ghosh, May 03 2017

Formula

a(n) = n + Sum_{ k >= 1 such that n + k == 0 mod 2^k } 2^k. (Cf. A103185.) In particular, a(n) >= n. - N. J. A. Sloane, Mar 18 2005
a(n) = A105027(A062289(n)) for n > 0. - Reinhard Zumkeller, Jul 21 2012

Extensions

More terms from Benoit Cloitre, Mar 20 2005

A062289 Numbers n such that n-th row in Pascal triangle contains an even number, i.e., A048967(n) > 0.

Original entry on oeis.org

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

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 02 2001

Keywords

Comments

Numbers n such that binary representation contains the bit string "10". Union of A043569 and A101082. - Rick L. Shepherd, Nov 29 2004
The asymptotic density of this sequence is 1 (Burns, 2016). - Amiram Eldar, Jan 26 2021

Crossrefs

Complement of A000225, so these might be called non-Mersenne numbers.
A132782 is a subsequence.

Programs

  • Haskell
    a062289 n = a062289_list !! (n-1)
    a062289_list = 2 : g 2 where
       g n = nM n : g (n+1)
       nM k = maximum $ map (\i -> i + min i (a062289 $ k-i+1)) [2..k]
       -- Cf. link [Oliver Kullmann, Xishun Zhao], Def. 3.1, page 3.
    -- Reinhard Zumkeller, Feb 21 2012, Dec 31 2010
    
  • Mathematica
    ok[n_] := MatchQ[ IntegerDigits[n, 2], {_, 1, 0, _}]; Select[ Range[100], ok] (* Jean-François Alcover, Dec 12 2011, after Rick L. Shepherd *)
  • PARI
    isok(m) = #select(x->((x%2)==0), vector(m+1, k, binomial(m, k-1))); \\ Michel Marcus, Jan 26 2021
    
  • Python
    def A062289(n): return n+(m:=n.bit_length())-(not n>=(1<Chai Wah Wu, Jun 30 2024

Formula

a(n) = A057716(n+1) - 1.
a(n) = 2 if n=1, otherwise max{min{2*i, a(n-i+1) + i}: 1 < i <= n}.
A036987(a(n)) = 0. - Reinhard Zumkeller, Mar 06 2012
A007461(a(n)) mod 2 = 0. - Reinhard Zumkeller, Apr 02 2012
A102370(n) = A105027(a(n)). - Reinhard Zumkeller, Jul 21 2012
A261461(a(n)) = A261922(a(n)). - Reinhard Zumkeller, Sep 17 2015

Extensions

More terms from Rick L. Shepherd, Nov 29 2004

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

A105025 Write numbers in binary under each other; to get the next block of 2^k (k >= 0) terms of the sequence, start at 2^k, read diagonals in downward direction and convert to decimal.

Original entry on oeis.org

0, 1, 3, 2, 4, 7, 6, 5, 11, 10, 9, 12, 15, 14, 13, 8, 18, 17, 20, 23, 22, 21, 16, 27, 26, 25, 28, 31, 30, 29, 24, 19, 33, 36, 39, 38, 37, 32, 43, 42, 41, 44, 47, 46, 45, 40, 35, 50, 49, 52, 55, 54, 53, 48, 59, 58, 57, 60, 63, 62, 61, 56, 51, 34, 68, 71, 70, 69, 64, 75, 74, 73, 76
Offset: 0

Views

Author

N. J. A. Sloane, Apr 03 2005

Keywords

Comments

This is a permutation of the nonnegative integers.
a(A214433(n)) = A105027(A214433(n)); a(A214489(n)) = A105029(A214489(n)). - Reinhard Zumkeller, Jul 21 2012

Examples

			........0
........1
.......10
.......11
......100 <- Starting here, the downward diagonals
......101 read 100, 111, 110, 101, giving the block 4, 7, 6, 5.
......110
......111
.....1000
.....1001
.....1010
.....1011
.........
		

Crossrefs

Cf. A105271 (fixed points), A214416 (inverse).

Programs

  • Haskell
    import Data.Bits ((.|.), (.&.))
    a105025 n = foldl (.|.) 0 $ zipWith (.&.)
                      a000079_list $ reverse $ enumFromTo n (n - 1 + a070939 n)
    -- Reinhard Zumkeller, Jul 21 2012
  • Maple
    a:=proc(i,j) if j=1 and i<=16 then 0 else convert(i+15,base,2)[7-j] fi end: seq(a(i,2)*2^4+a(i+1,3)*2^3+a(i+2,4)*2^2+a(i+3,5)*2+a(i+4,6),i=1..16); # this is a Maple program (not necessarily the simplest) only for one block of (2^4) numbers # Emeric Deutsch, Apr 16 2005
  • Mathematica
    numberOfBlocks = 7; bloc[n_] := Join[ Table[ IntegerDigits[k, 2], {k, 2^(n-1), 2^n-1}], Table[ Rest @ IntegerDigits[k, 2], {k, 2^n, 2^n+n}]]; Join[{0, 1}, Flatten[ Table[ Table[ Diagonal[bloc[n], k] // FromDigits[#, 2]&, {k, 0, -2^(n-1)+1, -1}], {n, 2, numberOfBlocks}]]] (* Jean-François Alcover, Nov 03 2016 *)

Extensions

More terms from Emeric Deutsch, Apr 16 2005

A105029 Write numbers in binary under each other, left justified, read diagonals in downward direction, convert to decimal.

Original entry on oeis.org

0, 2, 6, 5, 4, 14, 13, 8, 11, 10, 9, 12, 30, 29, 24, 19, 18, 17, 20, 23, 22, 21, 16, 27, 26, 25, 28, 62, 61, 56, 51, 34, 33, 36, 39, 38, 37, 32, 43, 42, 41, 44, 47, 46, 45, 40, 35, 50, 49, 52, 55, 54, 53, 48, 59, 58, 57, 60, 126, 125, 120, 115, 98, 65, 68, 71, 70
Offset: 0

Views

Author

Benoit Cloitre, Apr 03 2005

Keywords

Comments

All terms are distinct, but the numbers 2^m - 1 are missing.
a(n) = Sum_{k>=1} B(n+k-1,k)*2^(A103586(n)-k) where B(n,k) n>=1, k>=1 is the infinite array:
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
.......
where n-th row consists of binary expansion of n followed by 0's.
a(n) = A105025(n) iff A070939(n) = A103586(n), cf. A214489. - Reinhard Zumkeller, Jul 21 2012

Examples

			0
1
1 0
1 1
1 0 0
1 0 1
1 1 0
1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
and reading the diagonals downwards we get 0, 10, 110, 101, 100, 1110, 1101, etc.
		

Crossrefs

Programs

  • Haskell
    import Data.Bits ((.|.), (.&.))
    a105029 n = foldl (.|.) 0 $ zipWith (.&.) a000079_list $
       map (\x -> (len + 1 - a070939 x) * x)
           (reverse $ enumFromTo n (n - 1 + len))  where len = a103586 n
    -- Reinhard Zumkeller, Jul 21 2012
Showing 1-10 of 12 results. Next