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 310 results. Next

A257726 a(0)=0; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n)+1), where lucky = A000959, unlucky = A050505.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 5, 9, 6, 13, 11, 25, 8, 15, 14, 33, 10, 21, 19, 51, 17, 43, 35, 115, 12, 31, 22, 67, 20, 63, 45, 163, 16, 37, 29, 93, 27, 79, 66, 273, 24, 73, 57, 223, 47, 171, 146, 723, 18, 49, 42, 151, 30, 99, 88, 385, 28, 87, 83, 349, 59, 235, 203, 1093, 23, 69, 50, 193, 40, 135, 119, 559, 38, 129, 102, 475, 86, 367, 335, 1983, 34, 111
Offset: 0

Views

Author

Antti Karttunen, May 06 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A050505(n), and each right hand child as A000959(1+n), when a parent contains n >= 1:
0
|
...................1...................
2 3
4......../ \........7 5......../ \........9
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
6 13 11 25 8 15 14 33
10 21 19 51 17 43 35 115 12 31 22 67 20 63 45 163
etc.
Because all lucky numbers are odd, it means that even terms can only occur in even positions (together with odd unlucky numbers, for each one of which there is a separate infinite cycle), while terms in odd positions are all odd.

Crossrefs

Inverse: A257725.
Related or similar permutations: A237126, A246378, A257728, A257731, A257733, A257801.
Cf. also A183089 (another similar permutation, but with a slightly different definition, resulting the first differing term at n=9, where a(9) = 13, while A183089(9) = 21).
Cf. also A257735 - A257738.

Formula

a(0)=0; after which, a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n)+1).
As a composition of other permutations. For all n >= 1:
a(n) = A257731(A246378(n)).
a(n) = A257733(A237126(n)).
a(n) = A257801(A257728(n)).

A257725 Permutation of natural numbers: a(0) = 0, a(lucky(n)) = 1 + 2*a(n-1), a(unlucky(n)) = 2*a(n), where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 5, 12, 7, 16, 10, 24, 9, 14, 13, 32, 20, 48, 18, 28, 17, 26, 64, 40, 11, 96, 36, 56, 34, 52, 25, 128, 15, 80, 22, 192, 33, 72, 112, 68, 104, 50, 21, 256, 30, 160, 44, 384, 49, 66, 19, 144, 224, 136, 208, 100, 42, 512, 60, 320, 88, 768, 29, 98, 132, 38, 27, 288, 65, 448, 272, 416, 41, 200, 97, 84, 1024, 120, 37
Offset: 0

Views

Author

Antti Karttunen, May 06 2015

Keywords

Comments

In other words, after a(0) = 0, if n is the k-th lucky number [i.e., n = A000959(k)], a(n) = 1 + 2*a(k-1); otherwise, when n is the k-th unlucky number [i.e., n = A050505(k)], a(n) = 2*a(k).
Because all lucky numbers are odd, it means that odd numbers occur in odd positions only (together with some even numbers, for each one of which there is a separate infinite cycle), while the even positions contain only even numbers.

Crossrefs

Inverse: A257726.
Related or similar permutations: A237427, A246377, A257732, A257734.
Cf. also A257690 (another similar permutation, but with a slightly different definition, resulting the first differing term at n=13, where a(13) = 9, while A257690(13) = 11).
Cf. also A257735 - A257738.

Formula

a(0) = 0; for n >= 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = 1+(2*a(A109497(n)-1)), otherwise a(n) = 2*a(n-A109497(n)). [Where A109497(n) gives the number of lucky numbers <= n.]
As a composition of other permutations. For all n >= 1:
a(n) = A246377(A257732(n)).
a(n) = A237427(A257734(n)).

Extensions

Formula in name corrected by Antti Karttunen, Jan 10 2016

A256486 Difference between n-th Ludic and n-th Lucky number: a(n) = A003309(n) - A000959(n).

Original entry on oeis.org

