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-2 of 2 results.

A115510 a(1)=1. a(n) is smallest positive integer not occurring earlier in the sequence such that a(n) and a(n-1) have at least one 1-bit in the same position when they are written in binary.

Original entry on oeis.org

1, 3, 2, 6, 4, 5, 7, 9, 8, 10, 11, 12, 13, 14, 15, 17, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 32, 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, 63, 65, 64, 66, 67, 68, 69, 70, 71, 72
Offset: 1

Views

Author

Leroy Quet, Jan 23 2006

Keywords

Comments

Sequence is a permutation of the positive integers. A115511 is the inverse permutation.
This can be regarded as a set-theoretic analog of A064413. - N. J. A. Sloane, Sep 06 2021

Examples

			a(3) = 2 = 10 in binary. Among the positive integers not occurring among the first 3 terms of the sequence (4 = 100 in binary, 5 = 101 in binary, 6 = 110 in binary,...), 6 is the smallest that shares at least one 1-bit with a(3) when written in binary. So a(4) = 6.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {1}, k}, Do[k = 1; While[Or[BitAnd[Last@ a, k ] == 0, MemberQ[a, k]], k++]; AppendTo[a, k], {71}]; a] (* Michael De Vlieger, Sep 07 2017 *)
  • Python
    A115510_list, l1, s, b = [1], 1, 2, set()
    for _ in range(10**6):
        i = s
        while True:
            if not i in b and i & l1:
                A115510_list.append(i)
                l1 = i
                b.add(i)
                while s in b:
                    b.remove(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Sep 24 2021

Formula

(4,6,5) is a 3-cycle and (2^k,2^k+1) for k = 1 and k > 2 are 2-cycles; all other numbers are fixed points. - Klaus Brockhaus, Jan 24 2006
In other words, a(2^k)=2^k+1 for k >= 3, a(2^k+1) = 2^k for k>=3, and otherwise a(n) = n for n >= 7. - N. J. A. Sloane, Mar 25 2022

Extensions

More terms from Klaus Brockhaus, Jan 24 2006

A373300 Sum of successive integers in a row of length p(n) where p counts integer partitions.

Original entry on oeis.org

1, 5, 15, 45, 105, 264, 555, 1221, 2445, 4935, 9324, 17941, 32522, 59400, 104808, 184569, 315711, 540540, 902335, 1504800, 2462724, 4014513, 6444425, 10316250, 16283707, 25610886, 39841865, 61720659, 94687230, 144731706, 219282679, 330996105, 495901413, 740046425
Offset: 1

Views

Author

Olivier Gérard, May 31 2024

Keywords

Comments

The length of each row is given by A000041.
As many sequences start like the positive integers, their row sums when disposed in this shape start with the same values.
Here is a sample list by A-number order of the sequences which are sufficiently close to A000027 to have the same row sums for at least 8 terms.

Examples

			Let's put the list of integers in a triangle whose rows have length p(n), number of integer partitions of n.
.
    1 |  1
    5 |  2  3
   15 |  4  5  6
   45 |  7  8  9 10 11
  105 | 12 13 14 15 16 17 18
  264 | 19 20 21 22 23 24 25 26 27 28 29
  555 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
.
The sequence gives the row sums of this triangle.
		

Crossrefs

Cf. A000027, seen as a triangle with shape A000041.
Cf. A373301, the same principle, but starting from integer zero instead of 1.
Cf. A006003, row sums of the integers but for the linear triangle.

Programs

  • Mathematica
    Module[{s = 0},
     Table[s +=
       PartitionsP[n - 1]; (s + PartitionsP[n])*(s + PartitionsP[n] - 1)/2 -
       s*(s - 1)/2, {n, 1, 30}]]
Showing 1-2 of 2 results.