0, -1, -4, -4, -6, -4, -8, -8, -8, -8, -8, -6, -8, -8, -16, -14, -8, -6, -4, -2, -4, -4, -8, -8, -4, 0, -8, -8, -6, -4, 2, -2, -2, -2, 4, 4, -10, -12, -2, 8, 6, 10, 4, 4, 2, 0, 2, 6, -2, 4, 10, 10, 4, 16, 18, 16, 26, 24, 18, 20, 26, 28, 22, 28, 26, 28, 30, 22, 24, 26, 22, 22, 18, 16, 18, 34, 34, 24, 18, 18, 20, 20
Offset: 1

Views

Author

Antti Karttunen, May 01 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A003309(n) - A000959(n).

A128756 Permutation sequence related to lucky numbers A000959: starting with the integers, for n = 1, 2, 3, ... swap the n-th and the (n-g)-th element, where g = A000959(n+1) - A000959(n) - 1.

Original entry on oeis.org

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

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu or ferencadorjan(AT)gmail.com), Mar 24 2007

Keywords

Comments

Similarly to A128754, this sequence also shows the characteristics of an "infinite braid".

Crossrefs

Inverse of A128757. Cf. A128754, A128755 and A000959.

Programs

  • PARI
    {vperm(z)=local(n,j,g); /* Permutation of positive integers: starting with the sequence of positive integers, for i = 1, 2, 3,..., swap the i-th term with max(i-g(i),1)-th term, where g(i) = z[i+1]-z[i]-1. */
      j=length(z)-1; n=j-z[j]+z[j-6]; v=[1..j];
      for(i=1,j, g=min(z[i+1]-z[i]-1,i-1); [v[i],v[i-g]]=[v[i-g],v[i]]);
      return(v[1..n])}
    a=vperm(A000959_upto(10^3))

Extensions

Edited by M. F. Hasler, Jan 09 2020

A130889 a(n) = smallest k such that A000959(n+1) = A000959(n) + (A000959(n) mod k), or 0 if no such k exists.

Original entry on oeis.org

0, 0, 5, 5, 11, 9, 17, 19, 29, 29, 31, 37, 47, 13, 59, 5, 5, 71, 71, 71, 9, 29, 31, 9, 107, 103, 5, 5, 131, 43, 131, 11, 5, 157, 167, 51, 5, 191, 7, 197, 199, 29, 5, 43, 227, 233, 233, 223, 257, 15, 9, 263, 281, 281, 281, 97, 13, 59, 317, 7, 17, 17, 47, 11, 353, 71, 349, 379, 389
Offset: 1

Views

Author

Rémi Eismann, Aug 21 2007 - Jan 23 2011

Keywords

Comments

a(n) is the "weight" of lucky numbers.
The decomposition of lucky numbers into weight * level + gap is A000959(n) = a(n) * A184828(n) + A031883(n) if a(n) > 0.

Examples

			For n = 1 we have A000959(n) = 1, A000959(n+1) = 3; there is no k such that 3 - 1 = 2 = (1 mod k), hence a(1) = 0.
For n = 3 we have A000959(n) = 7, A000959(n+1) = 9; 5 is the smallest k such that 9 - 7 = 2 = (7 mod k), hence a(3) = 5.
For n = 24 we have A000959(n) = 105, A000959(n+1) = 111; 9 is the smallest k such that 111 - 105 = 6 = (105 mod k), hence a(24) = 9.
		

Crossrefs

A183089 Tree generated by the lucky numbers: a(1) = 1; a(2n) = unlucky(a(n)), a(2n+1) = lucky(a(n+1)), where lucky = A000959, unlucky = A050505.

Original entry on oeis.org

1, 2, 3, 4, 7, 5, 9, 6, 21, 11, 13, 8, 31, 14, 15, 10, 87, 29, 37, 17, 49, 19, 25, 12, 141, 42, 51, 20, 63, 22, 33, 16, 517, 112, 133, 40, 189, 50, 69, 24, 259, 64, 75, 27, 111, 35, 43, 18, 925, 177, 211, 56, 267, 66, 79, 28, 339, 83, 93, 30, 159, 45, 67, 23, 4129, 618, 685, 143, 855, 167, 201, 54, 1275, 234, 261, 65, 391, 90, 105, 34
Offset: 1

Views

Author

Clark Kimberling, Dec 24 2010

Keywords

Comments

A permutation of the positive integers. See the comment at A183079.

Examples

			Top 6 levels of the binary tree:
                                     1
                                     |
                  ...................2...................
                 3                                       4
       7......../ \........5                   9......../ \........6
      / \                 / \                 / \                 / \
     /   \               /   \               /   \               /   \
    /     \             /     \             /     \             /     \
  21       11         13       8          31       14         15       10
87  29   37  17     49  19   25 12     141  42   51  20     63  22   33  16
...
From the level 3 to the level 4: 3 --> (7,5) and 4 --> (9,6).
		

Crossrefs

Inverse permutation: A257690.
Cf. A257726 (similar permutation with a slightly different definition, resulting the first differing term at n=9, where a(9) = 21, while A257726(9) = 13), A257735 - A257738.
Cf. A183079, A237739 (other similar permutations).

Formula

Let L(n) = A000959(n), the n-th lucky number.
Let U(n) = A050505(n), the n-th unlucky numbers.
The tree-array T(n,k) is then given by rows:
T(0,0) = 1; T(1,0) = 2;
T(n,2j) = L(T(n-1),j);
T(n,2j+1) = U(T(n-1),j);
for j = 0, 1, ..., 2^(n-1) - 1, n >= 2.
a(1) = 1; a(2n) = A050505(a(n)), a(2n+1) = A000959(a(n+1)). - Antti Karttunen, May 09 2015

Extensions

Added a formula to the Name field and more terms, edited Example section - Antti Karttunen, May 09 2015

A257731 Permutation of natural numbers: a(1) = 1, a(prime(n)) = lucky(1+a(n)), a(composite(n)) = unlucky(a(n)), where prime(n) = n-th prime number A000040, composite(n) = n-th composite number A002808 and lucky = A000959, unlucky = A050505.

Original entry on oeis.org

1, 3, 9, 2, 33, 5, 7, 14, 4, 45, 163, 8, 15, 11, 20, 6, 25, 59, 63, 203, 12, 22, 13, 17, 28, 10, 35, 78, 235, 83, 1093, 251, 18, 30, 19, 24, 31, 39, 16, 47, 67, 101, 43, 290, 107, 1283, 87, 309, 26, 41, 27, 34, 21, 42, 53, 23, 61, 88, 115, 128, 321, 57, 354, 137, 1499, 112, 349, 376, 36, 55, 1401, 38, 49, 46, 29, 56, 70, 32, 99, 81
Offset: 1

Views

Author

Antti Karttunen, May 06 2015

Keywords

Crossrefs

Inverse: A257732.
Related or similar permutations: A246377, A255421, A257726, A257733.
Cf. also A032600, A255553, A255554.
Differs from A257733 for the first time at n=19, where a(19) = 63, while A257733(19) = 203.

Formula

a(1) = 1; for n > 1: if A010051(n) = 1 [i.e., if n is a prime], then a(n) = A000959(1+a(A000720(n))), otherwise a(n) = A050505(a(A065855(n))).
As a composition of other permutations:
a(n) = A257726(A246377(n)).
a(n) = A257733(A255421(n)).

A257732 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = prime(a(n-1)), a(unlucky(n)) = composite(a(n)), where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505, and prime = A000040, composite = A002808.

Original entry on oeis.org

1, 4, 2, 9, 6, 16, 7, 12, 3, 26, 14, 21, 23, 8, 13, 39, 24, 33, 35, 15, 53, 22, 56, 36, 17, 49, 51, 25, 75, 34, 37, 78, 5, 52, 27, 69, 101, 72, 38, 102, 50, 54, 43, 106, 10, 74, 40, 94, 73, 134, 83, 98, 55, 135, 70, 76, 62, 141, 18, 100, 57, 125, 19, 99, 175, 114, 41, 130, 167, 77, 176, 95, 89, 104, 137, 86, 184, 28, 149, 133, 80, 164, 30
Offset: 1

Views

Author

Antti Karttunen, May 06 2015

Keywords

Comments

In other words, a(1) = 1 and for n > 1, if n is the k-th lucky number larger than 1 [i.e., n = A000959(k+1)] then a(n) = nthprime(a(k)), otherwise, when n is the k-th unlucky number [i.e., n = A050505(k)], then a(n) = nthcomposite(a(k)).

Crossrefs

Inverse: A257731.
Related or similar permutations: A246378, A255422, A257725, A257734.
Cf. also A032600, A255553, A255554.

Formula

a(1) = 1; for n > 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = A000040(a(A109497(n)-1)), otherwise a(n) = A002808(a(n-A109497(n))).
As a composition of other permutations:
a(n) = A246378(A257725(n)).
a(n) = A255422(A257734(n)).

A054978 Obtained from sequence of lucky numbers (A000959) by taking iterated absolute value differences of terms and extracting the leading diagonal.

Original entry on oeis.org

1, 2, 2, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 2, 2, 0, 0, 2, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 2, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 2
Offset: 0

Views

Author

Henry Gould, May 29 2000

Keywords

Comments

The classical Gilbreath-Proth Conjecture is that when iterated absolute differences are formed from the sequence of primes, the leading diagonal is 2,1,1,1,1,1,1,1,1,... (see A036262). This is an analog for the lucky numbers sequence.
This is the Gilbreath transform of the lucky numbers (cf. A362451). It appears that apart from the initial term, all the other terms are 0 or 2 (compare A362460). - N. J. A. Sloane, May 07 2023

References

  • Henry Gould, Gilbreath-Proth type sequence generated from Lucky numbers, unpublished.

Crossrefs

Programs

  • Haskell
    a054978 n = a054978_list !! n
    a054978_list = map head $ iterate
                   (\lds -> map abs $ zipWith (-) (tail lds) lds) a000959_list
    -- Reinhard Zumkeller, Feb 10 2015
  • Mathematica
    nmax = 104; (* index of last term *)
    imax = 400; (* max index of initial lucky array L *)
    L = Table[2 i + 1, {i, 0, imax}];
    For[n = 2, n < Length[L], r = L[[n++]]; L = ReplacePart[L, Table[r*i -> Nothing, {i, 1, Length[L]/r}]]];
    T[n_, n_] := If[n + 1 <= Length[L], L[[n + 1]], Print["imax should be increased"]; 0];
    T[n_, k_] := T[n, k] = Abs[T[n, k + 1] - T[n - 1, k]];
    a[n_] := T[n, 0];
    Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Sep 22 2021 *)
    A000959[upto_]:=Module[{s=2,a=Range[1,upto,2]},While[sA054978[upto_]:=Module[{d=A000959[upto]},Join[{1},Table[First[d=Abs[Differences[d]]],Length[d]-1]]];
    A054978[1000] (* Uses lucky numbers up to 1000 *) (* Paolo Xausa, May 11 2023 *)

Formula

a(n) = A254967(n,0). - Reinhard Zumkeller, Feb 11 2015

Extensions

More terms from Naohiro Nomoto, Jun 16 2001

A257690 Permutation of natural numbers: a(1) = 1, a(lucky(n)) = (2*a(n))-1, a(unlucky(n)) = 2*n, where lucky(n) = n-th lucky number A000959, unlucky(n) = n-th unlucky number A050505.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 5, 12, 7, 16, 10, 24, 11, 14, 15, 32, 20, 48, 22, 28, 9, 30, 64, 40, 23, 96, 44, 56, 18, 60, 13, 128, 31, 80, 46, 192, 19, 88, 112, 36, 120, 26, 47, 256, 62, 160, 92, 384, 21, 38, 27, 176, 224, 72, 240, 52, 94, 512, 124, 320, 184, 768, 29, 42, 76, 54, 63, 352, 39, 448, 144, 480, 95, 104, 43, 188, 1024, 248, 55
Offset: 1

Views

Author

Antti Karttunen, May 09 2015

Keywords

Crossrefs

Inverse permutation: A183089.
Cf. also A257725 (similar permutation with a slightly different definition, resulting the first differing term at n=13, where a(13) = 11, while A257725(13) = 9).
Cf. also A257735 - A257738.

Formula

a(1) = 1; for n > 1: if A145649(n) = 1 [i.e., if n is lucky], then a(n) = (2*a(A109497(n)))-1, otherwise a(n) = 2*a(n-A109497(n)). [Where A109497(n) gives the number of lucky numbers <= n.]
Showing 1-10 of 310 results. Next